How to customize fonts in Mkdocs (Xia Wu Wen Kai)


The font currently used by the website: Xiadong Wenkai
Presumably you can intuitively feel the beauty of this font from my website.

Small broken website

The following is an excerpt from the official introduction document of some fonts

Notes

  • Please submit feedback in Issue #33 for text additions, and Issue #14 for font adjustments. Do not open a separate issue for easy organization.
  • If you need to use this font on the website, please refer to Issue #24.
  • For issues related to mobile phone font replacement such as the Magisk font module, please move to the Issues of the module template to give feedback, and do not open an issue in this project.
  • More versions (subject to change) :
    • Xiaqu Wenkai Screen Reader / LXGW WenKai Screen: Suitable for PC and Android phone screen display without special switching to bold.
    • Xiaquwenkai Lite version / LXGW WenKai Lite: Compared with the full version, some less commonly used characters are removed, which is convenient for developers to embed fonts into software.
    • Xiaqu Wenkai GB / LXGW WenKai GB: Further adjust the font and stroke shape to meet the G font specification. Contains 8105 Chinese characters in the “General Standard Chinese Character List”.
    • Xiaqu Wenkai TC / LXGW WenKai TC: The old font version refers to the “Inherited Glyph Standardization Document” of “Yizizifang” to modify the components, which is suitable for traditional Chinese users and old font lovers.
    • LXGW Bright: A combined Chinese and English font paired with the Ysabeau family of fonts.

LXGW WenKai / Xia Wu Wenkai

An open-source Chinese font derived from Fontworks’ Klee One. An open-source Chinese font, derived from the font Klee One produced by FONTWORKS.

Project Introduction

In December 2020, FONTWORKS, a famous Japanese font manufacturer, released seven Japanese fonts on GitHub, namely Train, Klee, Stick, Rock-n-Roll, Reggae, Rampart and DotGothic16, according to SIL Open The Font License 1.1 license is open source. The 7 open source Japanese fonts each have their own characteristics, and among the 7 fonts, Klee has the largest number of characters.

This is a font with the style of Japanese textbooks, which has the characteristics of imitating Song and Kai, and has high readability. Some DIY font enthusiasts have successively used imitation Song and other fonts to complete this font. As a beautifying font for mobile phone systems, it has been transplanted into iOS, Android and other mobile phone systems, and is welcomed by many mobile phone enthusiasts. However, such a complete font has some shortcomings. First, there is a certain difference between the original font and the supplementary font, causing some different characters (such as Klee original Chinese characters and supplementary simplified characters) to have a certain sense of violation after mixing . Second, since the font used for the supplement is a commercial copyright font, it cannot be used for commercial purposes after completion, and there is a risk of infringement. In addition, in the current open source Chinese font library, there are very few scripts in Kai, and almost none in imitation Song.

In view of this, and in order to enrich the italic type in open source Chinese fonts, from January 20, 2021, I began to try to complete the simplified and traditional characters for Klee One, a high-quality Japanese open source font. Because the font has a certain “literary atmosphere”, it was named “Xiawu Wenkai” (In fact, I thought this font was suitable for text reading and named it “Wenkai”, and later found that this font It may not be very suitable for large text typesetting, but it is more suitable for medium-length text typesetting such as poetry, or annotation typesetting). Since the Regular weight of the Klee One font is too thin and not suitable for reading, the original font SemiBold weight is selected as the Regular weight. After a long period of accumulation, it has developed into a 3-character font family (although it is a bit clumsy and rough) that is supported by both Simplified, Traditional, Japanese, and Korean.

For more information on the word completion process, see the article on my GitHub.io blog: Trial Simplified Words for Klee.

Font preview

Please check the release page for the release history. Please understand that the text version update record HISTORY.MD is no longer maintained.

Main Chinese character part

Please refer to the text addition plan of “Xia Dong Wen Kai Portable Edition”.

Other sections

  • Completion of 20,992 Chinese characters (simplified and traditional) in the basic area of CJK unified Chinese characters (Currently the full version has 6,857 glyphs generated by zi2zi deep learning, and the glyphs are rough.);
  • Completion of 2367 syllables in common Hangeul (Korean/Korean). (Badly done. Not included in Lite version.)

Click here to view the follow-up addition and adjustment plan.

Get font

ⅰ. Direct download

  1. Enter the Release interface to download the corresponding version of the TTF format file, or download it in the fonts/TTF folder of this repository.
  2. Download it in the fonts/TTF folder of the official Gitee mirror repository.
  3. Enter Maognaw.com, Zfont.cn, Free Fonts to download. After the GitHub project is updated, the webmaster will be contacted for an update, and the update will be later. Note: This font may also be listed on other websites that list free commercial fonts, but may not be the latest version.
  4. Yongshuo E-disk and Lanzuoyun (password: 8ppk) will be updated within 72 hours after the GitHub project is updated.
  5. If you use macOS and have installed Homebrew, you can enter the command in the terminal: brew tap homebrew/cask-fonts & amp; & amp; brew install font-lxgw-wenkai to install this font.
  6. If you use Windows and have installed Scoop, you can enter the command in the terminal: scoop bucket add nerd-fonts & amp; & amp; scoop install LXGWWenKai or scoop bucket add nerd-fonts & amp ; & amp; scoop install LXGWWenKaiMono to install this font. You can also check out Microsoft’s official tutorial: How to install or remove fonts in Windows.

ii. Generate from source code

Please run ./sources/build.bat or ./sources/build.sh. fontmake needs to be installed: pip3 install fontmake and fontTools: pip3 install fonttools.

Notes

  1. Up to now, the full version of the font contains all Chinese characters in the CJK basic area, as well as sporadic expansion of Chinese characters in the A~G area. If there is a need for word completion, please submit it in Issue #33, do not open a separate Issue for easy organization.
  2. I am not a professional designer, and I have not considered the aesthetics of the design, so it may look a little ugly. The added characters may be slightly inconsistent with the original version, and there will be burrs on the contour curve of some characters in the middle of the Bold weight, Light There will be flying spots on the outline of some characters in the font weight; in addition, due to the rush of time, there is no extra time for fine-tuning, and the splicing of parts of some characters will be very rigid. If you have font optimization suggestions, please submit them in Issue #14, do not open another Issue for easy organization. (The above two issues have been tagged with long term, and both have been pinned to the top of the Issues page.)
  3. If you need to use this font on your website, please refer to Issue #24.
  4. For matching Western fonts, I personally recommend Ysabeau series fonts. In addition, the merged font LXGW Bright of Ysabeau Office and Xiadun Wenkai Portable Edition is formed by merging the two fonts with the font merge completion tool, and provides four formats: TTF, OTF, WOFF, and WOFF2.
  5. More versions of this font (subject to change)
    1. Xia Ding Wen Kai screen reading version / LXGW WenKai Screen Since the regular weight of the original “Xia Ding Wen Kai” is displayed thinner on PC and Android screens, and the Bold weight needs to be called in bold mode, it is specially made in Bold font Re-based, the bold “Xia Duck Wenkai” is equivalent to the thickness of the Windows default English font Segoe UI Regular, and it is more comfortable to read on the screen of PC and Android mobile phones, without special switching to bold mode.
    2. Xiaqu Wenkai Lite Edition / LXGW WenKai Lite: Eliminate some less commonly used Chinese characters added in v1.100 version, which is convenient for developers to embed fonts into software. If the full version has font optimization or feature updates, the lite version will follow. The lite version does not contain Hangul.
    3. Xiaqu Wenkai GB / LXGW WenKai GB: On the basis of Wenkai, the font and stroke shape are further adjusted to meet the G source font specification. Contains 8105 Chinese characters in the “General Standard Chinese Character List”. There are also “Stitched Kai” merged with the same source font as “Coriander”, and the GB fusion version completed with the font of this project.
    4. Xiaqu Wenkai TC / LXGW WenKai TC: for traditional Chinese users and lovers of old fonts, based on the light version, using the old fonts, mainly using the hidden fonts of Klee One, and manually modifying some parts (most parts refer to a little character Square “inheritance font standardization document”, with the help of tools such as “Dr. In addition, there is a traditional Chinese font based on Klee One, Coriander / Iansui, which adopts the education standard glyphs in Taiwan; there is also a Chinese font, JyunsaiKaai, which adopts the glyphs standard in Hong Kong.
  6. This project is a font project. For issues related to mobile phone font replacement such as the Magisk font module, please move to the Issues of the module template to give feedback, and do not open an issue in this project.

Authorization information

This font is a Klee open source project developed and released by FONTWORKS modified based on SIL Open Font License 1.1. Klee is a trademark of FONTWORKS.

Maognaw.com provides an unofficial Simplified Chinese translation of SIL Open Font License 1.1 for easy understanding and for reference only.

Permission

  • This font is free for commercial use by individuals or businesses, without paying, and without notifying or indicating the original author. (But I’d appreciate it if you let me know.)
  • This font can be freely disseminated, shared, or installed in the system, software or APP is also allowed, and can be bundled with any software for redistribution and/or sold together.
  • This font can be freely modified, transformed, and derivative fonts made. Modified or transformed fonts must also be disclosed as SIL OFL.

Restrictions

  • When creating a derived font, the font name cannot use the “reserved name” of the original font. This font retains the name “Xiawu” and “LXGW”. Based on the secondary derived fonts of this font, the words “Xiawu” or “LXGW” cannot appear in the name; and it is recompiled without modifying the source code of the font fonts, you can continue to use the reserved names of this font “Xiawu” and “LXGW”.
  • According to Article 1 of SIL Open Font License 1.1 License and Conditions, separate sale of font files (OTF/TTF files) is prohibited.
  • This font may not be distributed under licenses other than SIL Open Font License 1.1.

The above is an excerpt from the official introduction document of some fonts

Website font beautification usage based on Mkdocs

  1. Add the following to mkdocs.yml
extra_css:
  - https://cdn.jsdelivr.net/npm/[email protected]/style.css
  # - https://cdn.jsdelivr.net/npm/[email protected]/style.css
  # - https://cdn.jsdelivr.net/npm/[email protected]/style.css
  # - https://cdn.jsdelivr.net/npm/[email protected]/style.css

Then add the following in extra.css

body {<!-- -->
      font-family: "LXGW WenKai", sans-serif;
      /* Lite version */
      /* font-family: "LXGW WenKai Lite", sans-serif; */
      /* TC version */
      /* font-family: "LXGW WenKai TC", sans-serif; */
      /* Screen version */
      /* font-family: "LXGW WenKai Screen", sans-serif; */
    }

Choose one of four, mkdocs.yml and extra.css correspond to each other
extra.css

mkdocs.yml

If you don’t understand the usage of extra_css, you can take a look at the extra_css part of the tutorial I wrote