feat(转换渲染): 保留PDF结构并优化渲染
build.yaml / build (push) Successful in 2m37s

This commit is contained in:
xiaoqidun committed 2026-10-18 18:08:52 +08:00
1 parent 627a06cda3
commit a2de650b52
31 files changed
+2166 -249

No files matched your search

-1
View File
@@ -29,7 +29,6 @@ func NormalizeOS2(data []byte) []byte {
var size int
switch binary.BigEndian.Uint16(data) {
case 0:
// 旧式68字节表保持原样,不将截断的78字节表推断为旧式表
size = 78
case 1:
size = 86
+17 -1
View File
@@ -17,6 +17,7 @@ package geom
import (
"fmt"
"math"
"slices"
)
// UnsupportedError 表示当前几何实现无法展开的描边形态
@@ -347,7 +348,22 @@ func (line geometryPolyline) stroke(result Path, options StrokeOptions) (Path, e
}
return result, nil
}
directions := make([]Point, len(points)-1)
segments := len(points) - 1
joins := segments - 1
caps := 0
if line.closed {
joins++
} else if options.Cap == "Round" {
caps = 8
} else if options.Cap == "Square" {
caps = 10
}
joinSize := 4
if options.Join == "" || options.Join == "Miter" {
joinSize = 5
}
result = slices.Grow(result, min(segments*5+joins*joinSize+caps, 1<<20-len(result)))
directions := make([]Point, segments)
for i := range directions {
a, b := points[i], points[i+1]
length := math.Hypot(b.X-a.X, b.Y-a.Y)