mirror of
https://github.com/2234839/web-font.git
synced 2026-09-04 23:02:27 +08:00
hasGLyphsOver2Bytes 原赋值 len>0(任何非空子集都 true),与变量名语义(>0xFFFF 字符才需 format12)相悖。BMP 字体的 format12 与 format4 内容完全相同(均覆盖 BMP),纯冗余。 改用真实 hasOver2Bytes 判定(getSegmentsFlat 产出段检查 >0xFFFF)。 fonteditor 原始逻辑本就如此(41c2741 some(glyph.unicode>0xFFFF)),后续性能优化误改。 体积收益(woff2):千字文 -396B、思源千字文中段 -480B、思源8字 -52B、标点 -56B、 FiraCode -32B、令东8字 -64B。29 基准用例 SSIM 全通过且与历史固有值完全一致 (浏览器用 format4 渲染 BMP 足够,format12 仅 >0xFFFF 必需)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>