More findings:
I ran Qt's textedit demo with strace, first when leaving LD_LIBRARY_PATH unmodified (so Qt libs in /usr/lib will be used), then when setting LD_LIBRARY_PATH to . to use my own Qt libs. Here are the results:
By diff'ing the two files, I found out that when LD_LIBRARY_PATH is not set (so Qt libs in /usr/lib are used) fonts are loaded:
access("/etc/fonts/fonts.conf", R_OK) = 0
stat("/etc/fonts/fonts.conf", {st_mode=S_IFREG|0644, st_size=5287, ...}) = 0
open("/etc/fonts/fonts.conf", O_RDONLY) = 7
read(7, "<?xml version=\"1.0\"?>\n<!DOCTYPE "..., 8192) = 5287
access("/etc/fonts/conf.d", R_OK) = 0
stat("/etc/fonts/conf.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/fonts/conf.d", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 8
fcntl(8, F_GETFD) = 0x1 (flags FD_CLOEXEC)
brk(0x1929000) = 0x1929000
getdents(8, /* 38 entries */, 32768) = 1632
getdents(8, /* 0 entries */, 32768) = 0
access("/etc/fonts/conf.d/10-antialias.conf", R_OK) = 0
stat("/etc/fonts/conf.d/10-antialias.conf", {st_mode=S_IFREG|0644, st_size=223, ...}) = 0
open("/etc/fonts/conf.d/10-antialias.conf", O_RDONLY) = 9
read(9, "<?xml version=\"1.0\"?>\n<!DOCTYPE "..., 8192) = 223
read(9, "", 8192) = 0
close(9) = 0
access("/etc/fonts/conf.d/10-hinting-slight.conf", R_OK) = 0
When LD_LIBRARY_PATH is set, fonts don't seem to be loaded.
From the same strace logs, it appears that fonts are loaded when LD_LIBRARY_PATH is left unset because the library /usr/lib/libfontconfig.so.1 is loaded. When LD_LIBRARY_PATH is set, libfontconfig.so.1 is never loaded.
Cheers,
Franz
Added after 5 minutes:
Could the root cause of my troubles be that when I built Qt 4.7.2 from sources on my 64-bit Ubuntu 10.10 system, configure didn't find fontconfig?
Cheers,
Franz
Bookmarks