Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Font Rendering for Japanese Language #825

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

f-matano44
Copy link

This pull request aims to improve the display of Japanese text on the website.

Changes made:

  1. Introduced a new CSS variable, --ja-font-family, to specify a priority list of fonts for Japanese text.
  2. Adjusted the --base-font-family variable for Japanese language context to prioritize --ja-font-family.

The new font family list prioritizes commonly available and high-quality fonts for Japanese text, such as "Hiragino Kaku Gothic ProN", "Meiryo", and "Noto Sans CJK JP". These changes will help to ensure that our Japanese text is displayed accurately and beautifully across various operating systems and browsers.

Please review the changes and let me know if any adjustments are needed.

Copy link
Owner

@CaiJimmy CaiJimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and sorry for the late reply!

}

body:lang(zh) {
--base-font-family: var(--zh-font-family), var(--sys-font-family), var(--cjk-font-family), sans-serif;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure about this value.

I would write:

--base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family),  var(--cjk-font-family), sans-serif;

So:

  1. Lato is used for the Latin alphabet
  2. In case Lato is not available, use --sys-font-family (which is optimized for the Latin alphabet)
  3. For CJK text, it won't match any of the previous cases, so it will try to use --zh-font-family and succeed.

The same rule applies to ja. It's important to have "Lato" in the first place, otherwise the Latin alphabet would use the CJK font and look really bad.

Does that make sense to you?

Copy link
Author

@f-matano44 f-matano44 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review, and I apologize for the delayed response.

Your comments were correct, so I have made the necessary revisions.
You might notice several push --force operations, which occurred due to my unfamiliarity with GitHub.
Please note that these do not affect the content of the commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants