Font problem with new build

78 views
Skip to first unread message

TwoTrees Innerworld

unread,
Apr 3, 2024, 4:00:07 AMApr 3
to fltk.general
Hi and Help!
I am rebuilding a 5 year old project which is running on a new Rpi 3.
I have it successfully building and running, but the screens all display
a "miniature" font which is not what I set it up for.
If I run the old binary, it properly displays the menus with the proper fonts.
However, the new compiled binary displays the menus with the "miniature" fonts.
It compiles and links with no errors.
Is this a linker error?
I assume that the fonts are linked into the binary and are carried with it.
Is there a linker option that I'm missing?
I don't understand how this error can occur without throwing a linker error.

Thanks for any help, I've been chasing this for a month...


Matthias Melcher

unread,
Apr 3, 2024, 4:37:05 AMApr 3
to fltk.general
Which version of FLTK are you using? 1.3.x? 1.4?  Newer versions of FLTK support HiDPI displays. Maybe your RPi screen dpi setting is wrong (`sudo raspi-config` IIRC) ? If you use 1.4, do you use X11 or Wayland? Fonts are usually not part of FLTK based binaries. FLTK uses whatever comes with X11 (or Wayland).

TwoTrees Innerworld

unread,
Apr 3, 2024, 5:17:35 PMApr 3
to fltk.general
I'm using FLTK 1.3.5 and X11. Again, the old binary runs and displays the proper fonts.
The newly built binary (built on the new system) displays the "miniature" fonts.

Thanks for any help!

- al

Ian MacArthur

unread,
Apr 4, 2024, 4:06:28 AMApr 4
to fltk.general
On Wednesday 3 April 2024 at 22:17:35 UTC+1 twotreesi... wrote:
I'm using FLTK 1.3.5 and X11. Again, the old binary runs and displays the proper fonts.
The newly built binary (built on the new system) displays the "miniature" fonts.

Hmm.
Do you have a short, compileable, example you could post here that exhibits this behaviour?

As Matt says, the fonts are loaded (at runtime) form the host machine (or under X11 potentially from the display server, in effect) so we wouldn't expect to see this sort of behaviour generally.
I have any number of R.Pi kicking about, including some early (pre-rounded corners) Pi 1B, and I can't reproduce this effect (though TBH I didn't try ALL that hard...)

So; questions:
- Which font face is the application loading, that exhibits the behaviour?
- What display mechanism is used? Is the output displayed "local" to the Pi, or is it headless and displayed remotely on an X-server. If the latter, is the same X-server used in both cases?
- Is one build using XFT font rendering whilst the other uses Xlib fonts, perhaps? That could significantly affect font scaling behaviour if the display server is high-DPI.

There may be other things we need to know, but I haven't thought of them yet.
FWIW, FLTK-1.4 should compile most extant fltk-1.3 code "as-is" and has the advantage of correctly supporting display scaling for high-DPI systems, which fltk-1.3 can't do.

And, as a totally irrelevant aside, when I first saw your post, my brain parsed your email as "Two Tree Sinner..." which I'm pretty sure is not what was meant.
Maybe that's more about me than you though....

TwoTrees Innerworld

unread,
Apr 4, 2024, 7:52:08 PMApr 4
to fltk.general
Font is Helvetica, sizes from 14 to 28 point.

The display is a local 5" 640 x 480 HDMI touch screen with capacitive touch via USB.

The build environment is unchanged from the old version to the new.
I'm using Netbeans and C and C++.

Screens were designed using Fluid 1.3.8.

I'll try to cook up an example tonight.

Regarding your irrelevant aside, that's pretty funny!
It's actually the email for our music publishing entity Two Trees Innerworld Publishing.

Thanks for your help and for looking at this!

- al

Albrecht Schlosser

unread,
Apr 5, 2024, 7:59:32 AMApr 5
to fltkg...@googlegroups.com
On 4/5/24 01:49 TwoTrees Innerworld wrote:
> Font is Helvetica, sizes from 14 to 28 point.
>
> The display is a local 5" 640 x 480 HDMI touch screen with capacitive
> touch via USB.
>
> The build environment is unchanged from the old version to the new.
> I'm using Netbeans and C and C++.

Can (did) you try the FLTK test and demo programs? What do they show on
this display?
Some interesting examples, all in the test/ folder:

hello.cxx: should be obvious

fullscreen.cxx: shows display size etc. (among others), what happens in
fullscreen mode?

fonts.cxx and utf8.cxx: displays fonts, would be helpful to see
different fonts and sizes

unittests.cxx: several "tabs", resizable, ...

Do these demos work as intended? Are they different than those of the
old build?

TwoTrees Innerworld

unread,
Apr 9, 2024, 4:42:13 PMApr 9
to fltk.general
Hi,

I cloned my project and removed all the modules from it, then replaced main.c with the source for hello.c
It built and linked with no errors, but runs just the same (small fonts).
I tried changing the font size from the original 36 point to 72 point, no change.

Where does FLTK get fonts from?
Do they come from X11 or are they loaded from somewhere at runtime?
It seems to be acting like it can't find the fonts and is reverting to a default.

What can I try next?

Thanks!

- al

imm

unread,
Apr 9, 2024, 4:59:59 PMApr 9
to General FLTK
On Tue, 9 Apr 2024, 21:42 TwoTrees Innerworld wrote:
Hi,

I cloned my project and removed all the modules from it, then replaced main.c with the source for hello.c
It built and linked with no errors, but runs just the same (small fonts).
I tried changing the font size from the original 36 point to 72 point, no change.

Where does FLTK get fonts from?
Do they come from X11 or are they loaded from somewhere at runtime?
It seems to be acting like it can't find the fonts and is reverting to a default.

What can I try next?

This small font that doesn't change size; does it look bitmapped or antialiased?

I suspect it's just the bitmapped fallback font, it doesn't sound like your getting any actual fonts at all.

Do you have the dev packages for XFT and fontconfig and so forth installed on your build machine?
--
Ian
From my Fairphone FP3

Matthias Melcher

unread,
Apr 9, 2024, 5:24:36 PMApr 9
to fltk.general
Yes, this sounds very familiar. I assume that FLTK does not find a font by the give name and X11 then falls back to the minimal bitmap font. FLTK with Xft look for   {" sans"},

  {"sans"},

  {"mono"},

  {"serif"},

  {"symbol"},

  {"screen"},

  {"zapf dingbats"},


it used to look for   
  {"helvetica"},

  {"courier"},

  {"times"},

  {"symbol"},

  {"lucidatypewriter"},


Under Xlib, we look for


{"-*-helvetica-medium-r-normal--*"},

{"-*-helvetica-bold-r-normal--*"},

{"-*-helvetica-medium-o-normal--*"},

{"-*-helvetica-bold-o-normal--*"},

{"-*-courier-medium-r-normal--*"},

{"-*-courier-bold-r-normal--*"},

{"-*-courier-medium-o-normal--*"},

{"-*-courier-bold-o-normal--*"},

{"-*-times-medium-r-normal--*"},

{"-*-times-bold-r-normal--*"},

{"-*-times-medium-i-normal--*"},

{"-*-times-bold-i-normal--*"},

{"-*-symbol-*"},

{"-*-lucidatypewriter-medium-r-normal-sans-*"},

{"-*-lucidatypewriter-bold-r-normal-sans-*"},

{"-*-*zapf dingbats-*"}


Maybe you can change this back in the first lines of src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx . Or you can install fonts by the names above. Or - I am not a linux guy - there surely is a way to do aliases.  Or you can of course load different fonts that exists on the system for the Fl_Font index 0 to 15 (and beyond).

For X devs: maybe it makes sense to try many fonts if the first name Is not found?

TwoTrees Innerworld

unread,
Apr 9, 2024, 6:59:32 PMApr 9
to fltk.general
I will dig into XFT tonight.

More info - I built two more test programs...
fonts.cxx - Runs, but all fonts are the same (miniature).
UTF8.cxx - Runs, fonts change size, but this font is very coarsely bitmapped.
Fullscreen.cxx - Won't compile, needs config.h. There are many versions of config.h, I don't know which one to use.
unitests.cxx - Won't compile, many errors.

Again, the old binary runs with the proper font types and sizes.
It was built with the same configuration in NetBeans.

Thanks for all your help. if you think of any more specific things for me to try, that would be much appreciated.

Thank you all!

- al

imm

unread,
Apr 9, 2024, 7:06:04 PMApr 9
to General FLTK
On Tue, 9 Apr 2024, 23:59 TwoTrees Innerworld  wrote:
I will dig into XFT tonight.

More info - I built two more test programs...
fonts.cxx - Runs, but all fonts are the same (miniature).
UTF8.cxx - Runs, fonts change size, but this font is very coarsely bitmapped.
Fullscreen.cxx - Won't compile, needs config.h. There are many versions of config.h, I don't know which one to use.
unitests.cxx - Won't compile, many errors.

Again, the old binary runs with the proper font types and sizes.
It was built with the same configuration in NetBeans.

Thanks for all your help. if you think of any more specific things for me to try, that would be much appreciated.

Ummm, how are you building fltk?

If you build fltk "the usual way" (see the readme's) then the test folder items should be built at the same time, ready to go...

You shouldn't have to build them separately, and that resolved the config.h issue too.

TwoTrees Innerworld

unread,
Apr 10, 2024, 1:41:32 AMApr 10
to fltk.general
Thanks for the info, I tried making them by typing 'make', like the readme said.
I get this errir:
Makefile:274: warning: ignoring prerequisites on suffix rule definition

I think that we have proven that FLTK is not finding the fonts it wants, and is dropping back to a default.

I'm just a bit daunted trying to understand the post by Matthias, this seems to make sense but I don't get the specifics.

What do you think I could try at this point?

Thanks!

- al

Matthias Melcher

unread,
Apr 10, 2024, 3:10:00 AMApr 10
to fltk.general
twotreesi...@gmail.com schrieb am Mittwoch, 10. April 2024 um 00:59:32 UTC+2:
UTF8.cxx - Runs, fonts change size, but this font is very coarsely bitmapped.

The UTF8  test shows the first 16 fonts with a predefined font name, followed by all the fonts that FLTK can find on the system. I think it's pretty clear now that the default fonts are simply not available on the Raspberry Pi, which is not too surprising, since Rui Linux is somewhat minimal, and so they may have wanted to save space by leaving out some fonts. Unfortunately they skipped exactly those fonts that FLTK needs to run.

So on the user side, as a quick fix, you can use https://www.fltk.org/doc-1.4/group__fl__attributes.html#ga15dee80a622a9ab2798acfdc0aabcd95 fl_set_font() to assign any of the fonts the test/UTF8 found to FL_HELVETICE, etc.

On the developer side, we should reintroduce the old (or simply more) font names as a fallback if the standard fonts are not found.

Matthias Melcher

unread,
Apr 10, 2024, 3:11:31 AMApr 10
to fltk.general
PS: sorry that the original message got so technical. I will set up my RPi and try to find a solution where you don;t have to do any extra work, and FLTK should "just run".

TwoTrees Innerworld

unread,
Apr 10, 2024, 3:25:42 AMApr 10
to fltk.general
Hi Everyone,

Once again, the old binary (built on 5-year-old Linux) runs fine, shows the proper fonts.
The new binary (built on the current Linux) shows the "miniature" fonts.
So, somehow, the fonts are available in the system, just not for the new build.
Apparently the new build doesn't find the fonts or somehow have access to them.

Is there a test I can do, or a build option to allow FLTK to find the font resource?

Thanks,

- al

Manolo

unread,
Apr 10, 2024, 4:04:17 AMApr 10
to fltk.general
A quick fix involving a patch to the FLTK code would be:
in file <FLTK source tree>/src/drivers/xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx, line #43
replace the present
#if 0
by
#if 1
This will make FLTK use the old font names.
Then rebuild FLTK and the app.

Manolo

unread,
Apr 10, 2024, 4:07:38 AMApr 10
to fltk.general

Sorry, there was an inversion in my previous post. here is the correct patch :

A quick fix involving a patch to the FLTK code would be:
in file <FLTK source tree>/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx, line #43
replace the present
#if 1
by
#if 0

Ian MacArthur

unread,
Apr 10, 2024, 4:28:49 AMApr 10
to fltk.general
On Wednesday 10 April 2024 at 08:25:42 UTC+1 twotreesi... wrote:
Hi Everyone,

Once again, the old binary (built on 5-year-old Linux) runs fine, shows the proper fonts.
The new binary (built on the current Linux) shows the "miniature" fonts.
So, somehow, the fonts are available in the system, just not for the new build.
Apparently the new build doesn't find the fonts or somehow have access to them.

Is there a test I can do, or a build option to allow FLTK to find the font resource?

OK, so we now know a few things:

1: The "old" binary (presumably built on a different machine) works fine - this tells us that the requisite fonts are present on the R.Pi. This is to be expected, the PiOS/Raspbian image is basically just debian. I've never had a problem with the R.Pi (of which I have many) - they always Just Worked.

2: The "new" binary, built on the R.Pi, does not find the fonts (even though we know from the prior test that they must be present.) This tells us that the newly built image has not included any of the font handling logic, which in turn very strongly implies the the required dev packages are not present, so at configure / build time all that functionality has been left out. 

This is probably not all that surprisingly (though it is very annoying) since recent debian style distros (notably Ubuntu, PiOs, etc.) have taken to only shipping the runtime parts and not the dev parts for most of the things. Presumably because it saves space and most users (except for software developers) have no need of the dev packages.

So... How are you building the fltk lib? (And note that I would always build my own, many of the distros are shipping ancient, broken and badly configured versions of fltk...) 

Also, are you building 1.3.x or 1.4.x?
FWIW it probably does not matter, but the README.Unix.txt in the 1.4 bundle is much more informative, so I like it better!

Anyway, as it says, get your R.Pi up, and install the following packages;


  sudo apt-get install g++
  sudo apt-get install gdb
  sudo apt-get install git
  sudo apt-get install make
  sudo apt-get install cmake     
  sudo apt-get install autoconf   
  sudo apt-get install libx11-dev
  sudo apt-get install libglu1-mesa-dev
  sudo apt-get install libxft-dev
  sudo apt-get install libxcursor-dev

# These packages are optional but recommended:

  sudo apt-get install libasound2-dev
  sudo apt-get install freeglut3-dev
  sudo apt-get install libcairo2-dev
  sudo apt-get install libfontconfig1-dev
  sudo apt-get install libglew-dev
  sudo apt-get install libjpeg-dev
  sudo apt-get install libpng-dev
  sudo apt-get install libpango1.0-dev
  sudo apt-get install libxinerama-dev


If you want Wayland support (fltk-1.4 only, not 1.3) there are a few more packages you need. See README.Wayland.txt if needed.

Once you have the dev packages, unpack a clean copy of the fltk-1.3 tarball, cd into the directory, and do the   

     ./configure
    make -j4

dance in the usual way.

That should build the fltk libs, fluid, and the samples form the "test" folder.

Check that the "test" samples are working. If they are, then your code should work too.
Job Done.

Albrecht Schlosser

unread,
Apr 10, 2024, 9:19:45 AMApr 10
to fltkg...@googlegroups.com
On 4/10/24 09:18 TwoTrees Innerworld wrote:
... the old binary (built on 5-year-old Linux) runs fine, shows the proper fonts.
The new binary (built on the current Linux) shows the "miniature" fonts.
So, somehow, the fonts are available in the system, just not for the new build.
Apparently the new build doesn't find the fonts or somehow have access to them.

Is there a test I can do, or a build option to allow FLTK to find the font resource?

I second everything Ian posted in his recent reply, please read this first and follow his instructions to install the prerequisites.

The "simple" instructions below should get you going, but if you'd like to use CMake to build FLTK and your own application(s) please see advice at the end of this post. Note that it's important to build *and* test FLTK (i.e. try the provided test and demo programs) before you start building your own projects. I suggest the following approach:

Download a new snapshot of FLTK 1.4 (recommended) or the latest release tarball (currently 1.3.9) from the FLTK website, expand it, `cd` to the just expanded FLTK root dir, and then execute:

$ ./configure

This runs the configure script with all default options. Please save the output somewhere so you can post it if the build doesn't work. Now continue with:

$ make [-jN]

This builds FLTK with all default test and demo programs in the 'test' folder. Commandline switch '-jN' (w/o []) is optional and uses a parallel build. Replace 'N' with the number of CPU cores you want to use. If the build breaks with error messages, please post the error messages. If there are some warnings, please ignore them for now.

Then type:

$ cd test
$ ./demo


This runs the main `demo` GUI program with a menu (3x3 buttons) you can use to run all test programs. Alternatively you can run any of the test programs directly, e.g. test/editor, test/unittests, etc..

If this all works as expected you're ready to try your own projects. Congratulation!

However: If this still doesn't work as expected, please post the configure log you saved in the beginning (see above). This should give us a clue what's going awry. My suspicion is that you missed Xft dev files and more in your previous attempts (as Ian wrote in his post), but after installing all prerequisites it should work well.

Side note: we recommend using CMake for building FLTK 1.4 but it should also work well for 1.3.9. If you followed Ian's instructions you did already install CMake. Then read the file README.CMake.txt for instructions on how to build FLTK with CMake and how to use CMake to build your own projects that use FLTK.


TwoTrees Innerworld

unread,
Apr 14, 2024, 4:23:58 AMApr 14
to fltk.general
Hello Everyone,

First of all, Thank You to all who have responded with excellent help messages.
I appreciate your knowledge and insight more than words can say.
That being said, I still have no joy.
I have tried everything that all of you have suggested.
I rebuilt FLTK 1.3.9 as suggested, along with installing and updating all the requisite utilities.
My application still builds with no errors, but without the proper font sizes.

It is interesting to note that the demo program (in the test directory) runs, but has similar problems.
The font test doesn't change fonts when different ones are selected.
Only when I scroll down to "common" can I get the fonts to change size.

What can I try now?

Thanks!

- al

Albrecht Schlosser

unread,
Apr 14, 2024, 8:05:02 AMApr 14
to fltkg...@googlegroups.com
On 4/14/24 10:23 TwoTrees Innerworld wrote:
Hello Everyone,

First of all, Thank You to all who have responded with excellent help messages.
I appreciate your knowledge and insight more than words can say.
That being said, I still have no joy.

I'm sad to read that.


I have tried everything that all of you have suggested.

Did you also try FLTK 1.4.0?


I rebuilt FLTK 1.3.9 as suggested, along with installing and updating all the requisite utilities.
My application still builds with no errors, but without the proper font sizes.

It is interesting to note that the demo program (in the test directory) runs, but has similar problems.
The font test doesn't change fonts when different ones are selected.
Only when I scroll down to "common" can I get the fonts to change size.

There are two font test programs (test/fonts and test/utf8), which one do you mean? And what is "common", I don't see this in my version of the demo program (neither in 1.3.9 nor in 1.4.0).


What can I try now?

I asked you to save and post the configure log if the program doesn't work as intended. Please post it as an attachment (or inline, if necessary) so we can see it. If you used CMake, then please post the CMake log instead. Without such a log we can't help you further.

If you didn't try 1.4.0 yet, please do so now. Save the configure or CMake log and post it here.

Please tell us more about your OS, which Linux version (`uname -a`), which desktop environment (Gnome, KDE, xfce, ...) and everything that may be of interest about your environment. I read that you're using "a new Rpi 3". There are several OS choices for Rpi, which one are you using?

You also wrote: "The display is a local 5" 640 x 480 HDMI touch screen with capacitive touch via USB.". Although this should work, it's a tiny display with a very low resolution. I don't have a similar screen to test.

On Wednesday, April 10, 2024 at 8:19:45 AM UTC-5 Albrecht-S wrote:
[...]

Download a new snapshot of FLTK 1.4 (recommended) or the latest release tarball (currently 1.3.9) from the FLTK website, expand it, `cd` to the just expanded FLTK root dir, and then execute:

$ ./configure

This runs the configure script with all default options. Please save the output somewhere so you can post it if the build doesn't work.

Please see above. What I meant was of course, if the build doesn't work or the programs don't work as expected.

Albrecht Schlosser

unread,
Apr 14, 2024, 8:10:47 AMApr 14
to fltkg...@googlegroups.com
On 4/14/24 14:04 'Albrecht Schlosser' via fltk.general wrote:
> Please tell us more about your OS, which Linux version (`uname -a`),
> which desktop environment (Gnome, KDE, xfce, ...) and everything that
> may be of interest about your environment. I read that you're using "a
> new Rpi 3". There are several OS choices for Rpi, which one are you using?

I forgot to mention: `inxi` is a very helpful tool. On Debian based
systems you can install it with `sudo apt install inxi` if you don't
have it already. If your OS is not Debian (or Ubuntu) based, please use
the package manager of your OS to install it.

Please post the output of `inxi -SF` so we can see more about your OS
environment.

TwoTrees Innerworld

unread,
Apr 14, 2024, 11:23:08 PMApr 14
to fltk.general
I will try 1.4.0 tonight.
Meanwhile, here are the answers you asked for...


No desktop environment, command line only.
Other info follows...

 uname -a
Linux raspberrypi 6.1.21-v7+ #1642 SMP Mon Apr  3 17:20:52 BST 2023 armv7l GNU/Linux

 inxi -SF
System:    Host: raspberrypi Kernel: 6.1.21-v7+ armv7l bits: 32 Console: tty 2
           Distro: Raspbian GNU/Linux 11 (bullseye)
Machine:   Type: ARM Device System: Raspberry Pi 3 Model B Plus Rev 1.4 details: BCM2835 rev: a020d4
           serial: 00000000e126b01c
CPU:       Info: Quad Core model: ARMv7 v7l variant: cortex-a53 bits: 32 type: MCP
           Speed: 1400 MHz min/max: 600/1400 MHz Core speeds (MHz): 1: 1400 2: 1400 3: 1400 4: 1400
Graphics:  Device-1: bcm2835-hdmi driver: vc4_hdmi v: N/A
           Device-2: bcm2835-vc4 driver: vc4_drm v: N/A
           Display: server: X.org 1.20.11 driver: loaded: modesetting unloaded: fbdev tty: 112x24
           Message: Advanced graphics data unavailable in console. Try -G --display
Audio:     Device-1: bcm2835-hdmi driver: vc4_hdmi
           Sound Server: ALSA v: k6.1.21-v7+
Network:   Device-1: Microchip (formerly SMSC) type: USB driver: lan78xx
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: b8:27:eb:26:b0:1c
           IF-ID-1: wlan0 state: down mac: b8:27:eb:73:e5:49
Drives:    Local Storage: total: 7.44 GiB used: 2.02 GiB (27.1%)
           ID-1: /dev/mmcblk0 model: SD16G size: 7.44 GiB
Partition: ID-1: / size: 7.04 GiB used: 1.97 GiB (27.9%) fs: ext4 dev: /dev/mmcblk0p2
           ID-2: /boot size: 255 MiB used: 50.4 MiB (19.8%) fs: vfat dev: /dev/mmcblk0p1
Swap:      ID-1: swap-1 type: file size: 100 MiB used: 0 KiB (0.0%) file: /var/swap
Sensors:   System Temperatures: cpu: 45.1 C mobo: N/A
           Fan Speeds (RPM): N/A
Info:      Processes: 144 Uptime: 2d 20h 45m Memory: 998 MiB used: 260.4 MiB (26.1%) gpu: 76 MiB
           Init: systemd Shell: Bash inxi: 3.3.01

Thanks!

- al

TwoTrees Innerworld

unread,
Apr 14, 2024, 11:25:44 PMApr 14
to fltk.general
Here is the config.log for 1.3.9...
config1.3.9.log

TwoTrees Innerworld

unread,
Apr 15, 2024, 2:13:57 AMApr 15
to fltk.general
I installed 1.4.x without issue but still no joy.
The fonts demo does not change when I select different fonts.
The log file is attached.

Thanks!

- al
config1.4.x.log

Albrecht Schlosser

unread,
Apr 15, 2024, 8:25:08 AMApr 15
to fltkg...@googlegroups.com
On 4/15/24 08:13 TwoTrees Innerworld wrote:
I installed 1.4.x without issue but still no joy.
The fonts demo does not change when I select different fonts.
The log file is attached.

Sorry, this is not what I meant - although it may contain all info, but it's way too verbose to be helpful.

What I would like to see is the output of your configure run which displays human readable search and configure results.

Please run these commands in the root of your FLTK 1.4 download:

make distclean
autoconf
./configure 2>&1 | tee fltk-1.4-configure.txt

Then post `fltk-1.4-configure.txt` which will contain the entire output you saw on your display. TIA.

To verify: near the end of the configure run (and fltk-1.4-configure.txt) you should see a summary like the following, but this is not the entire info I would like to see, it's just FYI.

Configuration Summary
-------------------------------------------------------------------------
    Directories: prefix=/usr/local
                 bindir=${exec_prefix}/bin
                 datadir=${datarootdir}
                 datarootdir=${prefix}/share
                 exec_prefix=${prefix}
                 includedir=${prefix}/include
                 libdir=${exec_prefix}/lib
                 mandir=${datarootdir}/man
    Build fluid: YES
    Build tests: YES
Cross-compiling: NO
       Graphics: Wayland or X11 with cairo + Xfixes + Xinerama + Xcursor + Xrender + Pango
Image Libraries: JPEG=System
                 PNG=System
                 ZLIB=System
Forms library:   YES
    Large Files: YES
         OpenGL: YES
        Threads: YES
   Allow std:: : NO
...

Meanwhile I'm looking into your `inxi` output and I'm going to test on my own RPi 3...

Albrecht Schlosser

unread,
Apr 15, 2024, 9:29:25 AMApr 15
to fltkg...@googlegroups.com
On 4/15/24 14:25 'Albrecht Schlosser' wrote:
On 4/15/24 08:13 TwoTrees Innerworld wrote:
I installed 1.4.x without issue but still no joy.
The fonts demo does not change when I select different fonts.
The log file is attached.

Sorry, this is not what I meant - although it may contain all info, but it's way too verbose to be helpful.

Meanwhile I found at least one important info in your log:
configure:8835: result: no
configure:8835: checking for X11/Xft/Xft.h
configure:8835: result: no
configure:8893: WARNING: could not find the required Xft headers and/or libraries.
configure:8895: please install Xft headers and libraries or use 'configure --disable-xft'.
configure:9146: checking for X11/extensions/Xfixes.h
configure:9146: gcc -c -I/usr/include/freetype2 -I/usr/include/libpng16   -I/usr/include/freetype2 -I/usr/include/libpng16  conftest.c >&5
conftest.c:57:10: fatal error: X11/extensions/Xfixes.h: No such file or directory
   57 | #include <X11/extensions/Xfixes.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

This means that you did NOT (successfully) install all prerequisites, at least Xft is missing. We would have seen this in the original configure output because it would have issued this message:

WARNING: could not find the required Xft headers and/or libraries.
please install Xft headers and libraries or use 'configure --disable-xft'.

Having Xft development headers (and libs) installed is essential for correct font handling!

Maybe you missed updating your apt sources, or something else went awry when you tried to install the prerequisites as you told us.

Please run the following commands to correct this. Take care if there are any obvious error messages (except progress output):

sudo apt-get update # this is important before you install anything!

Then install (or reinstall) everything that's listed in README.Unix.txt, except maybe (a) git and (b) cmake which are optional if you (a) use a downloaded tarball/snapshot and (b) use configure/make rather than CMake to build - as I wrote in my basic instructions earlier:
sudo apt-get install g++
sudo apt-get install gdb
sudo apt-get install git        # OPTIONAL: to download FLTK from Git
sudo apt-get install make
sudo apt-get install cmake      # OPTIONAL: install CMake...
sudo apt-get install autoconf   # ...or autoconf (or both)
sudo apt-get install libx11-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libxft-dev
sudo apt-get install libxcursor-dev

Please check that there are no error messages. If you are not sure, please capture the output in a text file and post it here.

After that, please rerun autoconf, ./configure and build (make), save the output, post it here, etc..

Hopefully this will enable correct font handling.

FYI: I tested on my own RPi 3 with a much older Raspbian version successfully:
$ cat /etc/issue.net; uname -a; g++ --version
Raspbian GNU/Linux 10
Linux raspi3 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux
g++ (Raspbian 8.3.0-6+rpi1) 8.3.0


TwoTrees Innerworld

unread,
Apr 15, 2024, 11:52:16 PMApr 15
to fltk.general
Hi Everyone,

OK, partial joy.
I installed all the updates and fltk-1.4.x
The test program runs and displays fonts correctly and with different point sizes.
The new problem is that now my Netbeans project won't successfully build anymore.
The modules seem to compile fine, but I get a ton of what I believe are linker errors.

It starts like this...
g++ -I/usr/local/include -L/usr/local/lib -lwiringPi    -o dist/Debug/GNU-Linux/fltk build/Debug/GNU-Linux/a_to_d.o build/Debug/GNU-Linux/distance.o build/Debug/GNU-Linux/getdisljump.o build/Debug/GNU-Linux/getdisnew.o build/Debug/GNU-Linux/kbhit.o build/Debug/GNU-Linux/main.o build/Debug/GNU-Linux/menu.o build/Debug/GNU-Linux/parallel.o build/Debug/GNU-Linux/serial.o -L/usr/local/lib -Wl,-rpath,'/usr/local/lib' -lfltk -lfltk_forms -lfltk_images -lpthread -ldl -lm -lX11 -lwiringPi -lXext -lstdc++
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl_Xlib_Graphics_Driver_font_xft.o): in function `utf8extents(Fl_Xlib_Font_Descriptor*, char const*, int, _XGlyphInfo*)':
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZL11utf8extentsP23Fl_Xlib_Font_DescriptorPKciP11_XGlyphInfo+0x48): undefined reference to `XftTextExtents32'
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl_Xlib_Graphics_Driver_font_xft.o): in function `Fl_Xlib_Graphics_Driver::set_fonts(char const*)':
Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x1c): undefined reference to `FcInit'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x2c): undefined reference to `FcPatternCreate'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x40): undefined reference to `FcObjectSetBuild'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x54): undefined reference to `FcFontList'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x60): undefined reference to `FcPatternDestroy'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x68): undefined reference to `FcObjectSetDestroy'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x9c): undefined reference to `FcNameUnparse'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x134): undefined reference to `FcFontSetDestroy'
/usr/bin/ld: /usr/local/lib/libfltk.a(Fl_Xlib_Graphics_Driver_font_xft.o): in function `Fl_Xlib_Font_Descriptor::Fl_Xlib_Font_Descriptor(char const*, int, int)':

Do you know what happened? Did something move?

Thanks again for all the help!

- al

Mohammed

unread,
Apr 16, 2024, 3:43:23 AMApr 16
to fltkg...@googlegroups.com
It seems to missing libfontconfig symbols. You might try adding -lfontconfig to your build invocation. 

Sent from my iPhone

On 16 Apr 2024, at 06:52, TwoTrees Innerworld <twotreesi...@gmail.com> wrote:


--
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 fltkgeneral...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/5625637f-b188-4fde-a13a-38b1de3ee3dcn%40googlegroups.com.

Albrecht Schlosser

unread,
Apr 16, 2024, 7:19:16 AMApr 16
to fltkg...@googlegroups.com
On 4/16/24 05:52 TwoTrees Innerworld wrote:
OK, partial joy.
I installed all the updates and fltk-1.4.x
The test program runs and displays fonts correctly and with different point sizes.

Good, you made progress.


The new problem is that now my Netbeans project won't successfully build anymore.
The modules seem to compile fine, but I get a ton of what I believe are linker errors.

It starts like this...
g++ -I/usr/local/include -L/usr/local/lib -lwiringPi    -o dist/Debug/GNU-Linux/fltk build/Debug/GNU-Linux/a_to_d.o build/Debug/GNU-Linux/distance.o build/Debug/GNU-Linux/getdisljump.o build/Debug/GNU-Linux/getdisnew.o build/Debug/GNU-Linux/kbhit.o build/Debug/GNU-Linux/main.o build/Debug/GNU-Linux/menu.o build/Debug/GNU-Linux/parallel.o build/Debug/GNU-Linux/serial.o -L/usr/local/lib -Wl,-rpath,'/usr/local/lib' -lfltk -lfltk_forms -lfltk_images -lpthread -ldl -lm -lX11 -lwiringPi -lXext -lstdc++

Note: above is your buld /linker commandline. You are obviously linking in three FLTK libs: '-lfltk -lfltk_forms -lfltk_images'. See below...

[...]

Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x1c): undefined reference to `FcInit'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x2c): undefined reference to `FcPatternCreate'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x40): undefined reference to `FcObjectSetBuild'
/usr/bin/ld: Fl_Xlib_Graphics_Driver_font_xft.cxx:(.text._ZN23Fl_Xlib_Graphics_Driver9set_fontsEPKc+0x54): undefined reference to `FcFontList'
[...]

The lines above show undefined references, i.e. a missing library.
As Mohammed wrote: you need to add the fontconfig library to your linker commandline or any linker options in netbeans. Either the full string "-lfontconfig" or only the library name 'fontconfig' - wherever you added the FLTK libs and maybe other libs in Netbeans. I don't know where this may be, something like linker options or additional link libraries etc.


Do you know what happened? Did something move?

Not sure, we need some more info.

Most important: did you run `sudo make install` after your FLTK build completed? The default would be to *install* the built libraries and header files in '/usr/local' where your Netbeans project expects them: '-I/usr/local/include -L/usr/local/lib' etc.. If you did not, then please do it now - otherwise your Netbeans project would have to be changed to refer to the FLTK build directory which is possible but more complicated for now. If you did run `sudo make install` then you can skip this.

Next step: adding the fontconfig library to your build command may or may not resolve all issues, there may well be more libs required. If it works you're done, if not, continue:

That's what `fltk-config` is good for: a "simple" approach is to build a working FLTK  test program with fltk-config, like this:

$ flltk-config --use-images --use-forms --compile /path/to/fltk/test/hello.cxx

Replace /path/to/fltk with the path to your FLTK source files. Note that I added '--use-images --use-forms' so you link with the same FLTK libs as your Netbeans project.

This command outputs the full compile and linker command to build the hello demo. Look for any libs that are missing from your Netbeans linker command, and add them as well, maybe step by step, until your build works.

Another - shorter - command would have been:

$ flltk-config --use-images --use-forms --ldstaticflags

which outputs only the required linker flags. On my Raspi I get, for instance (but please use your output!):

-lfltk_images -lpng -lz -lfltk_jpeg -lfltk_forms -lfltk -lXrender -lXft -lfontconfig -pthread -lpthread -ldl -lm -lX11

Once you added all required libs to your Netbeans project this should work as well.


Thanks again for all the help!

You're welcome.

pvrose

unread,
Apr 16, 2024, 8:02:58 AMApr 16
to fltkg...@googlegroups.com

What I found useful was to add

`fltk-config --use-images --ldstaticflags`

as part of my build command using an archaic makefile flow.

Phil.

Albrecht Schlosser

unread,
Apr 16, 2024, 11:08:41 AMApr 16
to fltkg...@googlegroups.com
On 4/16/24 14:02 'pvrose' via fltk.general wrote:

What I found useful was to add

`fltk-config --use-images --ldstaticflags`

as part of my build command using an archaic makefile flow.


Yup, that's AFAICT the main motivation to create fltk-config in the first place.

TwoTrees Innerworld

unread,
Apr 17, 2024, 2:17:23 AMApr 17
to fltk.general
Gentlemen -

We have JOY!
Using fltk-config --use-images --use-forms --ldstaticflags
to get the proper linker options and adding them to my linker control file,
I now have a successful build and correct font displays!

I don't understand why this changed, i.e. why the additional options were necessary
after installing the support packages, when I had a successful build before.

Anyway, it is running now and I am OVERJOYED!

Thank you all for all your help and patience in helping me to get this running again.

You all are awesome...

- al

Albrecht Schlosser

unread,
Apr 17, 2024, 8:54:47 AMApr 17
to fltkg...@googlegroups.com
On 4/17/24 08:17 TwoTrees Innerworld wrote:
We have JOY!
Using fltk-config --use-images --use-forms --ldstaticflags
to get the proper linker options and adding them to my linker control file,
I now have a successful build and correct font displays!

Great, I'm glad that we could help. Thanks for the confirmation.


I don't understand why this changed, i.e. why the additional options were necessary
after installing the support packages, when I had a successful build before.

That's because your previous build did not include some libraries since configure didn't find the headers and/or libs on your system. In the old days (FLTK 1.1.x) FLTK worked entirely w/o Xft and had only - much simplified - fixed size raster fonts. Xft enabled the usage of scalable fonts and more. After you added the required header files (-dev packages) to your system FLTK found these and linked with some more libraries, for instance fontconfig. That's why your project required these libs as well.


Anyway, it is running now and I am OVERJOYED!

Thank you all for all your help and patience in helping me to get this running again.

You're welcome.

You all are awesome...

- al

On Tuesday, April 16, 2024 at 10:08:41 AM UTC-5 Albrecht-S wrote:
On 4/16/24 14:02 'pvrose' via fltk.general wrote:

What I found useful was to add

`fltk-config --use-images --ldstaticflags`

as part of my build command using an archaic makefile flow.


Yup, that's AFAICT the main motivation to create fltk-config in the first place.

--
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 fltkgeneral...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages