feat(字体处理): 修复字体编辑,优化字体裁剪
build.yaml / build (push) Successful in 46s

This commit is contained in:
xiaoqidun committed 2026-10-11 01:22:46 +08:00
1 parent 78379bfa6e
commit 62c81e7061
5 files changed
+274 -6

No files matched your search

+8 -1
View File
@@ -725,7 +725,7 @@ func parseCFFReal(data []byte) (string, int) {
return sb.String(), i
}
// encodeCFFDict 编码CFF字典 (仅使用float64操作数)
// encodeCFFDict 编码CFF字典,将字体类型标识置于首项
// 入参: dict CFF字典映射
// 返回: []byte 编码后的字典数据
func encodeCFFDict(dict cffDict) []byte {
@@ -735,6 +735,13 @@ func encodeCFFDict(dict cffDict) []byte {
keys = append(keys, k)
}
sort.Ints(keys)
for index, op := range keys {
if op == 1220 || op == 1230 {
copy(keys[1:index+1], keys[:index])
keys[0] = op
break
}
}
for _, op := range keys {
vals := dict[op]
if len(vals) == 0 && (op >= 6 && op <= 9 || op == 1212 || op == 1213) {