コード例 #1
0
            public void AddChar( ushort platID, 
                                 ushort encID, 
                                 BigUn charcode, 
                                 ushort glyphID )
            {
                CachedSubtable st = m_arrSubtables.GetSubtable(platID, encID);
                if (st != null)
                {
                    if ((uint)charcode >= (uint)st.m_CharToGlyphMap.Length)
                    {
                        uint[] newmap = new uint[(uint)charcode+1];
                        System.Buffer.BlockCopy( st.m_CharToGlyphMap, 0, 
                                                 newmap, 0, 
                                                 st.m_CharToGlyphMap.Length*4);
                        st.m_CharToGlyphMap = newmap;
                    }

                    st.m_CharToGlyphMap[(uint)charcode] = glyphID;
                }
                else
                {
                    throw new ApplicationException("subtable not found");
                }

                m_bDirty = true;
            }
コード例 #2
0
            public void RemoveChar(ushort platID, ushort encID, BigUn charcode)
            {
                CachedSubtable st = m_arrSubtables.GetSubtable(platID, encID);
                if (st != null)
                {
                    st.m_CharToGlyphMap[(uint)charcode] = 0;
                }
                else
                {
                    throw new ApplicationException("subtable not found");
                }

                m_bDirty = true;
            }
コード例 #3
0
            // accessors for the cached data

            public ushort MapCharToGlyph( ushort platID,
                                          ushort encID, 
                                          BigUn charcode )
            {
                ushort glyphID = 0xffff;

                CachedSubtable st = m_arrSubtables.GetSubtable(platID, encID);
                if (st != null)
                {
                    glyphID = (ushort)st.m_CharToGlyphMap[(uint)charcode];
                }
                else
                {
                    throw new ApplicationException("subtable not found");
                }

                return glyphID;
            }