From 143d2aae95ddde018595c76f0f9f61fce1a42563 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 23 Oct 2019 10:18:11 +0200 Subject: [PATCH] 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 --- font/gofont/gofont.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font/gofont/gofont.go b/font/gofont/gofont.go index 03383f1f..5b5ad7b6 100644 --- a/font/gofont/gofont.go +++ b/font/gofont/gofont.go @@ -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)