From 2d8a637f7dd1d3e27c335b1801ca63f1e727f04f Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Wed, 19 Jul 2023 12:05:39 +0300 Subject: [PATCH] Force debug window font --- src/window_manager_private.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/window_manager_private.cc b/src/window_manager_private.cc index bd0b3ff..1076a3d 100644 --- a/src/window_manager_private.cc +++ b/src/window_manager_private.cc @@ -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; }