Beispiel #1
0
            public bool TryGetValue(int key, out ushort value)
            {
                ushort localValue;

                unsafe
                {
                    uint  uKey = checked ((uint)key);
                    uint *pKey = &uKey;

                    MS.Internal.Text.TextInterface.FontFace fontFace = _font.GetFontFace();
                    try
                    {
                        fontFace.GetArrayOfGlyphIndices(pKey, 1, &localValue);
                    }
                    finally
                    {
                        fontFace.Release();
                    }

                    value = localValue;
                }

                // if a glyph is not present, index 0 is returned
                return(value != 0);
            }
Beispiel #2
0
 internal unsafe void TryGetValues(uint *pKeys, uint characterCount, ushort *pIndices)
 {
     MS.Internal.Text.TextInterface.FontFace fontFace = _font.GetFontFace();
     try
     {
         fontFace.GetArrayOfGlyphIndices(pKeys, characterCount, pIndices);
     }
     finally
     {
         fontFace.Release();
     }
 }
Beispiel #3
0
        private byte[] GetFontTable(Text.TextInterface.OpenTypeTableTag openTypeTableTag)
        {
            byte[] table;

            MS.Internal.Text.TextInterface.FontFace fontFace = _font.GetFontFace();
            try
            {
                if (!fontFace.TryGetFontTable(openTypeTableTag, out table))
                {
                    table = null;
                }
            }
            finally
            {
                fontFace.Release();
            }

            return(table);
        }
Beispiel #4
0
 private void ComputeFontTechnology()
 {
     MS.Internal.Text.TextInterface.FontFace fontFace = _font.GetFontFace();
     try
     {
         if (fontFace.Type == Text.TextInterface.FontFaceType.TrueTypeCollection)
         {
             _fontTechnology = FontTechnology.TrueTypeCollection;
         }
         else if (fontFace.Type == Text.TextInterface.FontFaceType.CFF)
         {
             _fontTechnology = FontTechnology.PostscriptOpenType;
         }
         else
         {
             _fontTechnology = FontTechnology.TrueType;
         }
     }
     finally
     {
         fontFace.Release();
     }
 }