# @hanzi.pro/webfonts-shanggu-sans

**Shanggu Sans** — 傳承字形 (heritage-glyph) Traditional-Chinese webfont, sliced into `unicode-range` woff2 subsets from [GuiWonder/Shanggu](https://github.com/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:

```html
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/webfonts-shanggu-sans@0.1.0/swap.css" />
```

Then use the family in CSS:

```css
body { font-family: "Shanggu Sans", sans-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:

```html
<!-- headlines / logotypes: never flash the wrong fallback glyph -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@hanzi.pro/webfonts-shanggu-sans@0.1.0/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/webfonts-shanggu-sans@0.1.0/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.
