I know that the default font for WPF is Segoei UI
. This font for example doesn't have the glyphs for Chinese characters. So when user put a text like below, how does it detect which font it should use to render them correctly. Does it check for the range of each character and finds a font that has those characters, or is it internally using some font that contains most Unicode characters?

- 13,257
- 13
- 53
- 62

- 495
- 5
- 14
1 Answers
This mechanism in WPF is called Font Fallback
Font Fallback
Font fallback refers to the automatic substitution of a font other than the font that is selected by the client application. There are two primary reasons why font fallback is invoked:
The font that is specified by the client application does not exist on the system.
The font that is specified by the client application does not contain the glyphs that are required to render text.
In WPF, the font fallback mechanism uses the default fallback font family, "Global User Interface", as the substitute font. This font is defined as a composite font, whose file name is "GlobalUserInterface.CompositeFont". For more information about composite fonts, see the Composite Fonts section in this topic.
(In case you asked because you want to change the fallback font, the linked article contains a list of default Fallback Fonts that are part of WPF and instructions on how to set fallback fonts manually.)
Here are a couple of Fonts created by Microsoft for specific charsets:
Segoe UI includes Latin, Greek, Cyrillic, and Arabic characters. There are new fonts, also optimized for ClearType, created for other character sets and uses. These include Meiryo for Japanese, Malgun Gothic for Korean, Microsoft JhengHei for Chinese (Traditional), Microsoft YaHei for Chinese (Simplified), Gisha for Hebrew, and Leelawadee for Thai, and the ClearType Collection fonts designed for document use.

- 1
- 1

- 13,257
- 13
- 53
- 62
-
Perfect answer, is it possible to change the `Fallback font` to something that is not provided by microsoft? For example `Noto` font by google? – Lion King Mar 13 '18 at 08:45
-
1As far as I understood the first article it should be no problem. [This example](https://learn.microsoft.com/en-us/dotnet/api/system.windows.media.fontfamily?view=netframework-4.7.1#defining-a-font-fallback-sequence-in-code) even shows how to mix installed fonts and fonts from embedded resources so you probably don't even have to install the font. – Manfred Radlwimmer Mar 13 '18 at 08:49
-
Do you happen to know the exact sequence of the font they use in case of fallback (default one) – Lion King May 03 '18 at 09:02
-
1@LionKing No, I only he the details that are in the linked articles. – Manfred Radlwimmer May 03 '18 at 09:07