Skip to content

website: Keep box-drawing glyphs in the gallery font subsets - #3305

Open
ihavecoke wants to merge 1 commit into
mainfrom
ihavecoke/story-web-box-drawing-glyphs
Open

ihavecoke wants to merge 1 commit into
mainfrom
ihavecoke/story-web-box-drawing-glyphs

Conversation

@ihavecoke

@ihavecoke ihavecoke commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Description

The web gallery's welcome story renders README.md through include_str!, but crates/story-web/scripts/subset-fonts.py only collected characters from .rs sources. The README's ├── / └── crate tree lost its glyphs from the JetBrains Mono subset, and the EmojiAndCjk Canvas fallback does not cover box-drawing characters, so https://gpui-kit.com/gallery/ draws them as tofu. Desktop builds are unaffected: they use complete system monospace fonts with platform fallback.

  • subset-fonts.py now also reads every file a scanned source pulls in with include_str! (README, fixtures, theme JSON, examples/fixtures/test.md).
  • FontTools 4.66 keeps the input flavor when --flavor is not given, which wrote Inter-Regular.ttf as WOFF2. The script passes --flavor=none and pins fonttools[woff]==4.66.0 so reruns produce the same files.
  • Regenerated the four subsets. They were also behind the current story sources: Noto Sans SC gains 70+ Han characters the stories already use (such as 探索 and 继续编辑), and ▸ ▾ ○, no longer used anywhere, drop out.
  • Updated the Noto Sans SC subset size and the subset description in webassembly.md and fonts.md (en and zh-CN).
Font file Before (bytes) After (bytes)
Inter-Regular.ttf 88,036 94,432
JetBrainsMono-Regular.ttf 84,160 89,508
NotoSansSC-Regular-subset.ttf 25,484 42,092
IBMPlexSans-Regular.ttf 48,676 49,124

Before

before

After

after

How to Test

  • Run bun run --cwd crates/story-web/www fonts twice: the generated files are byte-identical, and all four start with the TrueType 00010000 header.
  • Run make dev in crates/story-web and open /gallery/. The Introduction page draws the crate tree with box-drawing lines; the live site shows tofu in the same place.

The script change, regenerated fonts and documentation edits in this PR were AI-generated.

Generated with Claude Code

The web gallery's welcome story renders README.md through include_str!,
but subset-fonts.py only collected characters from .rs sources. The
crate tree's box-drawing characters were cut from JetBrains Mono, and
the EmojiAndCjk Canvas fallback does not cover them, so they drew as
tofu. The script now also reads every file a scanned source pulls in
with include_str!.

FontTools 4.66 keeps the input flavor when --flavor is not given, which
turned Inter-Regular.ttf into WOFF2. Pass --flavor=none and pin the
version so reruns produce the same TTF files.

Regenerating also brings the subsets up to date with the current story
sources, adding CJK text the stories already use. The Noto Sans SC
subset grows from 25,484 to 42,092 bytes; the docs quoting its size
are updated.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant