summaryrefslogtreecommitdiff
path: root/def.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-07-04 13:18:12 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-07-04 13:18:12 -0400
commit1d655638f9c01bdf29aaee195a6628e79f963cfb (patch)
tree18d446216908d4bbddde478010c9052c6ad870ee /def.go
parent5ab948816dec877984e3c1c031f423cb7fccf30f (diff)
parentf0690e7eabd6a1dc812923ce417ebdb7da490f14 (diff)
Claudio Felber's dashed line implementation
Diffstat (limited to 'def.go')
-rw-r--r--def.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/def.go b/def.go
index 47b399f..33eca47 100644
--- a/def.go
+++ b/def.go
@@ -18,6 +18,7 @@ package gofpdf
import (
"bytes"
+ "io"
)
// Version of FPDF from which this package is derived
@@ -132,6 +133,15 @@ type InitType struct {
FontDirStr string
}
+// FontLoader is used to read fonts (JSON font specification and zlib compressed font binaries)
+// from arbitrary locations (e.g. files, zip files, embedded font resources).
+//
+// Open provides an io.Reader for the specified font file (.json or .z). The file name
+// does never include a path. Open returns an error if the specified file cannot be opened.
+type FontLoader interface {
+ Open(name string) (io.Reader, error)
+}
+
// Fpdf is the principal structure for creating a single PDF document
type Fpdf struct {
page int // current page number
@@ -160,6 +170,7 @@ type Fpdf struct {
lasth float64 // height of last printed cell
lineWidth float64 // line width in user unit
fontpath string // path containing fonts
+ fontLoader FontLoader // used to load font files from arbitrary locations
coreFonts map[string]bool // array of core font names
fonts map[string]fontDefType // array of used fonts
fontFiles map[string]fontFileType // array of font files
@@ -195,6 +206,8 @@ type Fpdf struct {
fontDirStr string // location of font definition files
capStyle int // line cap style: butt 0, round 1, square 2
joinStyle int // line segment join style: miter 0, round 1, bevel 2
+ dashArray []float64 // dash array
+ dashPhase float64 // dash phase
blendList []blendModeType // slice[idx] of alpha transparency modes, 1-based
blendMap map[string]int // map into blendList
gradientList []gradientType // slice[idx] of gradient records