050644zf / ArknightsStoryTextReader

A website that help you read Arknights Stories
https://astr.pages.dev
MIT License
306 stars 19 forks source link

Forcing correct fonts for Japanese #46

Closed Lyroxide closed 1 year ago

Lyroxide commented 1 year ago

In Chromium based browsers, if Japanese fonts are not configured in the browser settings, then the website's Japanese text will be shown in Chinese font.

I personally like to switch back and forth between reading the story in Chinese and Japanese, so it would be best if your website forces the correct font for each language.

Some Japanese fonts include:

  1. IPAexGothic
  2. Meiryo
  3. MS Gothic
  4. Yu Gothic
  5. Hiragino Kaku Gothic Pro
  6. Noto Sans CJK JP Regular
050644zf commented 1 year ago

Thank you for your feedback, I know what the problem is but i need a reference so i can make sure my fix taking affect. Could u plz providing a screenshot of wrong JP glyph and correct glyph in ASTR?

Lyroxide commented 1 year ago

In my Chromium Settings, under 'Appearance' -> Customise fonts, I changed my Sans-serif font to 'Meiryo'.

This worked well for viewing Japanese. For example, the word 経験 is shown correctly: chrome_02ev7LP47J

However, if I used the same font to view CN, some hanzi revert back to default font because that hanzi doesn't exist as a Japanese kanji: chrome_v4ToIs5ju1

If I change my font back to 'Arial', then the Japanese text would look like this, where the 部首 for '経' is wrong: chrome_ysLbppFcJe

There is a simple fix: Source Han Serif contains many fonts that support Simplified/Trad Chinese, Japanese, and Korean. (And they look nicer than Arial!)

050644zf commented 1 year ago

image Ya that font looks nicer indeed, i will use different language of the font in the content. New version will be released asap

Lyroxide commented 1 year ago

Sorry. While you're at it, do you mind adding for Korean as well?

050644zf commented 1 year ago

Sorry. While you're at it, do you mind adding for Korean as well?

Sure, will be pushed soon