@hanzi.pro/webfonts-iansui
v0.1.0
Published
Iansui — 國字標準字體 webfont subset of ButTaiwan/iansui (v1.020), sliced by ziano.
Downloads
103
Maintainers
Readme
@hanzi.pro/webfonts-iansui
Iansui — 國字標準字體 (MOE-standard) Traditional-Chinese webfont, sliced into unicode-range woff2 subsets from ButTaiwan/iansui v1.020.
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: "Iansui", 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 |
Single weight
swap.css (and block.css / optional.css) declares every weight; the browser still only downloads the slices and weights your page uses. But if you want a smaller stylesheet, each mode also ships one file per weight under a matching subfolder — swap/<weight>.css, block/<weight>.css, optional/<weight>.css:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/[email protected]/swap/400.css" />Available weights: 400
License
SIL Open Font License 1.1 — see LICENSE. Font copyright remains with the upstream authors of ButTaiwan/iansui.
