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

+6 -1
View File
@@ -103,7 +103,12 @@ func (r *Renderer) cachedTextGlyphPath(face *canvas.FontFace, glyph textGlyph) (
}
outlines := r.canvasState().fontOutlines[face.Font]
if outlines == nil {
outlines = &sfntOutliner{font: face.Font.SFNT}
metrics, err := parseSFNTFont(fontSFNTData(face.Font.Tables))
if err != nil {
r.renderError = err
return &canvas.Path{}, 0
}
outlines = &sfntOutliner{font: metrics}
r.canvasState().fontOutlines[face.Font] = outlines
}
path, width, err := textGlyphPath(face, glyph, outlines)