font tweak.;

This commit is contained in:
Will Charczuk 2016-07-07 21:15:35 -07:00
parent e76db4b74b
commit 502d35f353

View File

@ -30,10 +30,14 @@ type Chart struct {
// GetFont returns the text font. // GetFont returns the text font.
func (c Chart) GetFont() (*truetype.Font, error) { func (c Chart) GetFont() (*truetype.Font, error) {
if c.Font != nil { if c.Font == nil {
return c.Font, nil f, err := GetDefaultFont()
if err != nil {
return nil, err
}
c.Font = f
} }
return GetDefaultFont() return c.Font
} }
// Render renders the chart with the given renderer to the given io.Writer. // Render renders the chart with the given renderer to the given io.Writer.