international-labour-organization / designsystem

A design system for the International Labour Organization
Apache License 2.0
1 stars 3 forks source link

Fonts: Chinese text mixes Chinese and Japanese fonts #986

Open justintemps opened 2 months ago

justintemps commented 2 months ago

Right now, font-family declarations look like this:

font-family: "Noto Sans", "Noto Sans CJK JP", "Yu Gothic", "Hiragino Sans", TakaoPGothic, "PingFang SC", "Microsoft YaHei", 微软雅黑, sans-serif

Here we're using fallbacks to render the right font in the right language under the assumption that all glyphs for that language will be rendered by the first available font.

The problem is that Japanese fonts use a subset of Chinese glyphs. As a result, for Windows users who have both Yu Gothic and Microsoft YaHei installed, in a single block of text, both fonts end up getting rendered:

Example from a Window Machine Running Microsoft Edge.

54f29542-38d4-4162-bb1d-d119bbc0085e

344a59a9-3824-4c89-b84c-6f2b2d2295f7

It's possible that these two font-face declarations can't live side by side and that we'll have to create a separate font-face file for Chinese and Japanese, the way we do for Arabic.

justintemps commented 2 months ago

@GGKapanadze I'm assuming that you have some experience managing fonts that use different glyphs, would you be able to give this a look and confirm that the only way to solve it is by separating the font-face declarations?