forked from joejulian/gio
font/gofont: add explicit Register
Registering the font as a side effect of importing the gofont package was too magic. Require an explicit Register call instead. As a side effect, it is more clear which font is the default (the first one registered). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -27,7 +27,7 @@ import (
|
||||
"golang.org/x/image/font/gofont/gosmallcapsitalic"
|
||||
)
|
||||
|
||||
func init() {
|
||||
func Register() {
|
||||
register(text.Font{}, goregular.TTF)
|
||||
register(text.Font{Style: text.Italic}, goitalic.TTF)
|
||||
register(text.Font{Weight: text.Bold}, gobold.TTF)
|
||||
|
||||
Reference in New Issue
Block a user