From d9560c1ad7788548abca2d36eb46e5bd5f621f39 Mon Sep 17 00:00:00 2001 From: Don Ward Date: Sat, 10 Feb 2024 13:41:28 +0000 Subject: [PATCH] runtime: Make "mono" select a monospaced font. Previously, "mono" and "fixed" were treated as the same thing and asked for Lucida Sans, which is a proportionally spaced font. Now, "mono" asks for Lucida Console, which is monospaced, and "fixed" selects Lucida Sans (with the correct flags). --- src/runtime/rmswin.ri | 8 ++++++-- src/runtime/rxwin.ri | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/runtime/rmswin.ri b/src/runtime/rmswin.ri index 85c2002e9..eb5a9debc 100644 --- a/src/runtime/rmswin.ri +++ b/src/runtime/rmswin.ri @@ -1674,10 +1674,14 @@ HFONT mkfont(char *s, char is_3D) * This is a legal Icon font spec. * Check first for special "standard" family names. */ - if (!strcmp(family, "mono") || !strcmp(family, "fixed")) { - stdfam = "Lucida Sans"; /* Lucida Console? */ + if (!strcmp(family, "mono")) { + stdfam = "Lucida Console"; flags |= FONTFLAG_MONO + FONTFLAG_SANS; } + else if ( !strcmp(family, "fixed")) { + stdfam = "Lucida Sans"; + flags |= FONTFLAG_PROPORTIONAL + FONTFLAG_SANS; + } else if (!strcmp(family, "typewriter")) { stdfam = "Courier New"; /* was "courier" */ flags |= FONTFLAG_MONO + FONTFLAG_SERIF; diff --git a/src/runtime/rxwin.ri b/src/runtime/rxwin.ri index c18dc7865..3ba27954d 100644 --- a/src/runtime/rxwin.ri +++ b/src/runtime/rxwin.ri @@ -5698,10 +5698,14 @@ void mkfont(char *s, char is_3D) * This is a legal Icon font spec. * Check first for special "standard" family names. */ - if (!strcmp(family, "mono") || !strcmp(family, "fixed")) { - stdfam = "Lucida Sans"; /* Lucida Console? */ + if (!strcmp(family, "mono")) { + stdfam = "Lucida Console"; flags |= FONTFLAG_MONO + FONTFLAG_SANS; } + else if ( !strcmp(family, "fixed")) { + stdfam = "Lucida Sans"; + flags |= FONTFLAG_PROPORTIONAL + FONTFLAG_SANS; + } else if (!strcmp(family, "typewriter")) { stdfam = "Courier New"; /* was "courier" */ flags |= FONTFLAG_MONO + FONTFLAG_SERIF;