mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
7df35ac122
commit
489db301c5
15 files changed
+304
-75
No files matched your search
@@ -156,7 +156,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
|
||||
textRun = r.pageText.addRun(obj)
|
||||
}
|
||||
if ff == nil {
|
||||
if textRun != nil {
|
||||
if textRun != nil && !r.textContentOnly {
|
||||
box, _ := ParseBox(obj.Boundary)
|
||||
boundaryCTM := TranslationMatrix(box.X, box.Y)
|
||||
if parentCTM != nil {
|
||||
@@ -194,6 +194,10 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
|
||||
textRun.Boxes = make([]Box, len([]rune(text)))
|
||||
}
|
||||
}
|
||||
if r.textOnly && r.textContentOnly {
|
||||
ctx.Pop()
|
||||
return
|
||||
}
|
||||
glyphTransforms := r.textObjectGlyphTransforms(fontID, obj)
|
||||
hasUnderline := strings.Contains(obj.Decoration, "Underline")
|
||||
_, shadedFill := fillPaint.(canvas.Gradient)
|
||||
@@ -239,6 +243,13 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64
|
||||
positioned := textCodePositioned(tc, positioner.xs, positioner.ys)
|
||||
drawAsPath := embeddedFont || face.FauxBold > 0 || positioned || fillClip != nil || shadedFill || fillPattern != nil || shouldStroke
|
||||
for i, glyph := range glyphs {
|
||||
if i%64 == 0 && r.pageContext != nil {
|
||||
if err := r.pageContext.Err(); err != nil {
|
||||
r.renderError = err
|
||||
ctx.Pop()
|
||||
return
|
||||
}
|
||||
}
|
||||
str := glyph.Text
|
||||
drawAsGlyphPath := drawAsPath || glyph.GlyphID >= 0
|
||||
if !drawAsGlyphPath {
|
||||
|
||||
Reference in new issue
Block a user