diff --git a/context.go b/context.go index c7b43fa..e961953 100644 --- a/context.go +++ b/context.go @@ -594,7 +594,7 @@ func (dc *Context) SetFontFace(fontFace font.Face) { } func (dc *Context) LoadFontFace(path string, points float64) error { - face, err := loadFontFace(path, points) + face, err := LoadFontFace(path, points) if err == nil { dc.fontFace = face dc.fontHeight = points * 72 / 96 diff --git a/util.go b/util.go index 62577f5..a530fcb 100644 --- a/util.go +++ b/util.go @@ -4,6 +4,7 @@ import ( "fmt" "image" "image/draw" + _ "image/jpeg" "image/png" "io/ioutil" "math" @@ -99,7 +100,7 @@ func unfix(x fixed.Int26_6) float64 { return 0 } -func loadFontFace(path string, points float64) (font.Face, error) { +func LoadFontFace(path string, points float64) (font.Face, error) { fontBytes, err := ioutil.ReadFile(path) if err != nil { return nil, err