fix #8 by exporting utility function LoadFontFace

This commit is contained in:
Michael Fogleman 2016-12-14 14:26:04 -05:00
parent 19103e0c61
commit 5917fd97e8
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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