From fbd52ff8be21443ad5bfb67331155973e2427d7c Mon Sep 17 00:00:00 2001 From: Randy McDermott Date: Thu, 17 Sep 2026 13:56:37 -0400 Subject: [PATCH] =?UTF-8?q?CeditQt:=20Fixed=20in=20the=20shared=20UI:=20no?= =?UTF-8?q?w=20explicitly=20loads=20DejaVu=20Sans=20Mono,=2012=20point.=20?= =?UTF-8?q?Removed=20the=20generator=E2=80=99s=20separate=20log-font=20ove?= =?UTF-8?q?rride.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CeditQt/main_window.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/CeditQt/main_window.py b/Source/CeditQt/main_window.py index 269ee2d31..62320df63 100644 --- a/Source/CeditQt/main_window.py +++ b/Source/CeditQt/main_window.py @@ -1926,14 +1926,18 @@ def __init__(self, parent, case_name: str, simulation_time: float): @staticmethod def fixed_width_font() -> QFont: - font = QFontDatabase.systemFont(QFontDatabase.SystemFont.FixedFont) - - if "Menlo" in QFontDatabase.families(): - font = QFont("Menlo") - + import matplotlib + + # Use the same bundled TrueType font in the UI and headless captures. + font_path = Path(matplotlib.get_data_path()) / "fonts" / "ttf" / "DejaVuSansMono.ttf" + font_id = QFontDatabase.addApplicationFont(str(font_path)) + families = QFontDatabase.applicationFontFamilies(font_id) + if not families: + raise RuntimeError(f"Could not load the monospace font {font_path}") + font = QFont(families[0], 12) font.setStyleHint(QFont.StyleHint.Monospace) font.setFixedPitch(True) - font.setPointSize(12) + font.setStyleStrategy(QFont.StyleStrategy.PreferAntialias | QFont.StyleStrategy.PreferOutline) return font def summary_headers(self) -> list[str]: