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") logger = global.Logger.WithPrefix("GUI")
black_magic() black_magic()
logger.Info("Initializing GUI") logger.Info("Initializing GUI")
if !config.General.UseSystemFonts { if config.General.CustomFonts != "" {
_ = os.Setenv("FYNE_FONT", config.GetAssetPath("msyh.ttc")) _ = os.Setenv("FYNE_FONT", config.GetAssetPath(config.General.CustomFonts))
} }
App = app.NewWithID(config.ProgramName) App = app.NewWithID(config.ProgramName)
//App.Settings().SetTheme(&myTheme{}) //App.Settings().SetTheme(&myTheme{})

View File

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