[Fontconfig] How to identify all the fonts an application specifies?

Kynn Jones kynnjo at gmail.com
Sun Mar 27 23:18:56 UTC 2016

Hi everyone!

As I understand it, `fontconfig` basically provides a mechanism
whereby an application can discover, among the fonts installed in the
system, those fonts that most closely match the applications font

I imagine that, given some hypothetical application `Foo`, for each
font that `Foo` wants to use, there is some interaction with
`fontconfig` in which `Foo`'s original specification for a font gets
resolved into a concrete font that is actually available in the
current system.

Assuming this picture is more or less correct, I'm looking for a
convenient way to get a listing of all the font specifications that
`Foo` "submits" to `fontconfig` for resolution.

I know about running `Foo` with the variable `FC_DEBUG` set to some
suitable value, but (1) I don't know the most suitable value to get
the information I am after, and (2) (very important!!!), I don't know
how to extract the desired information from the *deluge* of debugging
information that results when `FC_DEBUG` is set to a non-zero value.

To word my question differently, is there some values of `X` and `Y` such that

    FC_DEBUG=X Foo | Y > Foo_font_specs &

will save in `Foo_font_specs` all the font specifications submitted by
`Foo` to `fontconfig` for resolution?

I want the information in a form that I can use to craft rules for my
`fonts.conf` file.  In particular, I want to write rules that make
exceptions to the policies specified in my current `fonts.conf`, and I
want to make these exceptions as narrowly targeted as possible.

Thanks in advance!


More information about the Fontconfig mailing list