Added header font.

This commit is contained in:
Sander Schobers 2019-12-29 09:54:07 +01:00
parent 8d7ec272b6
commit aa47e2cabb
3 changed files with 11 additions and 2 deletions

View File

@ -180,6 +180,7 @@ type settingsHeader struct {
func newSettingsHeader(label string) alui.Control {
header := &settingsHeader{}
header.Font = "header"
header.Text = label
return alui.NewMargins(header, 3*margin, 0, 2*margin, 0)
}

View File

@ -61,7 +61,11 @@ func (g *game) loadBitmap(path, name string) error {
}
func (g *game) loadFonts() error {
openSansPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Regular.ttf")
openSansRegularPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Regular.ttf")
if err != nil {
return err
}
openSansBoldPath, err := g.ctx.Resources.Retrieve("fonts/OpenSans-Bold.ttf")
if err != nil {
return err
}
@ -69,7 +73,11 @@ func (g *game) loadFonts() error {
if err != nil {
return err
}
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansPath, Name: "default", Size: 32})
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansRegularPath, Name: "default", Size: 32})
if err != nil {
return err
}
err = g.ui.Fonts().LoadFonts(alui.FontDescription{Path: openSansBoldPath, Name: "header", Size: 32})
if err != nil {
return err
}

Binary file not shown.