[Parity][hud][S3][F] 字体加载和解析的静默兜底,tbl 字段读错 #650

Closed
opened 2026-10-02 11:42:51 +00:00 by troytt · 0 comments
Owner

1.13c 客户端保真度审计立项(基准快照:7bd1090 / main @ 77a20c7)

证据标记说明:V-data = 1.13c MPQ 数据表 (.txt / animdata.d2 / .tbl / pal.pl2);V-src = D2MOO 逆向源码;V-bin = 1.13c DLL 反汇编;K = 1.13c 公认行为。

来源审计项:hud#17 — [S3][F] 17. 字体加载和解析的静默兜底,tbl 字段读错

  • 位置:src/client/ui/font.ts:205-229(metrics.json 返回非 200 就直接 return;图片 onerror 也 resolve;catch 后 loaded = false)、:484-499(没有位图字形时整段改用浏览器字体)、:98-107(tblBytes[10] || 14、tblBytes[11] || 16、宽 || 6、高 || lineHeight)、:142-163(FONT_PX_SIZE / FONT_BASELINE_OFFSET 是手调数字)、:171-176(颜色解析失败时回退成白色)
  • 原版:D2FontStrc 偏移 0x0A 是 nHeight,0x0B 是 nWidth;D2CharStrc 偏移 0x03 是 nWidth,0x04 是 nHeight,0x08 是 WORD 类型的 nImageIndex(V-src D2Win/include/D2WinFont.h:14-34)。行距 = 行距常量(Latin 16)× nHeight / 10(V-src D2WinFont.cpp:796、:638)。
  • 影响:资源缺失时自动退回浏览器字体继续运行,属于 AGENTS.md §3 禁止的静默容错;字节 0x0B 实际是 nWidth,却被当作 capHeight;|| 默认值会掩盖损坏的数据;基线和字号常量来源不明(?)。
  • 建议:资源缺失时直接报错;按 D2FontStrc 解析字段;行距和基线按 D2WinFont 的常量和 nHeight/10 规则计算。
  • 已有 issue:—
> **1.13c 客户端保真度审计立项**(基准快照:`7bd1090` / `main @ 77a20c7`) > 证据标记说明:`V-data` = 1.13c MPQ 数据表 (`.txt` / `animdata.d2` / `.tbl` / `pal.pl2`);`V-src` = D2MOO 逆向源码;`V-bin` = 1.13c DLL 反汇编;`K` = 1.13c 公认行为。 ### 来源审计项:`hud#17` — [S3][F] 17. 字体加载和解析的静默兜底,tbl 字段读错 - 位置:`src/client/ui/font.ts:205-229`(metrics.json 返回非 200 就直接 return;图片 `onerror` 也 resolve;catch 后 `loaded = false`)、`:484-499`(没有位图字形时整段改用浏览器字体)、`:98-107`(`tblBytes[10] || 14`、`tblBytes[11] || 16`、宽 `|| 6`、高 `|| lineHeight`)、`:142-163`(`FONT_PX_SIZE` / `FONT_BASELINE_OFFSET` 是手调数字)、`:171-176`(颜色解析失败时回退成白色) - 原版:`D2FontStrc` 偏移 0x0A 是 `nHeight`,0x0B 是 `nWidth`;`D2CharStrc` 偏移 0x03 是 `nWidth`,0x04 是 `nHeight`,0x08 是 WORD 类型的 `nImageIndex`(V-src `D2Win/include/D2WinFont.h:14-34`)。行距 = 行距常量(Latin 16)× nHeight / 10(V-src `D2WinFont.cpp:796`、`:638`)。 - 影响:资源缺失时自动退回浏览器字体继续运行,属于 AGENTS.md §3 禁止的静默容错;字节 0x0B 实际是 `nWidth`,却被当作 capHeight;`||` 默认值会掩盖损坏的数据;基线和字号常量来源不明(?)。 - 建议:资源缺失时直接报错;按 `D2FontStrc` 解析字段;行距和基线按 D2WinFont 的常量和 nHeight/10 规则计算。 - 已有 issue:—
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#650
No description provided.