Fix #23 via doc on gg.LoadFontFace function.
This commit is contained in:
parent
9a34078211
commit
a4f287e211
5
util.go
5
util.go
@ -101,6 +101,11 @@ func unfix(x fixed.Int26_6) float64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LoadFontFace is a helper function to load the specified font file with
|
||||||
|
// the specified point size. Note that the returned `font.Face` objects
|
||||||
|
// are not thread safe and cannot be used in parallel across goroutines.
|
||||||
|
// You can usually just use the Context.LoadFontFace function instead of
|
||||||
|
// this package-level function.
|
||||||
func LoadFontFace(path string, points float64) (font.Face, error) {
|
func LoadFontFace(path string, points float64) (font.Face, error) {
|
||||||
fontBytes, err := ioutil.ReadFile(path)
|
fontBytes, err := ioutil.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user