How can a Label control display Japanese characters properly when the Font used doesn't support this language?

前端 未结 1 991
被撕碎了的回忆
被撕碎了的回忆 2020-11-27 22:55

I am working on a Windows Forms application, with .Net 4.5 as target framework.

One thing I have noticed that if I display text in Japanese language on Label

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 23:05

    About Font fallback.
    System feature, tied to the International Font Management. It automates the selection of a font other than the font selected by the user in an application, to represent glyphs that the font in use can't handle.
    See also: International Font Enumeration and Selection

    A selection of predefined font substitues can be found in the System Registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
    

    An example and some notes, in relation to the RichTextBox/RichEdit control, are reported here:
    Some keys change my RichTextBox font

    The control is created with EM_SETLANGOPTIONS set to the IMF_AUTOFONT option.
    The predefined behaviour, when an Unicode subset cannot be displayed by the current font, it's an automatic font fallback. The text selection reports the font substitute reference.

    A font substitute can be selected using the Unicode Subset Bitfields when the default mapping doesn't return a direct match.

    Any font subsitution is in relation with the current system language and the available installed fonts. A number of fonts is specifically installed by the System to support this feature. The fallback font are usually marked as "Hidden" in the System Font repository (\Windows\Fonts in Windows). These can be marked as usable/enumerable, using the Show command in the toolbar button or contextual menu.
    (Arial Unicode is among these).

    See also:

    International Fonts and Text Display
    About Multilingual User Interface
    Using Font Fallback
    Uniscribe

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