text,font/gofont: replace text.Collection with slice of FontFaces

A slice of FontFace pairs are simpler, and thread safe in case a client
wants to append or modify the font collection.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-21 21:41:20 +02:00
parent 424a728988
commit 9e3d3b6f58
3 changed files with 70 additions and 83 deletions
+2 -2
View File
@@ -29,9 +29,9 @@ type Theme struct {
radioUncheckedIcon *widget.Icon
}
func NewTheme(col *text.Collection) *Theme {
func NewTheme(fontCollection []text.FontFace) *Theme {
t := &Theme{
Shaper: text.NewCache(col),
Shaper: text.NewCache(fontCollection),
}
t.Color.Primary = rgb(0x3f51b5)
t.Color.Text = rgb(0x000000)