[Fontconfig] matching multiple families in <alias> and <test>

Raimund Steger rs at mytum.de
Thu May 10 18:10:49 PDT 2012


Hi,

Raimund Steger wrote:
> [...]
>
> Maybe when going through the FcOpComma operands, one could tag the
> matching FcValueList's somehow and loop precisely over them for the
> following prepend/append/assign edits.

I've now tried to modify fccfg.c along those lines and attached an idea 
of how I think it might work.
It's probably far from being particularly elegant (or bug-free), but in 
a simple test case (matching a number of families through multi-family 
<alias> and <test>) it seems to do what I have in mind:

(1) Save away every match in the test (but at most one per FcOpComma 
operand). For this, FcSubState is updated to allow a linked list that 
contains additional malloc'ed elements in the case of additional matches.

(2) For assign/prepend/append edits, go through that linked list and 
apply every edit once for every match, instead of once for the test. 
This means, it should simulate the behavior of separate rules.

It's not extensively tested, but maybe it can further fuel the discussion...

Raimund

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fc_multivaluetest_rs20120510_0.patch
Type: text/x-patch
Size: 8217 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20120511/788834d6/attachment.bin>


More information about the Fontconfig mailing list