From 915ea80f4590280e431fb4ebbec0c6496b9a054e Mon Sep 17 00:00:00 2001
From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
Date: Wed, 22 Jan 2025 18:44:13 +0100
Subject: [PATCH] Windows: replace "Arial" by "Microsoft Sans Serif"  for the
 FL_HELVETICA font family

Users who need the old behavior for strict backwards compatibility under Windows can load the previous (Arial) font at program startup with only a few lines of code:

#ifdef _WIN32
  // reset Windows fonts to pre-1.4.2 state
  Fl::set_font(FL_HELVETICA,     " Arial");
  Fl::set_font(FL_HELVETICA + 1, "BArial");
  Fl::set_font(FL_HELVETICA + 2, "IArial");
  Fl::set_font(FL_HELVETICA + 3, "PArial");
#endif
---
 CHANGES.txt                                     |  7 +++++++
 src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx | 10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 38dfefbd7..627fdf392 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,10 @@
+Changes in FLTK 1.4.2                                   Released: ??? ?? 2025
+
+  Technical Details and Build Procedure Improvements
+
+  - Use "Microsoft Sans Serif" instead of "Arial" for the FL_HELVETICA font
+  family under Windows.
+
 Changes in FLTK 1.4.1                                   Released: Dec 12 2024
 
   FLTK 1.4.1 is a maintenance release with bug fixes and improvements.
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
index c5a6e0308..f350dcd40 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx
@@ -1,7 +1,7 @@
 //
 // Windows font utilities for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2025 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -280,10 +280,10 @@ Fl_GDI_Font_Descriptor::~Fl_GDI_Font_Descriptor() {
 // WARNING: if you add to this table, you must redefine FL_FREE_FONT
 // in Enumerations.H & recompile!!
 static Fl_Fontdesc built_in_table[] = {
-{" Arial"},
-{"BArial"},
-{"IArial"},
-{"PArial"},
+  {" Microsoft Sans Serif"},
+  {"BMicrosoft Sans Serif"},
+  {"IMicrosoft Sans Serif"},
+  {"PMicrosoft Sans Serif"},
 {" Courier New"},
 {"BCourier New"},
 {"ICourier New"},
-- 
GitLab