[Fontconfig] Another proposal for saving custom fonts in fontconfig

Peng Wu peng.e.wu at gmail.com
Thu Jan 16 07:17:30 UTC 2020


Hi,

Based on previous fontconfig cache API proposal, I propose some small
additions with some command line tool for font package maintainers.

FcBool
FcDirCacheAddStyle (const FcConfig *config, const FcChar8 *file,
const unsigned int index, const FcChar8 *stylename, FcPattern *custom);

The FcPattern *custom will contains all the properties to be
overridden.

FcBool
FcDirCacheRemoveStyle (const FcConfig *config, const FcChar8 *file,
const unsigned int index, const FcChar8 *stylename);

To remove the saved custom style name.

To add some custom style when install the font package,
provide some command line tool `fc-custom` to add custom style into
fontconfig cache.

To add some custom style:
$ fc-custom add-style "family name" "style name" "new style name" --
variations "wght=150;INKT=100" --features "kern 0, dlig"

To remove some custom style:
$ fc-custom remove-style "family name" "new style name"

But with this proposal, if user re-generate the fontconfig system
cache, the custom style maybe lost, like `fc-cache -fvr` with root
user.

Feel free to comment it.

Thanks,
  Peng



More information about the Fontconfig mailing list