Font fallback best practices?
Posted: 11 Mar 2025, 11:58
Hi,
I am working on a project that allows users to submit content. This content can be in any language and so I want to have fallbacks for all languages that we localize to. So far this is including Russian characters, Chinese characters, and Persian to name a few. Currently I handle fallbacks like this, when the font family is set to the default.
Do I need to include these fallbacks for every font family resource definition I add? If I want to switch to a monospace font for instance, I understand that I might want a monospace font in these other languages but, for most font families I can't find equivalents. Is there a way to set fallbacks globally?
I know there's an option in Unity for loading platform fonts but, to explicitly have fallbacks like this what is the best practice?
Thanks,
David
I am working on a project that allows users to submit content. This content can be in any language and so I want to have fallbacks for all languages that we localize to. So far this is including Russian characters, Chinese characters, and Persian to name a few. Currently I handle fallbacks like this, when the font family is set to the default.
Code: Select all
<FontFamily x:Key="Font.Family.Default">
./../../Fonts/RedHat/#Red Hat Display,
./../../Fonts/NotoSans/#Noto Sans,
./../../Fonts/Rubik/#Rubik,
./../../Fonts/LXGW/#LXGW WenKai TC
</FontFamily>I know there's an option in Unity for loading platform fonts but, to explicitly have fallbacks like this what is the best practice?
Thanks,
David