mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
Two user-visible features plus a font swap.
### URL parameters
Forwards ?text= and ?font= from the query string into the C main
as --text=... and --font=... via Module.arguments, so the initial
text is applied before the first rendered frame (no flash of
default demo text). ?font= is still fetched asynchronously on
the JS side; once loaded, the text is re-applied to the new font.
If neither parameter is present, behaviour is unchanged: the
baked-in default text renders in the baked-in default font.
Data URLs (?font=data:font/ttf;base64,...) work naturally via
fetch(). Remote URLs need CORS; raw.githubusercontent.com and
jsdelivr both work, github.com/.../raw/... does not.
### Wider default font
The baked-in default-font.hh was a narrow subset that didn't
include uppercase Latin, so `?text=Hello` shaped to .notdef for
H and W. Re-subset Parastoo-Regular.ttf via hb-subset with:
--unicodes='U+0020-007E,U+0600-06FF,U+FB50-FDFF,U+FE70-FEFF'
covering printable ASCII plus the Arabic block and the two
Arabic presentation-forms blocks.
Font size:
source Parastoo-Regular.ttf 109152
new subset 49940
Wasm size impact (webgl build, Oz+lto):
before 443628 181597 gz
after 466657 196209 gz
delta +23029 +14612 gz
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>