mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-08-30 12:12:40 +08:00
feat(强化兼容): 改进字体渲染
This commit is contained in:
+16
-10
@@ -25,16 +25,17 @@ import (
|
||||
|
||||
// Reader OFD文件阅读器
|
||||
type Reader struct {
|
||||
Path string
|
||||
Zip *zip.Reader
|
||||
Closer io.Closer
|
||||
OFD *OFD
|
||||
RootDir string
|
||||
ResMap map[string]string
|
||||
fontCache map[string]*Font
|
||||
drawParamCache map[string]*DrawParam
|
||||
doc *Document
|
||||
Stamps map[string][]Stamp
|
||||
Path string
|
||||
Zip *zip.Reader
|
||||
Closer io.Closer
|
||||
OFD *OFD
|
||||
RootDir string
|
||||
ResMap map[string]string
|
||||
fontCache map[string]*Font
|
||||
drawParamCache map[string]*DrawParam
|
||||
compositeGraphicUnitCache map[string]*CompositeGraphicUnit
|
||||
doc *Document
|
||||
Stamps map[string][]Stamp
|
||||
}
|
||||
|
||||
// Close 关闭阅读器
|
||||
@@ -61,6 +62,7 @@ func (r *Reader) initRoot() error {
|
||||
r.ResMap = make(map[string]string)
|
||||
r.fontCache = make(map[string]*Font)
|
||||
r.drawParamCache = make(map[string]*DrawParam)
|
||||
r.compositeGraphicUnitCache = make(map[string]*CompositeGraphicUnit)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -185,6 +187,10 @@ func (r *Reader) loadRes(resPath string) {
|
||||
dp := &res.DrawParams.DrawParam[i]
|
||||
r.drawParamCache[dp.ID] = dp
|
||||
}
|
||||
for i := range res.CompositeGraphicUnits.CompositeGraphicUnit {
|
||||
cgu := &res.CompositeGraphicUnits.CompositeGraphicUnit[i]
|
||||
r.compositeGraphicUnitCache[cgu.ID] = cgu
|
||||
}
|
||||
}
|
||||
|
||||
// PageContent 获取页面内容
|
||||
|
||||
Reference in New Issue
Block a user