Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fontconfig not finding fonts under /mingwXX/share/fonts #5762

Open
brisingraerowing opened this issue Sep 3, 2019 · 14 comments
Open

Fontconfig not finding fonts under /mingwXX/share/fonts #5762

brisingraerowing opened this issue Sep 3, 2019 · 14 comments

Comments

@brisingraerowing
Copy link
Contributor

I've added a few fonts to the mentioned directory (in subdirectories, like with the Adobe Source Code Pro package), and even after running fc-cache -rs, the fonts don't show up in any app I've tried (Inkscape, Gimp and Geany so far, all from official MSYS2 packages). Even the source code pro fonts don't show up. I tested putting fonts directly under the fonts directory, and that didn't work either.

@brisingraerowing
Copy link
Contributor Author

This is possibly fixable by using the 'use_fontconfig' meson option Pango has, as that seems to be the root of the issue. I'll test this with a custom build in a moment.

@brisingraerowing
Copy link
Contributor Author

It seems this requires a newer Pango version.

@liZe
Copy link

liZe commented Apr 6, 2020

For example, Fontconfig doesn’t find fonts installed by the mingw-w64-x86_64-ttf-dejavu package. That’s strange, because the dejavu package calls fc-cache, so we can imagine that it used to work.

@brisingraerowing
Copy link
Contributor Author

Yes. By default Pango uses the Windows font system. It can be forced to use Fontconfig in code, and newer versions allow forcing Fontconfig by default. The version used in Msys2 does not support that, though.

@liZe
Copy link

liZe commented Apr 6, 2020

Yes. By default Pango uses the Windows font system. It can be forced to use Fontconfig in code, and newer versions allow forcing Fontconfig by default. The version used in Msys2 does not support that, though.

I’ve made Pango use Fontconfig with Msys2, and it works well 😄.

The only problem I have is that the DejaVu fonts from the package are installed in a folder that’s not scanned by Fontconfig (they’re in mingwXX/share/fonts). Copying the fonts into ~/.fonts for example fixes the problem. I suppose that adding the folder to the Fontconfig configuration file would work too.

@brisingraerowing
Copy link
Contributor Author

How?

@liZe
Copy link

liZe commented Apr 7, 2020

How?

You can look at how it’s done in WeasyPrint. It basically uses a simple Python binding, the same C code should work as well.

This code works well with Msys2 as we use it for WeasyPrint’s CI (some tests rely on Fontconfig).

@podsvirov
Copy link
Collaborator

I confirm. I also noticed this behavior when creating #6381.

@lazka
Copy link
Member

lazka commented Aug 21, 2020

Maybe related to #6661

@lazka
Copy link
Member

lazka commented Aug 25, 2020

Can anyone test again with the latest packages?

@lazka lazka added the needinfo label Aug 25, 2020
liZe added a commit to grewn0uille/WeasyPrint that referenced this issue Aug 25, 2020
@liZe
Copy link

liZe commented Aug 25, 2020

Can anyone test again with the latest packages?

It doesn’t work for me.

@liZe
Copy link

liZe commented Aug 25, 2020

Maybe related to #6661

It’s strange, because it really looks like the same bug. But even with mingw-w64-x86_64-fontconfig-2.13.92-2 my fresh fontconfig installation doesn’t find fonts installed by mingw-w64-x86_64-ttf-dejavu if they’re not copied into ~/.fonts.

@lazka lazka removed the needinfo label Aug 25, 2020
@naveen521kk
Copy link
Member

does #7230 (comment) help?

@liZe
Copy link

liZe commented Jan 1, 2021

does #7230 (comment) help?

It doesn’t help because I force Pango to use Fontconfig, even on Windows.

Adding the fonts to ~/.fonts (which is a default Fontconfig path) works, meaning that Fontconfig is used and works, but for some reason doesn’t look into /mingwXX/share/fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants