Added SetFaceSet to registrar

This commit is contained in:
Sasha Koshka 2024-08-11 10:42:22 -04:00
parent fa91b4f415
commit 3e597404ac
2 changed files with 11 additions and 0 deletions

View File

@ -146,6 +146,8 @@ func RunApplication (application Application) {
if err != nil { log.Fatalln("nasin: could not set theme:", err) }
err = reg.SetIconSet()
if err != nil { log.Fatalln("nasin: could not set icon set:", err) }
err = reg.SetFaceSet()
if err != nil { log.Fatalln("nasin: could not set face set:", err) }
err = application.Init()
if err != nil { log.Fatalln("nasin: could not run application:", err) }

View File

@ -10,6 +10,7 @@ import "git.tebibyte.media/tomo/nasin/internal/icons/xdg"
import "git.tebibyte.media/tomo/nasin/internal/style/tss"
import "git.tebibyte.media/tomo/nasin/internal/icons/fallback"
import "git.tebibyte.media/tomo/nasin/internal/style/fallback"
import "git.tebibyte.media/tomo/nasin/internal/faces/fallback"
type Registrar struct {
backend *x.Backend
@ -57,3 +58,11 @@ func (this *Registrar) SetIconSet () error {
this.backend.SetIconSet(iconSet)
return nil
}
func (this *Registrar) SetFaceSet () error {
// TODO replace this with something that uses findfont, and caches and
// refcounts the faces
faceSet := fallbackFaces.New()
this.backend.SetFaceSet(faceSet)
return nil
}