# Font sources

The files in this directory are generated by `npm run fonts:update`.

- [LXGW Neo XiHei v1.305](https://github.com/lxgw/LxgwNeoXiHei/releases/tag/v1.305):
  Regular subset for the site and Markdown prose, renamed to **Weixi Sans**.
  Copyright 2021–2026 LXGW; Information-technology Promotion Agency, Japan
  (IPA), 2003–2019. Distributed under
  [IPA Font License 1.0](licenses/IPA-Font-License-1.0.md).
- LXGW WenKai Mono GB v1.522: Regular subset for CJK text inside code blocks.
- JetBrains Mono v2.304: official webfonts for Latin text and code.

The Chinese subsets contain the unique characters currently used by text-bearing
files under `src`. Run the update command after adding new site or Markdown content.

New XiHei has one regular weight. Bold headings and emphasis use browser-synthesized
bold; the regular file is not declared as a variable or multi-weight font.

## Sources and rebuilding

- [Original New XiHei font](https://github.com/lxgw/LxgwNeoXiHei/releases/download/v1.305/LXGWNeoXiHei.ttf)
  (SHA-256: `893cfbec604768f03785ab4f369508de68c274273359a5cadee17e2852975d5c`).
- [Upstream font project files](https://github.com/lxgw/LxgwNeoXiHei/tree/v1.305/projects).
- [Site font generation script](https://github.com/Weixi779/Weixi779.github.io/blob/main/scripts/update-fonts.mjs).
- [Site sources and character input](https://github.com/Weixi779/Weixi779.github.io/tree/main/src).
- [Generated Weixi Sans subset](weixi-sans-subset.woff2), also under IPA Font License 1.0.

In a checkout of the site repository, run `npm ci` and `npm run fonts:update`.
The generator checks the source font hash, changes the subset's family name,
preserves copyright and license metadata, and writes WOFF2 assets.

## Restoring the original IPA font

Download and install **IPAexGothic** from the
[official IPA download page](https://moji.or.jp/ipafont/ipafontdownload/), then
reopen the site. Its CSS checks `local('IPAexGothic')` and `local('IPAexゴシック')`
before downloading the derived font, so browsers with local-font access use the
original font automatically. Browsers with custom-font controls can also select
IPAexGothic and disable website font choices. Uninstall the local font and restore
website font settings to return to New XiHei. IPAexGothic uses Japanese glyph forms.

See the site's [font information page](/fonts/) and the upstream author's
[embedding instructions](https://github.com/lxgw/lxgw/blob/main/documents/xizhi_embedding_instructions.md).

The Markdown presentation is adapted from the Drake Typora Theme. License texts
for the fonts and the source theme are kept in the `licenses` directory.
