Re: a warning-free way to apply <edit> to multiple font families?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On Wed, Aug 13, 2014 at 4:09 PM, Jungshik SHIN (신정식) <jshin1987@xxxxxxxxx> wrote:
Hi, 


In the past (e.g. fontconfig 2.7.x), I could use the following to apply <edit>'s to a group of font families :  

<match target="font">
   <test name="family" compare="contains">
        <string>MYingHeiB5HK</string>
        <string>MYingHeiGB18030</string>
        <string>MSung GB18030</string>
        <string>MSung B5HK</string>
    </test>
    <!-- Turn on light auto-hint -->
    <!-- Turn off sub-pixel anti-aliasing -->
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="rgba" mode="assign"><const>none</const></edit>
 </match>

With a newer version of fontconfig (e.g. 2.11.1), I got a warning that 'multiple strings test are not supported and may not work as intended'. Despite that warning, it still works as I intended :-). 

Anyway, I wanted to find a warning-free way to express the same in a compact way (i.e. instead of repeating <edit>'s for each family in the above group (if it's only 4, it may be ok, but I also have another group with over 30 families). 

My first attempt in the bug 82582 failed (somehow, <edit>'s were applied to all other fonts NOT listed in <test>). Behdad suggested a couple of other ways.  The first (in comment 0) of his two alternatives did not work (edits are not applied to the 4 fonts above).  

 
The second (in comment #1 of the bug) one worked but I got an warning about <test> not having 'name'. 

I was wrong about the second one (in comment #1 of the bug). It does not work, either because <edit>'s meant for 4 fonts are applied to all other fonts as well. 

So, at the moment, the only way to achieve what I want I know of  is to use the old _expression_ and ignore the warning.  It'd be great if there's a way to do the same without a warning. 

Thanks. 


I wonder if any on the list knows how to achieve what I want to do (apply multiple edits to a group of fonts matching family name) in a compact manner without a warning from fontconfig 2.11.x. 

BTW, I also tried replacing 'contains' with 'eq', but didn't change anything I wrote above. 

Thanks in advance, 

Jungshik 



_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux