summaryrefslogtreecommitdiff
path: root/fpdf.go
diff options
context:
space:
mode:
authorStani <spe.stani.be@gmail.com>2015-07-12 14:34:34 +0200
committerStani <spe.stani.be@gmail.com>2015-07-12 14:34:34 +0200
commit4aa4a931b57c01e39ef920dce28cf8210e2c4cb0 (patch)
tree35ba61779531095010eefb438a4c6f4f33fdfee0 /fpdf.go
parent1451e353048cd88e1083c1be60cceaddc0d9b84d (diff)
added Fpdf.GetFontDesc method and documentation for FontDescType
Diffstat (limited to 'fpdf.go')
-rw-r--r--fpdf.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/fpdf.go b/fpdf.go
index 1fe9b1b..6eae426 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -1429,6 +1429,15 @@ func (f *Fpdf) AddFontFromReader(familyStr, styleStr string, r io.Reader) {
return
}
+// GetFontDesc returns the font descriptor, which can be used for
+// example to find the baseline of a font. See FontDescType for
+// documentation about the font descriptor.
+// See AddFont for details about familyStr and styleStr.
+func (f *Fpdf) GetFontDesc(familyStr, styleStr string) FontDescType {
+ fontkey := familyStr + styleStr // see AddFontFromReader
+ return f.fonts[fontkey].Desc
+}
+
// SetFont sets the font used to print character strings. It is mandatory to
// call this method at least once before printing text or the resulting
// document will not be valid.