当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - How do we know if a true type font has code points above 0xFFFF?

问题描述:

How do we know if a true type font has code points above 0xFFFF ?

网友答案:

There's an API (GetFontUnicodeRanges/GetGlyphIndices), but it doesn't go above 0xFFFF, as I suspect you know.

There are 2 obvious methods for finding out programatically:

  1. Parse the .ttf file (the spec is open-ish)
  2. Try and measure the output of the characters you are interested in and compare the measurements to the known replacement character

This answer has a .NET/C# solution: Get supported characters of a font - in C#

网友答案:

If running Windows 7+, you can call DirectWrite's IDWriteFontFace::GetGlyphIndices to get the nominal glyph id's from the cmap of given code points, or IDWriteFontFace1::GetUnicodeRanges (either Win 8+ or Platform Update for Windows 7) if you just want to know all the ranges. GDI GetGlyphIndices and Uniscribe ScriptGetCmap supported only the basic multi-lingual plane.

分享给朋友:
您可能感兴趣的文章:
随机阅读: