Fix Japanese type in Grok Bot slides and the browser with lang=ja and Noto CJK
Overview
The author explains how to fix Japanese in Grok Bot-made Marp, HTML, or PDF slides, and in the cloud-computer browser, when kana look handwriting-like and kanji take a Chinese typeface.
Workflow
Trigger: Japanese in slides or in the browser looks wrong. The author collected fixes for when Grok Bot-made Marp, HTML, or PDF slides, or a page opened in Grok Bot's cloud-computer browser, show some hiragana and katakana in a handwriting-like face, and kanji in a Chinese typeface. The author says Japanese CJK fonts are installed, but if the slide or page does not specify language or typeface, a face that is not meant for Japanese may be selected. That cause is the author's explanation.
- Bot: When asking Grok Bot to make the slides or page, add lang=ja and Noto Sans CJK JP. The author suggests adding this request:
Meaning: In the HTML, add lang="ja", and set font-family to Noto Sans CJK JP.
HTML に lang="ja" を付けて、font-family に Noto Sans CJK JP を指定して
The author actually tried this. Adding lang=ja alone was enough for both hiragana and kanji to appear in a Japanese typeface (author's claim, not reproduced). Attached images show a slide before and after lang=ja, and a comparison of the same kanji word in a Chinese (SC) face versus a Japanese (JP) face, noting that one stroke of a shared component is a dot on the left and a horizontal bar on the right.
- Bot: If the cloud-computer browser still breaks Japanese, set fontconfig to prefer Noto CJK. The author says the same cause applies when a page opened in that browser has kana in a handwriting-like face: the page has not specified Japanese. This can be fixed in the computer settings by asking Grok Bot:
Meaning: In ~/.config/fontconfig/fonts.conf on Grok Bot's computer, make Noto Sans CJK JP and Noto Serif CJK JP the preferred faces for Japanese sans-serif and serif.
Grok Bot のコンピュータの ~/.config/fontconfig/fonts.conf で、sans-serif と serif の日本語に Noto Sans CJK JP と Noto Serif CJK JP が優先して選ばれるようにして
The author actually tried this setting, and hiragana and kanji then appeared in Japanese typefaces even on pages with no lang attribute (author's claim, not reproduced).
Check: The author reports those two trials and attached before-and-after images. The source does not describe a further check.
Key points and results
- The author says the fonts are already on the machine; the problem is selection when the page or slide does not specify Japanese. This is the author's explanation. Common symptoms are handwriting-like kana and kanji in a Chinese typeface.
- On the content side, the author tried adding lang=ja, and says that alone made both hiragana and kanji use a Japanese face. The suggested line also sets font-family to Noto Sans CJK JP. This is the author's claim, not reproduced.
- If the cloud-computer browser still breaks, the author tried a fonts.conf preference for Noto Sans CJK JP and Noto Serif CJK JP, and says Japanese faces then appeared even without a lang attribute. This is the author's claim, not reproduced.
Source
- Platform
- X
- Author
- Yasutaka Nishii
- Published
- Categories
- Content and writing
What this evidence label means
Source read in full
We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.