feat(渲染编辑): 完善渲染编辑,优化版本压缩
build.yaml / build (push) Successful in 4m25s

This commit is contained in:
xiaoqidun committed 2026-10-12 10:47:20 +08:00
1 parent 19dc79e8e3
commit a710bc5f41
68 files changed
+2149 -724

No files matched your search

+9 -2
View File
@@ -311,7 +311,10 @@ func (p *pdfImporter) text(mark pdfgo.TextMark) error {
if (paintMode == 0 || paintMode == 2) && mark.Style.FillOverprint && pdfOverprintNeedsSeparation(mark.Style.Fill) || (paintMode == 1 || paintMode == 2) && mark.Style.StrokeOverprint && pdfOverprintNeedsSeparation(mark.Style.Stroke) {
return &pdfgo.UnsupportedError{Feature: "text color separation overprint"}
}
if p.warning != nil && ((paintMode == 0 || paintMode == 2) && pdfGradientError(mark.Style.Fill) != nil || (paintMode == 1 || paintMode == 2) && pdfGradientError(mark.Style.Stroke) != nil) {
if p.warning != nil && ((paintMode == 0 || paintMode == 2) && p.gradientError(mark.Style.Fill) != nil || (paintMode == 1 || paintMode == 2) && p.gradientError(mark.Style.Stroke) != nil) {
if err := p.ctx.Err(); err != nil {
return err
}
gradient := mark
return p.compositeRegion(nil, pdfCompositeNode{text: &gradient}, &pdfgo.ColorSpace{Model: "DeviceRGB"}, false)
}
@@ -544,10 +547,14 @@ func (p *pdfImporter) text(mark pdfgo.TextMark) error {
box = Box{box.X - margin, box.Y - margin, box.W + 2*margin, box.H + 2*margin}
object.LineWidth = lineWidth / scale
object.LineWidthSet = object.LineWidth == 0
object.Cap = []string{"Butt", "Round", "Square"}[mark.Style.Cap]
object.Join = []string{"Miter", "Round", "Bevel"}[mark.Style.Join]
object.MiterLimit = mark.Style.MiterLimit
if len(mark.Style.Dash) > 0 {
return &pdfgo.UnsupportedError{Feature: "dashed text stroke"}
strokeScale := math.Hypot(p.matrix[0], p.matrix[1]) * sx / scale
object.DashPattern = pdfDashPattern(mark.Style.Dash, strokeScale)
phase := mark.Style.DashPhase * strokeScale
object.DashOffset = &phase
}
}
object.Boundary = pdfBoundary(box)