Is there a “glyph not found” character?

前端 未结 8 1555
清歌不尽
清歌不尽 2020-12-09 08:48

Let\'s assume we have a text that contains a Unicode character that cannot be displayed because our font has no corresponding glyph. Usually, a placeholder is displayed inst

相关标签:
8条回答
  • 2020-12-09 08:56

    No, there is no “glyph not found” character. Different programs use different graphic presentations. An empty narrow rectangle is a common rendering, but not the only one. It could also be a rectangle with a question mark in it or with the code number of the character, in hexadecimal, in it.

    So it is better to e.g. display a small image of the character along with the character itself, so that the reader can compare them.

    0 讨论(0)
  • 2020-12-09 09:01

    From the Unicode Spec:

    • http://unicode.org/charts/PDF/U25A0.pdf

    U+25A1 □ WHITE SQUARE

    • may be used to represent a missing ideograph

    • U+20DE $⃞ combining enclosing square

    0 讨论(0)
  • The glyph-not-found character is specified by the font engine and by the font; there is no fixed character for it.

    0 讨论(0)
  • 2020-12-09 09:08

    There are 3 possible characters for glyph not found.

    Check in Microsoft specification, topic Shape of .notdef glyph, https://docs.microsoft.com/en-us/typography/opentype/otspec170/recom#shape-of-notdef-glyph

    0 讨论(0)
  • 2020-12-09 09:11

    Use a non-character like U+10FFFF (at the very end of the Unicode space) which is 99.99% certain to not be found in the cmap table of any sane font. At least no known Windows system font maps that non-character to a glyph, and highly unlikely any Linux/Mac system font either. Even the all encompassing Last Resort font (http://www.unicode.org/policies/lastresortfont_eula.html) doesn't appear to map it. So while there is no official "glyph not found" character defined in Unicode that will map to the .notdef glyph, the above non-character is in practice guaranteed to display that glyph, whatever the glyph design is in that particular font. The .notdef glyph (glyph id 0 in OpenType) may be a simple hollow rectangle (standard), box with x, box with question mark, blank occasionally (which is bad practice), and sometimes bizarre things like spirals (in Palatino Linotype).

    0 讨论(0)
  • 2020-12-09 09:14

    Also, (from what I've heard) Japanese uses the GETA MARK 〓 U+3013

    CJK Symbols and Punctuation

    0 讨论(0)
提交回复
热议问题