JuliaGraphics / Gtk.jl

Julia interface to Gtk windowing toolkit.
Other
287 stars 80 forks source link

Fontconfig issue #507

Open tknopp opened 4 years ago

tknopp commented 4 years ago

I get the following warnings:

Fontconfig warning: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf

and the fonts are looking strange: Bildschirmfoto vom 2020-05-07 11-15-58

This is a Winston / Cairo plot inside Gtk. Have not yet checked if this is a Cairo issue alone. What is clear is that this is due to the new BB infrastructure, so I therefore ping @giordano.

giordano commented 4 years ago

Might it be related to https://github.com/JuliaGraphics/Cairo.jl/issues/312? I'd like to fix it, but I still don't understand what's exactly the problem, so help in debugging would be great

tknopp commented 4 years ago

Not sure, at this point I wanted to leave a breadcrumb here, since I am in the lab and observed this with our Gtk-based measurement device. I will try generating a reduced example when I find time.

giordano commented 4 years ago

Yes, please, a simple MWE would be great

lobingera commented 4 years ago

One idicator. If if add Fontconfig_jll and execute in shell mode

shell> /home/lobi/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/bin/fc-list
Fontconfig error: Cannot load default config file
/usr/share/fonts/truetype/tlwg/TlwgTypo-Bold.ttf: Tlwg Typo:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/X11/misc/clR6x6.pcf.gz: Clean:style=Regular
...

Could this just be a version mismatch between the config file and fontconfig?

giordano commented 4 years ago

In Cairo.jl we're setting ENV["FONTCONFIG_FILE"] to fix exactly this problem I think?

lobingera commented 4 years ago

That's where i lost track, because fontconfig has very inventive ways to gather information.

giordano commented 4 years ago

@tknopp can you check that the file /home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/etc/fonts/fonts.conf is actually there? It looks to me that the setting of FONTCONFIG_FILE is working correctly, but the file can't be found? :confused:

tknopp commented 4 years ago
labuser@labuser-Default-string:~$ ls /home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/etc/fonts/fonts.conf
/home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/etc/fonts/fonts.conf

So the file is there.

giordano commented 4 years ago

Then I don't understand the message

Fontconfig error: Cannot load config file from /home/labuser/.julia/artifacts/82f1062ef35feaa6d4cc426c15574338f12f5fd1/lib/../etc/fonts/fonts.conf

:confused:

giordano commented 4 years ago

Can you see whether the answers in https://askubuntu.com/q/492033/211014 help? Also, can you compare that config file with your system one? If I remember correctly, that's identical to the one on my machine.

tknopp commented 4 years ago

I am currently only irregularly at the machine, where this happens but one thing I tried yesterday was to only use Winston, which worked ok. One issue might be that I also use GR in the program, which might change the fontconfig path. I will remove the usage of GR when I am at the computer next time and check if that resolves the problem.

lobingera commented 4 years ago

News on that?

tknopp commented 4 years ago

Not really, did you see similar issues?

lobingera commented 4 years ago

This is unchanged. I just wondered, if we get another data point from " I will remove the usage of GR when I am at the computer next time and check if that resolves the problem."

I'm 99% sure, that the forced setting of ENV["FONTCONFIG_PATH"] in Cairo.jl isn't really helpful...

giordano commented 4 years ago

@tknopp can you please update your packages? You should get Fontconfig_jll v2.13.1+12. With this version https://github.com/JuliaGraphics/Cairo.jl/issues/312 is fixed for me