summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-10-29 18:16:14 +0000
committerNick White <git@njw.name>2019-10-29 18:16:14 +0000
commitc13bfe75e82a71ac7436df1cad5b10b678d5bc95 (patch)
tree4bcea220346ce6fab8983b5d0b18505d51bfa8fd
parentdcb91f0393c02a2124d867674ed25ef11d83087c (diff)
Fix SetTextRenderingMode to follow spec correctly, and add missing modes to constaddtextrenderingmode
-rw-r--r--def.go8
-rw-r--r--fpdf.go2
2 files changed, 7 insertions, 3 deletions
diff --git a/def.go b/def.go
index 9a9758c..8b90244 100644
--- a/def.go
+++ b/def.go
@@ -123,14 +123,18 @@ const (
TextRenderingModeFill = 0
// TextRenderingModeStroke strokes text
TextRenderingModeStroke = 1
- // TextRenderingModeFillThenStroke fills then strokes text
- TextRenderingModeFillThenStroke = 2
+ // TextRenderingModeFillStroke fills then strokes text
+ TextRenderingModeFillStroke = 2
// TextRenderingModeInvisible neither fills nor strokes text
TextRenderingModeInvisible = 3
// TextRenderingFillClip fills text and add to path for clipping
TextRenderingModeFillClip = 4
// TextRenderingFillClip strokes text and add to path for clipping
TextRenderingModeStrokeClip = 5
+ // TextRenderingModeFillStrokeClip fills then strokes text and add to path for clipping
+ TextRenderingModeFillStrokeClip = 6
+ // TextRenderingModeClip Adds text to path for clipping
+ TextRenderingModeClip = 7
)
type colorMode int
diff --git a/fpdf.go b/fpdf.go
index 290fffb..80e621d 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -2229,7 +2229,7 @@ func (f *Fpdf) SetWordSpacing(space float64) {
// SetTextRenderingMode sets the rendering mode of following text.
// See the TextRenderingMode* const definitions for modes.
func (f *Fpdf) SetTextRenderingMode(mode int) {
- f.out(sprintf("%d Tmode", 0))
+ f.out(sprintf("%d Tr", mode))
}
// SetAcceptPageBreakFunc allows the application to control where page breaks