diff --git a/_static/fonts/NotoSansJP-VariableFont_wght.ttf b/_static/fonts/NotoSansJP-VariableFont_wght.ttf new file mode 100644 index 000000000..4769abcc5 Binary files /dev/null and b/_static/fonts/NotoSansJP-VariableFont_wght.ttf differ diff --git a/_static/fonts/noto-sans-jp-v54-japanese-regular.woff2 b/_static/fonts/noto-sans-jp-v54-japanese-regular.woff2 new file mode 100644 index 000000000..8da9e523d Binary files /dev/null and b/_static/fonts/noto-sans-jp-v54-japanese-regular.woff2 differ diff --git a/_static/pyos.css b/_static/pyos.css index dadecbfd0..38efa584e 100644 --- a/_static/pyos.css +++ b/_static/pyos.css @@ -1,4 +1,4 @@ -/* PyOS-specific vars :) */ +/* pyOS-specific vars :) */ :root { --pyos-color-primary: #703c87; --pyos-color-secondary: #8045e5; @@ -6,13 +6,14 @@ --pyos-color-tertiary: #a66c98; --pyos-color-dark: #542568; --pyos-color-light: #daabcf; + --pst-font-family-base: "Poppins", "Noto Sans JP", sans-serif; /* Darkmode Adjustments*/ --pyos-dm-color-primary: #c483e0; /* Fonts (overrides base theme) */ - --pst-font-family-heading: "Poppins", sans-serif; - --pst-font-family-base: "Poppins", sans-serif; + --pst-font-family-heading: "Poppins", "Noto Sans JP", sans-serif; + --pst-font-family-base: "Poppins", "Noto Sans JP", sans-serif; --pyos-font-family-h1: "Itim", serif; } @@ -257,6 +258,15 @@ See https://github.com/pydata/pydata-sphinx-theme/pull/1784 /* -------------------------------------- */ /* Generated by https://gwfh.mranftl.com/ */ +/* support japanese characters */ +@font-face { + font-family: "Noto Sans JP"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("./fonts/noto-sans-jp-v54-japanese-regular.woff2") format("woff2"); +} + /* poppins-regular - latin */ @font-face { font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */ diff --git a/conf.py b/conf.py index 63d1eb72d..504bf551a 100644 --- a/conf.py +++ b/conf.py @@ -18,6 +18,9 @@ import os from typing import TYPE_CHECKING from _ext import rss +# Support add fonts to opengraph (noto sans jp) +import matplotlib.font_manager as fm +from pathlib import Path if TYPE_CHECKING: from sphinx.application import Sphinx @@ -194,11 +197,19 @@ html_js_files = ["matomo.js", "language_select.js"] + + +# Path to the custom font +font_path = Path(__file__).parent / "_static/fonts/NotoSansJP-VariableFont_wght.ttf" +fm.fontManager.addfont(str(font_path)) + # Social cards ogp_site_url = "https://www.pyopensci.org/python-package-guide/" ogp_social_cards = { "line_color": "#6D597A", "image": "_static/pyopensci-logo-package-guide.png", + "font": "Noto Sans JP", + "font_path": str(font_path), } # Bibliographies diff --git a/noxfile.py b/noxfile.py index 8be2c5c25..4023a3739 100644 --- a/noxfile.py +++ b/noxfile.py @@ -9,6 +9,7 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent.absolute())) import conf +reuse_existing_virtualenvs = True ## Sphinx related options