[Fontconfig] Understanding <default> alias
Petr Gajdos
pgajdos at suse.cz
Thu Feb 23 02:15:01 PST 2012
On Thu, Feb 23, 2012 at 01:13:42PM +0900, Akira TAGOH wrote:
> # I forgot to Cc'ing the list. resending....
>
> Hi,
>
> Once building the pattern list for lookup, it won't be re-evaluated
> for matching. thus, what you need to do for what you want to do is to
> add the fallback fonts as you did for "myserif". it's the same logic
You mean <accept></accept> block for every font in the group? I am
searching for more scalable solution and, mainly, for
<default></default> usage :-) (is there any other?).
Nevertheless, I have probably found it: I didn't preserve sequence of
<alias><family></family><accept></accept></alias> and
<alias><family></family><default></default></alias> from
30-metric-aliases.conf -- I haven't consider it important until now (I
have no idea why it matters, I don't know internals of fontconfig).
<alias binding="same">
<family>Droid Serif</family>
<family>DejaVu Serif</family>
<family>Liberation Serif</family>
<family>STIXGeneral</family>
<default><family>myserif</family></default>
</alias>
<alias binding="same">
<family>myserif</family>
<accept>
<family>DejaVu Serif</family>
<family>STIXGeneral</family>
<family>Droid Serif</family>
<family>Liberation Serif</family>
</accept>
</alias>
works as I expect. I. e.
laura:/> fc-list | grep "DejaVu Serif"
laura:/> fc-match "DejaVu Serif"
STIXGeneral.otf: "STIXGeneral" "Regular"
Note that, for <default> alias, it make sense to have more
<family> tags in.
Petr
> > <alias binding="same">
> > <family>myserif</family>
> > <accept>
> > <family>DejaVu Serif</family>
> > <family>STIXGeneral</family>
> > <family>Droid Serif</family>
> > <family>Liberation Serif</family>
> > </accept>
> > </alias>
> >
> > <alias binding="same">
> > <family>Droid Serif</family>
> > <default><family>myserif</family></default>
> > </alias>
> >
> > <alias binding="same">
> > <family>DejaVu Serif</family>
> > <default><family>myserif</family></default>
> > </alias>
> >
> > <alias binding="same">
> > <family>Liberation Serif</family>
> > <default><family>myserif</family></default>
> > </alias>
> >
> > <alias binding="same">
> > <family>STIXGeneral</family>
> > <default><family>myserif</family></default>
> > </alias>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120223/34a330b8/attachment.pgp>
More information about the Fontconfig
mailing list