fontdb icon indicating copy to clipboard operation
fontdb copied to clipboard

Support automatic determination of default family names on Linux from fontconfig

Open tronical opened this issue 2 years ago • 13 comments

I hope that this is to some extent in scope of fontdb, feel free to close otherwise.

The default families in fontdb are coded to Arial, etc. as documented. It would be nice if fontdb, when the fontconfig feature is enabled, would read and interpret the settings from fontconfig to determine the fonts that alias "Sans Serif, "Serif", "Cursive", etc.

tronical avatar Apr 06 '22 13:04 tronical

For context, this would allow Slint to get rid of fontconfig bindings to build without linking any C libraries besides xcb if using the X11 backend (Slint's Wayland backend dlopens the required C libraries).

Be-ing avatar Apr 06 '22 13:04 Be-ing

@Riey does fontconfig-parser supports generic font families query?

RazrFalcon avatar Apr 06 '22 14:04 RazrFalcon

@RazrFalcon No, it doesn't have any query functions only parsing.

Riey avatar Apr 06 '22 14:04 Riey

rust-fontconfig has a query function.

Be-ing avatar Apr 06 '22 14:04 Be-ing

It's a very heavy dependency.

RazrFalcon avatar Apr 06 '22 15:04 RazrFalcon

rust-fontconfig has a query function.

That's not fontconfig query only read dir tag to get font files more like current fontdb's behavior(and even ignore include tag which is for nested config files).

What you want should evaluate whole match and alias tags.

Riey avatar Apr 06 '22 15:04 Riey

This one should be improved, but not perfect. Someone has to write a complete fontconfig parser first.

RazrFalcon avatar Dec 25 '22 12:12 RazrFalcon