feat(字体解耦): 解耦字体依赖,完善字体处理
build.yaml / build (push) Successful in 47s

This commit is contained in:
xiaoqidun committed 2026-10-11 00:52:01 +08:00
1 parent 051fc3b65e
commit cf8dfd046b
21 files changed
+1071 -237

No files matched your search

+2 -2
View File
@@ -18,7 +18,6 @@ import (
"strings"
"github.com/tdewolff/canvas"
"github.com/tdewolff/font"
)
// ptPerMM 为毫米转换为排版点的比例
@@ -183,7 +182,8 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
ctx.Pop()
return
}
face := ff.Face(sizePt, fillPaint, fontStyle, canvas.FontNormal, font.NoHinting)
face := ff.Face(sizePt, fillPaint, fontStyle, canvas.FontNormal)
face.Hinting = 0
recoverBaseline := len(obj.TextCode) > 0 && obj.TextCode[0].Y == ""
var metrics canvas.FontMetrics
if textRun != nil || recoverBaseline {