Skip to content

Use Noto Sans JP as a fallback on Japanese guide pages - #845

Open
JP-Mendez wants to merge 1 commit into
pyOpenSci:mainfrom
JP-Mendez:docs/vendor-japanese-fallback-font
Open

JP-Mendez wants to merge 1 commit into
pyOpenSci:mainfrom
JP-Mendez:docs/vendor-japanese-fallback-font

Conversation

@JP-Mendez

Copy link
Copy Markdown

Fixes #515. Japanese pages now use a bundled Noto Sans JP font as a fallback after Poppins and Nunito Sans. The variable font is losslessly compressed to a 4.1 MiB WOFF2 and shipped with its SIL Open Font License. The language selector limits use of the asset to Japanese pages.

The Japanese Sphinx build completed. In the rendered guide, the browser loaded the font and used the Japanese font stack for the body, title and navigation. The conversion preserved all 16,732 glyph mappings. The existing OpenGraph social-card font warnings are outside the HTML fallback scope.

Font source: https://github.com/google/fonts/tree/5026800714d07231937d92eb4cceabf06e05d74e/ofl/notosansjp

Disclosure: OpenAI Codex prepared the change and ran the validation.

@netlify

netlify Bot commented Nov 29, 2026

Copy link
Copy Markdown

👷 Deploy request for python-package-guide pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 5eb7211

@InessaPawson InessaPawson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@JP-Mendez Thank you for your interest in contributing to PyOpenSci! Could you share a bit more about the motivation behind this PR? Did you run into any specific issues with the current system font fallback? I'd like to better understand if the proposed improvement justifies adding 4.15 MiB and the associated maintenance overhead into this codebase.

@InessaPawson

Copy link
Copy Markdown
Contributor

@JP-Mendez I now see that vendoring Noto Sans JP was proposed in #504 and #515.

Looking at the original warnings in #504, I don't think the proposed solution addresses the root cause. The warnings come from sphinxext-opengraph generating social cards with Matplotlib. The font missing the Japanese glyphs is Roboto Flex, used to render the card images at build time, not Poppins in our CSS. Japanese text in the browser already falls back to available system fonts, so adding Noto Sans JP to pyos.css won't resolve these warnings.

What needs to happen is to configure a font with Japanese glyph coverage via ogp_social_cards in conf.py and make it available at build time. @JP-Mendez, would you be interested in reworking the PR in that direction?

This branch has not been deployed

No deployments
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.

Add Noto Sans JP as a fall back font to support Japanese characters in our packaging guide

2 participants