Smithay / andrew

Convenient drawing of objects such as shapes, lines and text to buffers
MIT License
17 stars 8 forks source link

get_regular_family_fonts("sans") fails to find any font in a flatpak #8

Open JMS55 opened 3 years ago

JMS55 commented 3 years ago

See https://github.com/Smithay/client-toolkit/issues/170#issuecomment-754922916

JMS55 commented 3 years ago

It appears that andrew::text::fontconfig::FontConfig::get_font_dir_files() fails to find any files called fonts.dir. I don't know enough about fontconfig to tell if andrew should be using something else, or if flatpak needs to have that file.

r-c-f commented 3 years ago

@JMS55 fonts.dir is the output from mkfontfdir that indexes fonts by the old X logical font descriptors, so if you include that as part of your packaging process it should work. The fact that andrew is using XLFDs instead of fontconfig proper is indeed highly suspect, however.

ArtemGr commented 3 years ago

Per https://www.x.org/archive/X11R7.0/doc/html/fonts2.html, "Installing scalable fonts", I'm doing

cd /usr/share/fonts/truetype/dejavu && sudo mkfontscale && sudo mkfontdir
cd /usr/share/fonts/truetype/freefont && sudo mkfontscale && sudo mkfontdir

Just my two cents.