Page MenuHomeSolus

Both Chrome and FireFox couldn't dynamically change the default CJK fallback font by reading HTML lang tag used in webpages.
Open, Needs More InfoPublic

Description

Let me redescribe this issue with some background knowledges.

Solus 4.1 comes without complete support of CJK font fallbacks unless additional font packages are introduced. In this case, we use noto-CJK.
noto-CJK brings support of 5 standards of kanji ideograph defining how strokes are written.
These standards are used in Mainland China, Taipengjinma (Taiwan + Penghu + Jinmen + Mazu), Hongkong, Japan, and Korea.

Regardless the system UI language settings, a web browser at this age is supposed to:

  1. read the lang tag from the HTML file:
zh-Hans [Region Neutral] [Simplified Chinese]
zh-Hans-CN [Used in Mainland China] [Simplified Chinese]
zh-Hans-HK [Used in HK] [Simplified Chinese]
zh-Hans-MO [Used in Macau] [Simplified Chinese]
zh-Hans-SG [Used in Singapore] [Simplified Chinese]
zh-Hans-TW [Used in Taiwan, Penghu, Jinmen, Mazu] [Simplified Chinese]
zh-Hant [Region Neutral] [Traiditional Chinese]
zh-Hant-CN [Used in Mainland China] [Traiditional Chinese]
zh-Hant-HK [Used in HK] [Traiditional Chinese]
zh-Hant-MO [Used in Macau] [Traiditional Chinese]
zh-Hant-SG [Used in Singapore] [Traiditional Chinese]
zh-Hant-TW [Used in Taiwan, Penghu, Jinmen, Mazu] [Traiditional Chinese]
ja [Region Neutral] [Japanese]
ja-JP [Used in Japan] [Japanese]
ko [Region Neutral] [Korean]
ko-KR [Used in South Korea] [Korean]

(Note that "zh-TW / zh-CN / zh-HK" are supposed to be deprecated but I found that they are still being used in most Linux distros. This confuses me well.)

  1. According to which tag the browser read from the HTML page (it can be defined in a span, div or the entire HTML block), the browser is supposed to ask the operating system (or Chrome Advanced Font Settings / FireFox per-language font settings) to see which CJK fallback font is suitable for this lang tag, and use this font to display the content.

To mention: the full-width period symbol is shown in the middle if displayed through zh-Hant-TW fonts (if they are made according to local educational standards) like "Noto Sans CJK TC".

Now let's repeat this issue:

  1. Let Solus 4.1 system UI language to be set as any CJK language (except zh-TW Chinese Traditional Taiwan). // Recommending zh(-Hans)-CN or Japanese or Korean.

Then, reboot your system.

  1. Open either Chrome or Firefox. Make sure their font settings are vanilla or set as "sans-serif" for all languages. If Chrome Advanced Font Settings plugin is installed, uninstall it.
  1. Open any page from Chinese Wikipedia (zh-TW variant) because its HTML lang tag is "zh-Hant-TW". In this case we use https://zh.wikipedia.org/wiki/Budgie_(%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83)

Expected Result: The full-width period symbol is expected to be shown both vertically and horizontally middle in its em square box, proving that the Noto Sans CJK TC font installed in the current Solus 4.1 system is correctly read and used in this webpage.
Actual Result: Even if using browser inspector to change "zh-Hant-TW" to its deprecated form "zh-TW", the issue still exists that only the CJK fallback font of the current Solus 4.1 UI lanuguage settings gets used in this page.


To mention that macOS 10.15 doesn't have this issue (I didn't test previous macOS builds).
Since both Chrome and Firefox on Solus 4.1 have this issue, I believe that there must be some prime cause in the operating system.

Event Timeline

ShikiSuen created this task.Aug 5 2020, 3:56 PM
Staudey added a subscriber: Staudey.Aug 5 2020, 6:21 PM

Not that I know anything about this stuff, but interestingly the https://zh.wikipedia.org/zh-tw/Budgie_(%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83) page seems to work correctly in regard to that symbol.
I'm also getting a warning on the main page you linked:

"您现在使用的中文变体可能会影响一些词语繁简转换的效果。建议您根据您的偏好切换到下列变体之一:"
"The Chinese variant you are currently using may affect the conversion effect of some words. We recommend that you switch to one of the following variants based on your preference:"

followed by a list of zh-tk, zh-tw, etc. variants.

ShikiSuen added a comment.EditedAug 5 2020, 6:40 PM

Not that I know anything about this stuff, but interestingly the https://zh.wikipedia.org/zh-tw/Budgie_(%E6%A1%8C%E9%9D%A2%E7%8E%AF%E5%A2%83) page seems to work correctly in regard to that symbol.

May I confirm whether you have switched the Solus system UI language to any of zh-CN / ja-JP / ko-KR ?

Also, please remove the DroidSansFallback and DroidSansJapanese fonts to prevent them from misleading system font fallback procedures. These two fonts are supposed to be deprecated.

I'm also getting a warning on the main page you linked:
"您现在使用的中文变体可能会影响一些词语繁简转换的效果。建议您根据您的偏好切换到下列变体之一:"
"The Chinese variant you are currently using may affect the conversion effect of some words. We recommend that you switch to one of the following variants based on your preference:"
followed by a list of zh-tk, zh-tw, etc. variants.

Regarding the warning you have seen, simply click onto the zh-tw variant.
(It is weird to see this warning since the link I posted already has zh-tw specified.)

Staudey added a comment.EditedAug 5 2020, 6:48 PM

May I confirm whether you have switched the Solus system UI language to any of zh-CN / ja-JP / ko-KR ?
Also, please remove the DroidSansFallback and DroidSansJapanese fonts to prevent them from misleading system font fallback procedures. These two fonts are supposed to be deprecated.

No, sorry, I was just quickly browsing the dev tracker and posted that comment without much thought. I'm going to let people who actually use CJK fonts take a look at this before I add more noise.

DataDrake triaged this task as Needs More Info priority.Nov 14 2020, 5:52 PM
DataDrake removed a project: Third Party Software.
DataDrake added a subscriber: DataDrake.

While I appreciate the amount of detail you've gone into, I don't really know enough to say what the root cause is. You'll probably want to reach out to the Firefox team and get their opinion. It's possible that it's not supported at all on Linux for various reasons.