You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wide characters in rustdoc: Fall-back to default CJK serif font on Windows is ugly #84035
In Windows, browsers like Chrome and Firefox use legacy fonts as default serif font to render.
rustdoc uses its custom serif fonts, but these do not support CJK glyph, so the browser renders CJK characters as default one.
The problem is that the default serif font in Windows is so ugly and not clear.
The default sans-serif font looks just ok.
Take a look at this screenshot after matching the pixels on the monitor.
Why don't we just use sans-serif font for rustdoc? Or, we can use sans-serif fonts that look like serif font.
ghost changed the title [-]CJK characters with Windows default serif fonts in doc are ugly and not clear[/-][+]Use serif font or serif like sans-serif font in rustdoc for multilingual legibility[/+]on Apr 9, 2021
In Windows, browsers like Chrome and Firefox use legacy fonts as default serif font to render.
rustdoc uses its custom serif fonts, but these do not support CJK glyph, so the browser renders CJK characters as default one.
The problem is that the default serif font in Windows is so ugly and not clear.
The default sans-serif font looks just ok.
Take a look at this screenshot after matching the pixels on the monitor.
Why don't we just use sans-serif font for rustdoc? Or, we can use sans-serif fonts that look like serif font.
Huh. I have a recently installed Windows, and on both Firefox and Edge, I see:
This looks much more similar to your second image. I wonder if #83156 or #82315 affected this? Or maybe it is because I do not have batang.ttc installed? Windows says the only Korean font I have is "Malgun Gothic". Having a good CJK default is ideal, so I am very interested in finding out exactly what is going on here.
ghost changed the title [-]Use serif font or serif like sans-serif font in rustdoc for multilingual legibility[/-][+]Use serif font or enable sans-serif font for CJK characters[/+]on Apr 9, 2021
Oh I see, that makes sense. So because it can't find a Korean serif font, it might have used a Korean sans serif font.
Checking... yep, Firefox says that it is using Malgun Gothic instead on https://docs.rs/xingapi/0.2.6/xingapi/, and obviously "have no meh-looking Korean serif fonts already installed" is not really a reasonable expectation.
ghost changed the title [-]Use serif font or enable sans-serif font for CJK characters[/-][+]Wide characters in rustdoc: Fall-back to default CJK serif font on Windows is ugly[/+]on Apr 11, 2021
Noto Sans is quite adequate on a local installation, but that is indeed a fair amount of MB to transfer.
My understanding is that most docs in KR are going to be almost 100% using Hangul characters and very rarely if ever use characters from the rest of the CJK character set, is that correct? There would most certainly be a huge difference between that and a font that loads Japanese characters, which I would expect to cover 2000~3000 kanji, and the SC or TC fonts which would have to cover as many as 5000 hanzi.
Activity
[-]CJK characters with Windows default serif fonts in doc are ugly and not clear[/-][+]Use serif font or serif like sans-serif font in rustdoc for multilingual legibility[/+]workingjubilee commentedon Apr 9, 2021
Huh. I have a recently installed Windows, and on both Firefox and Edge, I see:

This looks much more similar to your second image. I wonder if #83156 or #82315 affected this? Or maybe it is because I do not have
batang.ttcinstalled? Windows says the only Korean font I have is "Malgun Gothic". Having a good CJK default is ideal, so I am very interested in finding out exactly what is going on here.[-]Use serif font or serif like sans-serif font in rustdoc for multilingual legibility[/-][+]Use serif font or enable sans-serif font for CJK characters[/+]workingjubilee commentedon Apr 9, 2021
Oh I see, that makes sense. So because it can't find a Korean serif font, it might have used a Korean sans serif font.

Checking... yep, Firefox says that it is using Malgun Gothic instead on https://docs.rs/xingapi/0.2.6/xingapi/, and obviously "have no meh-looking Korean serif fonts already installed" is not really a reasonable expectation.
[-]Use serif font or enable sans-serif font for CJK characters[/-][+]Wide characters in rustdoc: Fall-back to default CJK serif font on Windows is ugly[/+]jsha commentedon Apr 13, 2021
Would it work to add Noto Sans CJK as a custom font-face, and then include it in the fallback list, like:
workingjubilee commentedon Apr 14, 2021
Noto Sans is quite adequate on a local installation, but that is indeed a fair amount of MB to transfer.
My understanding is that most docs in KR are going to be almost 100% using Hangul characters and very rarely if ever use characters from the rest of the CJK character set, is that correct? There would most certainly be a huge difference between that and a font that loads Japanese characters, which I would expect to cover 2000~3000 kanji, and the SC or TC fonts which would have to cover as many as 5000 hanzi.
Rollup merge of rust-lang#84048 - konan8205:master, r=jsha