Skip to content

Commit

Permalink
Unlock the font settings when returning to the Game Browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed May 13, 2024
1 parent 3ed35a9 commit efd7332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ void Font::ResetDefault() {
SetDefault(nullptr, false);

#ifdef HAVE_FREETYPE
const auto& cfg = Player::player_config;
auto& cfg = Player::player_config;
if (!cfg.font1.Get().empty()) {
auto is = FileFinder::Root().OpenInputStream(cfg.font1.Get());
SetDefault(CreateFtFont(std::move(is), cfg.font1_size.Get(), false, false), false);
Expand All @@ -672,6 +672,9 @@ void Font::ResetDefault() {
auto is = FileFinder::Root().OpenInputStream(cfg.font2.Get());
SetDefault(CreateFtFont(std::move(is), cfg.font2_size.Get(), false, false), true);
}

cfg.font1.SetLocked(false);
cfg.font2.SetLocked(false);
#endif
}

Expand Down
2 changes: 0 additions & 2 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,6 @@ void Player::LoadFonts() {
#ifdef HAVE_FREETYPE
// Look for bundled fonts
auto gothic = FileFinder::OpenFont("Font");
player_config.font1.SetLocked(false);
if (gothic) {
auto ft = Font::CreateFtFont(std::move(gothic), 12, false, false);
player_config.font1.SetLocked(ft != nullptr);
Expand All @@ -1063,7 +1062,6 @@ void Player::LoadFonts() {
}

auto mincho = FileFinder::OpenFont("Font2");
player_config.font2.SetLocked(false);
if (mincho) {
auto ft = Font::CreateFtFont(std::move(mincho), 12, false, false);
player_config.font2.SetLocked(ft != nullptr);
Expand Down

0 comments on commit efd7332

Please sign in to comment.