From 502d35f35325bfff722dec481b3350219890f51f Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Thu, 7 Jul 2016 21:15:35 -0700 Subject: [PATCH] font tweak.; --- chart.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chart.go b/chart.go index b1931cf..050e23b 100644 --- a/chart.go +++ b/chart.go @@ -30,10 +30,14 @@ type Chart struct { // GetFont returns the text font. func (c Chart) GetFont() (*truetype.Font, error) { - if c.Font != nil { - return c.Font, nil + if 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.