change config UseSystemFonts to CustomFonts, allow user to specify which font to use

This commit is contained in:
aynakeya
2025-06-30 00:21:41 +08:00
parent cdc3c5d118
commit 1fa82c2a01
2 changed files with 5 additions and 5 deletions

View File

@@ -35,8 +35,8 @@ func Initialize() {
logger = global.Logger.WithPrefix("GUI")
black_magic()
logger.Info("Initializing GUI")
if !config.General.UseSystemFonts {
_ = os.Setenv("FYNE_FONT", config.GetAssetPath("msyh.ttc"))
if config.General.CustomFonts != "" {
_ = os.Setenv("FYNE_FONT", config.GetAssetPath(config.General.CustomFonts))
}
App = app.NewWithID(config.ProgramName)
//App.Settings().SetTheme(&myTheme{})

View File

@@ -11,8 +11,8 @@ type _GeneralConfig struct {
PlayNextOnFail bool
UseSystemPlaylist bool
FixedSize bool
EnableSMC bool // enable system media control
UseSystemFonts bool // using system fonts
EnableSMC bool // enable system media control
CustomFonts string // use custom fonts, under ./assets file
}
@@ -31,5 +31,5 @@ var General = &_GeneralConfig{
UseSystemPlaylist: true,
FixedSize: true,
EnableSMC: true,
UseSystemFonts: true,
CustomFonts: "",
}