feat(发票字体): 修复部分发票上的字体颜色被错误渲染成了黑色的问题

This commit is contained in:
2025-12-30 14:40:01 +08:00
parent 79279c85ec
commit 44a87ac894
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -58,6 +58,9 @@ func (r *Reader) initRoot() error {
return fmt.Errorf("failed to unmarshal ofd.xml: %w", err)
}
r.OFD = &ofd
r.ResMap = make(map[string]string)
r.fontCache = make(map[string]*Font)
r.drawParamCache = make(map[string]*DrawParam)
return nil
}
@@ -122,9 +125,6 @@ func (r *Reader) Doc() (*Document, error) {
return nil, fmt.Errorf("failed to unmarshal document.xml: %w", err)
}
r.OFD.DocBody[0].DocInfo.DocID = "loaded"
r.ResMap = make(map[string]string)
r.fontCache = make(map[string]*Font)
r.drawParamCache = make(map[string]*DrawParam)
if doc.CommonData.DocumentRes != "" {
r.loadRes(doc.CommonData.DocumentRes)
}
+1 -1
View File
@@ -406,7 +406,7 @@ func (r *Renderer) renderPath(ctx *canvas.Context, obj PathObject, pageH float64
}
ctx.SetStrokeColor(strokeColor)
ctx.SetStrokeWidth(lineWidth)
ctx.DrawPath(0, 0, p.Stroke(lineWidth, canvas.RoundCap, canvas.RoundJoin, canvas.Tolerance))
ctx.DrawPath(0, 0, p)
ctx.Pop()
}