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
This commit is contained in:
ManoloFLTK 2025-01-22 18:44:13 +01:00
parent 2bcfcc332d
commit 915ea80f45
2 changed files with 12 additions and 5 deletions

View File

@ -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.

View File

@ -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"},