From 3319c51b75785b73101c8c9cd19a3eec8f494c0a Mon Sep 17 00:00:00 2001 From: Joe Westcott Date: Mon, 29 Apr 2019 19:59:53 +0100 Subject: Add SetFontStyle method (#248) --- def.go | 1 + fpdf.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/def.go b/def.go index fcc9237..ee0d3a6 100644 --- a/def.go +++ b/def.go @@ -426,6 +426,7 @@ type Pdf interface { SetFontLoader(loader FontLoader) SetFontLocation(fontDirStr string) SetFontSize(size float64) + SetFontStyle(styleStr string) SetFontUnitSize(size float64) SetFooterFunc(fnc func()) SetFooterFuncLpi(fnc func(lastPage bool)) diff --git a/fpdf.go b/fpdf.go index bd4aa4e..4053802 100644 --- a/fpdf.go +++ b/fpdf.go @@ -1799,6 +1799,11 @@ func (f *Fpdf) SetFont(familyStr, styleStr string, size float64) { return } +// SetFontStyle sets the style of the current font. See also SetFont() +func (f *Fpdf) SetFontStyle(styleStr string) { + f.SetFont(f.fontFamily, styleStr, f.fontSizePt) +} + // SetFontSize defines the size of the current font. Size is specified in // points (1/ 72 inch). See also SetFontUnitSize(). func (f *Fpdf) SetFontSize(size float64) { -- cgit v1.2.1-24-ge1ad