mirror of
https://github.com/2234839/web-font.git
synced 2026-12-04 00:40:56 +08:00
原 new Uint8Array(buf.subarray(0,size)) 会把已写入字节再拷贝到新 buffer, 而所有调用方(serializeScriptList/FeatureList、subsetGPOS/GSUB 主 writer、 pairSet writer)都是只读消费(writeBytes.set / 存数组后读),toUint8Array 后 writer 不再写入,故直接返回 subarray view(零拷贝共享 buf)完全等价。 24 产物(12 字体 × ttf/woff2)A/B 逐字节 IDENTICAL。 性能 best-of N=3000:霞鹜文楷 p10 -3.2%、初夏明朝 p10 -3.0%、思源OTF p10 -1.6%、 千字文持平(小子集 list/subtable 多、toUint8Array 调用频繁场景收益明显)。 基准测试全 SSIM 通过。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>