feat(提升性能): 减少无效粗体检查,提升文字渲染性能

This commit is contained in:
xiaoqidun committed 2026-09-12 12:59:46 +08:00
1 parent 565b7f6db4
commit 0fd4954547
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -139,7 +139,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
embeddedFont := false
if of, ok := r.Reader.fontCache[fontID]; ok {
embeddedFont = of.FontFile != ""
if !embeddedFont && fontNoSyntheticBold(of.FontName, of.FamilyName) {
if syntheticBold && !embeddedFont && fontNoSyntheticBold(of.FontName, of.FamilyName) {
syntheticBold = false
}
if of.Bold {