mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-08-30 12:12:40 +08:00
feat(发票字体): 修复部分发票上的字体颜色被错误渲染成了黑色的问题
This commit is contained in:
+3
-3
@@ -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
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user