fabd / kanji-koohii

A web application to help Japanese language learners remember the kanji.
https://kanji.koohii.com
GNU Affero General Public License v3.0
219 stars 21 forks source link

Swap macOS/iOS fonts to JIS2004 standard #300

Open Drewbadour opened 1 year ago

Drewbadour commented 1 year ago

On Darwin-based platforms like macOS, iPhoneOS, and iPadOS, Kanji aren't rendered correctly due to adhering to an older standard than is generally accepted. The JIS2004 standard is the most recent update to Kanji writing, and is reflected in the writing samples from sites like Jisho. Apple developed a standard on their platforms that JIS2004-compliant fonts have an "N" suffix on them. So simply adding "N" to the existing Darwin-specific font options resolves the issue.

Here's an example of the difference in the two in macOS:

Screen Shot 2023-03-21 at 3 11 06 PM
Kanji Heisig # Jisho Link
297 https://jisho.org/search/%E8%BE%BB%20%23kanji
492 https://jisho.org/search/%E8%91%9B%20%23kanji
1699 https://jisho.org/search/%E5%83%85%20%23kanji
2053 https://jisho.org/search/%E7%89%99%20%23kanji
2330 https://jisho.org/search/%E5%B1%91%20%23kanji
2646 https://jisho.org/search/%E7%A5%87%20%23kanji

Additional notes on JIS2004 can be found here: https://en.wikipedia.org/wiki/JIS_X_0213. And the topic is discussed in Dr. Ken Lunde's CJKV Input Processing.

This issue does not appear to be present in the same capacity on Windows. Though Kanji accuracy does appear to be dependent on whether or not the Japanese keyboard (and thus proper Japanese fonts) have been installed on the machine. Droid Sans Japanese also appears to be non-JIS2004 compliant. However, a fix for that is outside of the scope of this PR.