diff options
author | Stani <spe.stani.be@gmail.com> | 2015-07-12 14:34:34 +0200 |
---|---|---|
committer | Stani <spe.stani.be@gmail.com> | 2015-07-12 14:34:34 +0200 |
commit | 4aa4a931b57c01e39ef920dce28cf8210e2c4cb0 (patch) | |
tree | 35ba61779531095010eefb438a4c6f4f33fdfee0 /fpdf.go | |
parent | 1451e353048cd88e1083c1be60cceaddc0d9b84d (diff) |
added Fpdf.GetFontDesc method and documentation for FontDescType
Diffstat (limited to 'fpdf.go')
-rw-r--r-- | fpdf.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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. |