font tweak.;
This commit is contained in:
parent
e76db4b74b
commit
502d35f353
10
chart.go
10
chart.go
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user