Font selection problem

14 views
Skip to first unread message

Rob McDonald

unread,
Jan 29, 2026, 11:43:15 AM (14 days ago) Jan 29
to fltk.general
I use a Fl_Terminal in my program -- I create it like this:

Fl_Terminal* terminal = new Fl_Terminal ( m_X, m_Y, m_W, height );

terminal->textfont( FL_SCREEN );
terminal->textsize( 12 ); // Default 14

One of my users is using Windows 11 Pro 25H2 with a Japan locale set (ja-JP).

On his machine, the text comes out un-readable.

screen_example.png

The documentation says to use either FL_SCREEN or FL_COURIER -- and that FL_SCREEN is supposed to be the default monospaced font.  Likewise, it says that Fl_Terminal _must_ be passed a monospaced font.

Am I doing something wrong here?

Is there something I can choose here that will work on every operating system?

Is the problem that I'm scaling a bitmap font?  Is there a way to find the 'native' size of the loaded font and set that size so it doesn't scale (and hopefully looks as good as possible)?

Rob

imm

unread,
Jan 29, 2026, 1:53:23 PM (13 days ago) Jan 29
to General FLTK
On Thu, 29 Jan 2026, 16:43 Rob McDonald, wrote:

One of my users is using Windows 11 Pro 25H2 with a Japan locale set (ja-JP).

On his machine, the text comes out un-readable.

screen_example.png

The documentation says to use either FL_SCREEN or FL_COURIER -- and that FL_SCREEN is supposed to be the default monospaced font.  Likewise, it says that Fl_Terminal _must_ be passed a monospaced font.

Am I doing something wrong here?

Is there something I can choose here that will work on every operating system?

Is the problem that I'm scaling a bitmap font?  Is there a way to find the 'native' size of the loaded font and set that size so it doesn't scale (and hopefully looks as good as possible)?

Ugh, that looks really nasty. And does indeed look like a badly scaled bitmap font.

I'm a bit surprised TBH, for the most part I've found Win11 font handling to be fairly decent.

Though I don't use FL_SCREEN much (if at all) so...
Do you know how FL_COURIER looks on that machine?

Failing that, on a recent-ish Win10/11 I'd probably try setting the font to Consolas explicitly and see how that works out. That should give you a respectable scalable monospaced face.
Might even work on (some) Linux systems!

If you have access to the failing system, and can run the FLTK utf8 font test, I'm pretty sure one of the things it does is measure the font metrics and tell you whether the face is monospaced or not, so at a pinch you might be able to use that to find a font that will actually work on that machine!
--
Ian
From my Fairphone FP3
 

Rob McDonald

unread,
Jan 29, 2026, 2:04:00 PM (13 days ago) Jan 29
to fltk.general
Unfortunately, I don't have access to the machine for testing.

I can try some things, but FLTK really needs a robust FL_MONOSPACED option that will work on all machines / locales.  I thought FL_SCREEN was that.

I understand that there might be a lot of platform specific hoops to jump through -- but that is exactly why it should be done by FLTK instead of poorly duplicated in every application that uses Fl_Terminal or otherwise needs a monospaced font. 

Rob

 

imm

unread,
Jan 29, 2026, 4:36:17 PM (13 days ago) Jan 29
to General FLTK
On Thu, 29 Jan 2026, 19:04 Rob McDonald wrote:

Unfortunately, I don't have access to the machine for testing.

Yeah; understandable, but it might have been interesting to see what fonts that machine actually has!


I can try some things, but FLTK really needs a robust FL_MONOSPACED option that will work on all machines / locales.  I thought FL_SCREEN was that.

I think FL_COURIER is maybe that: at least that's what I use and AFAIK that's generally been at least usable.

I remember having portability issues with FL_SCREEN in the past, but I think that was a Linux issue rather than Windows (it was long ago...)



I understand that there might be a lot of platform specific hoops to jump through -- but that is exactly why it should be done by FLTK instead of poorly duplicated in every application that uses Fl_Terminal or otherwise needs a monospaced font. 

The issue with fonts is (always has been, really) that every system has different fonts and defaults and finding something that works is "non trivial".
Variant Linux distros just make it even tougher.

For me FL_COURIER has been a "good enough" starting point in general, for a basic monospaced face. Got to be worth a stab, anyway!

Greg Ercolano

unread,
Jan 29, 2026, 4:56:12 PM (13 days ago) Jan 29
to fltkg...@googlegroups.com

On 1/29/26 11:04, Rob McDonald wrote:

I can try some things, but FLTK really needs a robust FL_MONOSPACED option that will work on all machines / locales.  I thought FL_SCREEN was that.

I understand that there might be a lot of platform specific hoops to jump through -- but that is exactly why it should be done by FLTK instead of poorly duplicated in every application that uses Fl_Terminal or otherwise needs a monospaced font. 

    This can't really work if the machines in question don't have the fonts requested.

    A machine configured for japanese may not have any of the normal US fonts,
    and FLTK has no way of knowing what would be equivalent on such a machine,
    if indeed anything would be.

    My guess is the other machine needs to have US font options installed,
    the same way I have to have Japenese font options installed on a US locale machine.

    So it's possible if they just try installing US based fonts for the application,
    no changes to the program will be needed. Just guessing.

Rob McDonald

unread,
Jan 29, 2026, 9:37:19 PM (13 days ago) Jan 29
to fltk.general
Well, FL_COURIER seems to be working for this user.  We'll see how it goes.

In my code, I had a note that FL_COURIER was the default, but I clearly had chosen FL_SCREEN -- I genuinely don't know why.  Hopefully it doesn't cause a problem on some other platform...

Rob


 

imm

unread,
Jan 30, 2026, 6:00:13 AM (13 days ago) Jan 30
to fltkg...@googlegroups.com
>
> Well, FL_COURIER seems to be working for this user. We'll see how it goes.
>

That's something, at least...

FWIW, I thought I'd actually try this on Win11 (this PC) to see what
happened. Not a JP locale of course but still.

So I took Greg's terminal test and bodged it to explicitly use
FL_COURIER, FL_SCREEN and Consolas as the font.
The FL_COURIER version looks identical to stock so I assume that is
what the Fl_Terminal picks by default?
The FL_SCREEN was nasty - not as bad as you show, but clearly wrong.
In particular, it clearly can not handle any non-ASCII glyphs, so
probably useless for JP locale use. (Unless the JP version of
FL_SCREEN is different of course!)
Of the three fonts Consolas did the best job of spacing and glyph
rendering across languages, but the FL_COUIRIER was a close second.

Screenshot attached - can you tell which is which?
Screenshot 2026-01-30 104912.png
Reply all
Reply to author
Forward
0 new messages