RE: [fltk.general] Hint on how / where to look for fonts used by FLTK ?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
Previous Message ]New Message | Reply ]Next Message ]

RE: Hint on how / where to look for fonts used by FLTK ? Ian MacArthur 02:47 Aug 02 top right image
  I have a replacement message box routine with has its own Fl_Box for the "icon", white background, blue text, font size large. I static link. I have two separate apps built against the same library using the same startup code in main(). From the same Linux environment, one will show the icon large as expected, the other is blue but doesn't look bold or large, just the normal height. Yet, if I run it in another Linux environment where it's actually built, via debug mode, the "icon" is large.

Does someone have a hint on where to look at maybe a font issue in the environment it's running in, if it was consistent across the two apps, I'd say that is it for sure because there is limited fonts installed. But the other app is fine. It's weird, any hints?


This is going to depend on how your code "works" to choose a given face, to a large extent.

FLTK itself does not really have any font faces (it has a few built in as a last-resort fallback for GL scenes and so forth, but not for general widget use.) Instead, FLTK basically uses the system services to load whatever faces the OS has installed.

This, of course, means that the faces you actually get vary from host to host… The FLTK default fonts are set up using basic font metrics (we basically use XFT or equivalent API's on other OS to request a face that has some specific properties - size, serif, monospace/proportional, etc.) and that gets a face assigned for each of the FLTK "built-in" fonts, but even these are loaded from the host system and so can change from machine to machine…
If you try and load a face that does not exist on a given host, then I think X11 falls back to using some basic bitmap face, which sounds a lot like what you might be seeing. WinXX and macOs (and FLTK+PanGo) are much better at substituting "close alternatives" so are much less likely to fall back to some duff face…

You may need to show us what you are actually doing, maybe a small compileable example that we can all try out, that manifests the issue for you.
Also, take a look at the test/fonts and the test/utf8 demos to see what fonts each system carries (and the code shows how they can be loaded and used, though may not exactly constitute best-practice, as it is a wee bit of a hack…)

You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.