I finally got round to updating my copies of FLTK. (It was 1.4.2 on Debian, and 1.4.0 on Windows).
The default Windows font for FL_HELVETICA has changed to "Microsoft Sans Serif" (and I don't like it). However I had a problem as I was overriding the default font for FL_COURIER and the font name was not maintained correctly. The following code should show the problem, but I can't solve all the dependencies to get it to link under MSVC, and I've run out of time.
#include <FL/Fl.H>#include <cstdio>
int main(int argc, char** argv){Fl::set_font(FL_COURIER, "Courier New");const char* name = Fl::get_font_name(FL_COURIER, nullptr);printf("Read font = %s\n", name);
}
The call to Fl::get_font_name() returned "ourier New" in my app (many seconds apart).
It works OK on Debian with gcc toolset.
BTW, I didn't see a branch for the current 1.4 head after pulling the latest using MSVC.
On Wednesday, 18 June 2025 at 15:26:24 UTC+1 Phil wrote:
I finally got round to updating my copies of FLTK. (It was 1.4.2 on Debian, and 1.4.0 on Windows).
The default Windows font for FL_HELVETICA has changed to "Microsoft Sans Serif" (and I don't like it).
However I had a problem as I was overriding the default font for FL_COURIER and the font name was not maintained correctly. [...]
There's Weird Stuff(TM) done with font names under Win32, so it *might* be worth making the code say something like...
Fl::set_font(FL_COURIER, " courier new");
The key being a leading space, and all lower case. See if that helps.
#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```
On Wednesday, 18 June 2025 at 15:26:24 UTC+1 Phil wrote:I finally got round to updating my copies of FLTK. (It was 1.4.2 on Debian, and 1.4.0 on Windows).
The default Windows font for FL_HELVETICA has changed to "Microsoft Sans Serif" (and I don't like it).
However I had a problem as I was overriding the default font for FL_COURIER and the font name was not maintained correctly. [...]
There's Weird Stuff(TM) done with font names under Win32, so it *might* be worth making the code say something like...
Fl::set_font(FL_COURIER, " courier new");
The key being a leading space, and all lower case. See if that helps.
#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