@hanzi.pro/webfonts-shanggu-serif
v0.1.0
Published
Shanggu Serif — 傳承字形 webfont subset of GuiWonder/Shanggu (1.028), sliced by ziano.
Maintainers
Readme
@hanzi.pro/webfonts-shanggu-serif
Shanggu Serif — 傳承字形 (heritage-glyph) Traditional-Chinese webfont, sliced into unicode-range woff2 subsets from GuiWonder/Shanggu 1.028.
Usage
Drop these in your <head> — preconnect warms the CDN connection so the stylesheet (and the woff2 slices it pulls) arrive sooner:
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/[email protected]/swap.css" />Then use the family in CSS:
body { font-family: "Shanggu Serif", serif; }The browser downloads only the slices your page actually uses; codepoints outside the subset fall through to the next font in your stack.
font-display
swap.css is the default (font-display: swap — show text immediately, swap the glyph in when it arrives). Two alternates ship alongside it; just point the stylesheet at a different file:
<!-- headlines / logotypes: never flash the wrong fallback glyph -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/[email protected]/block.css" />
<!-- Core-Web-Vitals pages: zero layout shift (may skip the first visit) -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/[email protected]/optional.css" />| file | font-display | use when |
| --- | --- | --- |
| swap.css | swap | body / content — show text now, swap glyph in (FOUT) |
| block.css | block | headlines / logotypes — brief invisible text, never the wrong glyph |
| optional.css | optional | perf-critical — no layout shift; slice may sit out the first visit |
License
SIL Open Font License 1.1 — see LICENSE. Font copyright remains with the upstream authors of GuiWonder/Shanggu.
