font tweak.;
This commit is contained in:
parent
e76db4b74b
commit
502d35f353
1 changed files with 7 additions and 3 deletions
10
chart.go
10
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
|
||||
}
|
||||
return GetDefaultFont()
|
||||
c.Font = f
|
||||
}
|
||||
return c.Font
|
||||
}
|
||||
|
||||
// Render renders the chart with the given renderer to the given io.Writer.
|
||||
|
|
Loading…
Reference in a new issue