[Fontconfig] How to ignore OpenType Collection fonts

Masamichi Hosoda trueroad at trueroad.jp
Wed Jun 1 11:01:00 UTC 2016

>>> The way I read the implementation of FcConfigAddCache, <globs> are
>>> always
>>> checked first when building the cache before any pattern-based
>>> <acceptfont> has a chance to do anything.
>>> This means, you would probably have to use <acceptfont> with all
>>> filenames
>>> in <glob> that you want to keep. Then remove the <pattern> based
>>> <acceptfont> and leave the <glob> in <rejectfont> unchanged.
>> Thank you for your advice.
>> Is it necessary that to list individual font file name?
>> It is difficult to list all of the TTC/OTC font file name.
> What about inverting the logic, i. e. only using <rejectfont> with only
> those OpenType Collection fonts that you want to ignore, using their full
> paths with <glob>?
> ...other than that, I think there's no really good way to specify what you
> want, because globbing is no supported operator in <pattern> or even
> <test> elements.

I've tried the following settings.


It ignores OTC version of ``Noto Sans CJK'' and ``Source Han Sans''.
It does not ignore other OTC fonts.

Right now, the number of available OTC fonts is very small.
So listing all of the well-known OTC fonts would not be difficult.

In the near future, if the number of available OTC fonts are grown,
this way will become unusable.

Anyway, I'll use this way since there is no other better way.

Thank you.

More information about the Fontconfig mailing list