Re: How to use FcFontMatch to find a font with a given character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Fri, 29 Jun 2018 18:12:40 +0800, Elias Mårtenson wrote:

> When I use FcMatchPattern, the program returns DejaVuSans.ttf. If I
> use FcMatchFont instead, it returns FreeMono.ttf.
> The interesting thing is that none of these fonts actually contains
> U+0x63A (checked by reading the "charset" value).

I’m not sure what the difference is, but I gather that Fontconfig never
fails to return a font, as long as it can find at least one on your
system. Remember that Fontconfig is all about “best effort” to match
what you require, rather than “perfect match”. I think FcMatchPattern is
the right one to use. You can then scan the list of candidates returned,
querying their actual “charset” properties to see which one(s) are
sufficient for your needs.

I include an example of this in the readme for my Python wrapper for
Fontconfig <>.

By the way, just checked DejaVu Sans on my system, and it does indeed
Fontconfig mailing list

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux