Skip to content

Commit

Permalink
Force debug window font
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbatalov committed Jul 19, 2023
1 parent 8414eff commit 2d8a637
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/window_manager_private.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,12 @@ int _win_debug(char* string)
return -1;
}

// CE: Debug window metrics were designed for default DOS-style font (0).
// We don't expect caller to properly set one, so without manually forcing
// it debug window might contain mixed fonts.
int oldFont = fontGetCurrent();
fontSetCurrent(0);

int lineHeight = fontGetLineHeight();

if (_wd == -1) {
Expand Down Expand Up @@ -828,6 +834,9 @@ int _win_debug(char* string)

windowRefresh(_wd);

// CE: Restore font.
fontSetCurrent(oldFont);

return 0;
}

Expand Down

0 comments on commit 2d8a637

Please sign in to comment.