mirror of
https://github.com/2234839/web-font.git
synced 2026-09-14 21:05:49 +08:00
套用 gsub 侧已验证的 Int32Array gidLookup 模式到 GPOS: - subsetGPOS 入口构建 gidLookup(动态容量 maxOrigGid+1,fill -1) - remapGid 的 Map.get(7处)+ subtableCoverageHits 的 Map.has 改数组索引 - 涉及函数签名全部 origToNew:Map → gidLookup:GidLookup A/B 11 字体字节全 IDENTICAL;基准测试 SSIM 全通过。 性能 best-of N=2000: - 思源千字文中段 min -2.6% - 思源标点 min -2.5% - 千字文96 min -1.2% - FiraCode 持平(GSUB 已用 gidLookup,GPOS 增量小) 关键:gidLookup[越界] 返回 undefined(非 -1),GPOS coverage 常引用 大于子集 maxGid 的 gid,remapGid 须 origGid < length 保护(否则 undefined < 0 = false 误判有效,同 gsub type234 undefined bug)。 容量必须动态,65536 固定容量 fill 在小 GPOS 用例倒贴(篆体 +12.5%)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>