feat(加强兼容): 强化图形和字体绘制

This commit is contained in:
2026-07-01 14:25:52 +08:00
parent 547a938359
commit b85dd88ce2
3 changed files with 53 additions and 35 deletions
+10
View File
@@ -54,6 +54,16 @@ func fixTrueType(data []byte, fixCmap, fixName bool) (bool, []byte, map[rune]uin
isCFFSfnt = true
}
missingHead := existingTables["head"] == nil
if !missingHead {
head := existingTables["head"]
if len(head) > 54 {
existingTables["head"] = head[:54]
malformedDirectory = true
}
if len(existingTables["head"]) != 54 || binary.BigEndian.Uint16(existingTables["head"][18:20]) == 0 {
missingHead = true
}
}
missingMaxp := existingTables["maxp"] == nil
missingHhea := existingTables["hhea"] == nil
missingHmtx := existingTables["hmtx"] == nil