mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
5e0da3da28
commit
ee6c9f6a16
82 files changed
+4316
-4310
No files matched your search
@@ -27,21 +27,6 @@ type pdfRenderer struct {
|
||||
glyphPaths map[*canvas.Path]*canvas.Path
|
||||
}
|
||||
|
||||
// glyphPath 复用相似变换下的PDF字形圆弧转换
|
||||
// 入参: path 缓存字形路径, matrix 字形变换
|
||||
// 返回: *canvas.Path PDF字形路径
|
||||
func (r *pdfRenderer) glyphPath(path *canvas.Path, matrix canvas.Matrix) *canvas.Path {
|
||||
if !matrix.IsSimilarity() {
|
||||
return path
|
||||
}
|
||||
if cached, ok := r.glyphPaths[path]; ok {
|
||||
return cached
|
||||
}
|
||||
converted := path.ReplaceArcs()
|
||||
r.glyphPaths[path] = converted
|
||||
return converted
|
||||
}
|
||||
|
||||
// pdfNavigation PDF导航信息
|
||||
type pdfNavigation struct {
|
||||
Anchor map[int][]pdfAnchor
|
||||
@@ -69,6 +54,21 @@ type pdfOutline struct {
|
||||
Y float64
|
||||
}
|
||||
|
||||
// glyphPath 复用相似变换下的PDF字形圆弧转换
|
||||
// 入参: path 缓存字形路径, matrix 字形变换
|
||||
// 返回: *canvas.Path PDF字形路径
|
||||
func (r *pdfRenderer) glyphPath(path *canvas.Path, matrix canvas.Matrix) *canvas.Path {
|
||||
if !matrix.IsSimilarity() {
|
||||
return path
|
||||
}
|
||||
if cached, ok := r.glyphPaths[path]; ok {
|
||||
return cached
|
||||
}
|
||||
converted := path.ReplaceArcs()
|
||||
r.glyphPaths[path] = converted
|
||||
return converted
|
||||
}
|
||||
|
||||
// newPDFNavigation 创建PDF导航信息
|
||||
// 入参: renderer 渲染器, doc 文档结构, pages 页面数据
|
||||
// 返回: *pdfNavigation PDF导航信息, error 几何错误
|
||||
|
||||
Reference in new issue
Block a user