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); }
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(); } }
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); }
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(); } }