[Fontconfig] Another proposal for saving custom fonts in fontconfig

Peng Wu peng.e.wu at gmail.com
Thu Jun 27 06:07:05 UTC 2019


Hi,

  Sorry, I forget to introduce the background of this proposal.

  For variable fonts, there are some axis which can be changed to have
some custom style of the variable fonts. Some users may want to save
the frequent used custom style to use it next time.

  Take some fonts from v-fonts.com for example, the user like
the "BC Minim Variable" font with the parameters
"Weight=150;Inktrap=100",
and want to save this as some custom style "More Bold".

  Then pango will try to create some custom file format like below:
'''
<customfont>
        <origin>
                <family>BC Minim Variable</family>
                <style>Regular</style>
        </origin>
        <custom>
                <family>BC Minim Variable</family>
                <style>More Bold</style>
                <fontvariations>wght=150;INKT=100</fontvariations>
        </custom>
</customfont>
'''

  In this proposal, we won't change the family name, only create or
save the custom style name for easy access.
  We could restrict the syntax to not allow change the family name.

'''
        <custom>
                <style>More Bold</style>
                <fontvariations>wght=150;INKT=100</fontvariations>
        </custom>
'''


  Actually pango can handle the "fontvariations" string directly
with pango_font_description_set_variations, and fontconfig already
support the "fontvariations" string.
  I think no need to split the "fontvariations" string.

  BTW, I dunno about the PS1 font selection in TEX.
  We won't change the family name, only save the custom style name for
the user.

Thanks,
  Peng



More information about the Fontconfig mailing list