Skip to content

Commit

Permalink
Fix font axes/features not working on DPI change (#12492)
Browse files Browse the repository at this point in the history
When the dpi is changed, call `updateFont()` instead of `TriggerFontChange`, this
means that we continue to use the existing font features/axes

Closes #11287

(cherry picked from commit 3b46794)
  • Loading branch information
PankajBhojwani authored and DHowett committed Feb 16, 2022
1 parent e6010b8 commit b8398d8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/cascadia/TerminalControl/ControlCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,16 +917,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation
return;
}

const auto dpi = (float)(scale * USER_DEFAULT_SCREEN_DPI);

const auto actualFontOldSize = _actualFont.GetSize();

auto lock = _terminal->LockForWriting();
_compositionScale = scale;

_renderer->TriggerFontChange(::base::saturated_cast<int>(dpi),
_desiredFont,
_actualFont);
// _updateFont relies on the new _compositionScale set above
_updateFont();

const auto actualFontNewSize = _actualFont.GetSize();
if (actualFontNewSize != actualFontOldSize)
Expand Down

0 comments on commit b8398d8

Please sign in to comment.