Force debug window font

This commit is contained in:
Alexander Batalov 2023-07-19 12:05:39 +03:00
parent 8414effc04
commit 2d8a637f7d
1 changed files with 9 additions and 0 deletions

View File

@ -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) {
@ -828,6 +834,9 @@ int _win_debug(char* string)
windowRefresh(_wd);
// CE: Restore font.
fontSetCurrent(oldFont);
return 0;
}