When you create a Composite Font
you set what font families you want. Then you can set Fallback Font Family
, which worked great in a simple test with Noto Serif and Noto Serif JP. When a Japanese character was used it knew to use that fallback family.
But what if you have Noto Serif Regular, Noto Serif Italic and Noto Serif Bold, how can you set a fallback font for each of them, so that when Noto Serif Regular was used and a Japanese character is written, the engine will use Noto Serif JP Regular? The same for when Italic and Bold is used.
Example of Composite Font
:
While in this example is 1-1, you can add Noto Serif Korean, Noto Serif Lao, Noto Serif Bengali…, and that way it is not 1-1 anymore.
In this case do you have to give up on Typeface and make a new Font for each and have only regular from each font in one file, same for italic and bold? Or actually there is a way to link them?
I did a few more tests, this time I also added NotoSerifKR regular and bold but for some reason that didn’t work with 안녕.
Then I added NotoSerifTC regular and tested with 你好 and it worked. But after that I changed Typeface
to bold without actually adding NotoSerifTC-Bold inside the Composite Font
as fallback font family and it still worked, the characters became bold.
Why it didn’t work with 안녕, but it actually worked to set the characters to bold even tho I didn’t added NotoSerifTC-Bold inside the Composite Font
?
What you are suppose to do is:
- Set
Default Font Family
to your general font, example Noto Serif
and for this set the Typeface
for Regular
and optional Italic
, Bold
and Bold Italic
- If you want to support multiple language characters for each additional one add a
Sub-Font Family
with it’s character range and font.
a) In case there are multiple languages that use the same ranges like CJK you can set a default general language for the style of those characters like Japanese, and then add an aditional Sub-Font Family
and set a culture for that one. As practical example you use Japanese for general CJK and for Chinese and Korean you add for each one tied to their culture:
This will be used to display
Japanese and
CJK characters for all languages the game is set to, using
Japanese character style
This will be used to display
Chinese characters for all languages the game is set to, using
Simplified Chinese style
This will be used to display
CJK characters and also
Chinese characters for when
Simplified Chinese language is the game set to, using
Simplified Chinese style
This will be used to display
CJK characters and also
Chinese characters for when
Traditional Chinese language is the game set to, using
Traditional Chinese style
This will be used to display
Korean characters for all languages the game is set to, using
Korean character style
This will be used to display
CJK characters for when
Korean language is the game set to, using
Korean character style
- Now after all this is set, you can add a
Fallback Font Family
for any other languages not supported by those fonts. I simply use Roboto, it doesn’t support all languages, but that is why is used as fallback font. For example it doesn’t support Arabic, so for that you could add an aditional Sub-Font Family
with Noto Naskh Arabic and ranges for Arabic, Arabic Supplement, Arabic Extended-A, Arabic Presentation Forms-A, Arabic Presentation Forms-B without having to set a culture for it.