[Fontconfig] Another proposal for saving custom fonts in fontconfig

Akira TAGOH akira at tagoh.org
Tue Jul 2 09:12:03 UTC 2019


On Tue, Jul 2, 2019 at 5:27 PM Peng Wu <peng.e.wu at gmail.com> wrote:
>   Based on this proposal, I propose some small modifications in the
> API.
>
> FcBool
> FcDirCacheAddStyle (const FcConfig *config, const FcChar8 *file,
> const unsigned int index, const FcChar8 *stylename, FcPattern *custom);
>
> The file is for the font file path,
> the index is for the font index if this font is TTC font,
> the stylename is for the custom style name.
>
> The FcPattern *custom will contains all the properties to be
> overridden.

No. I thought we agreed with not using blackboxed parameters in
private discussions. that API potentially expects to override
everything with FcPattern which isn't desired at this point. if you
want to override a property other than FC_FONT_VARIATIONS, it should
be "const FcChar8 *object, const FcChar8 *value" instead of "FcPattern
*custom".

>
> fontconfig can maintain a white list of allowed overridden properties,
> and initially it only allows style name and font variations.
>
> FcBool
> FcDirCacheRemoveStyle (const FcConfig *config, const FcChar8 *file,
> const unsigned int index, const FcChar8 *stylename);
>
> To remove the saved custom style name.
>
> Feel free to comment it.
>
> Thanks,
>   Peng
>


-- 
Akira TAGOH


More information about the Fontconfig mailing list