问题描述:

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.

相关阅读:
Top