崮生(子虚) f4af6f7b68 perf(glyf): subset simple 字形剥离 hinting instructions
subset 模式下 simple 字形走原始字节快路径([[glyf-origbytes-fastpath]]),完整保留
原始 hinting instructions。但 web 渲染场景浏览器用 autohint,原始 instructions 不参与
渲染——实测剥离后所有基准用例 SSIM 与 ink 逐位一致(含最敏感的小字号用例)。

read 快路径定位 instructionLength(紧接 endPtsOfContours,OpenType 规范布局,无需展开
flags),存 _instrOff/_instrLen。write 快路径跳过 instructions 段并写 instructionLength=0,
sizeof 同步扣减字节长度。_instrOff=-1(无 instructions)走原整段拷贝路径。

收益(SSIM 全不变):
- FiraCode woff2 10776→8892(-17.5%),端到端 avg 1.92→1.68ms(-12.5%)
- 千字文 woff2 79784→79736,ttf 体积同步减小
- CJK 字体(初夏/霞鹜/思源)instructions 极少,体积持平

brotli 是 write 阶段硬下限,减小 glyf 原始字节直接减小 brotli 输入与输出。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 21:11:36 +08:00
..
2026-04-11 17:53:57 +08:00
2026-04-11 17:53:57 +08:00