[Fontconfig] Request for implementing font substitution for CJK fonts

Raimund Steger rs at mytum.de
Sun Jun 10 04:11:15 PDT 2012

Raimund Steger wrote:
> BlissSam wrote:
>> [...]
>> Mapping specific to generic, and map generic to specific,
> You summarized a correct way of doing this in a few words
> [...]

NB. I figure as an easy way of generating such rules you could use an 
XSLT to support some bogus group tag like:


<?xml version="1.0"?>
<xsl:stylesheet version="1.0"

<xsl:template match="fontconfig">
<xsl:for-each select="*">
     <xsl:when test="name(.)='familygroup'">

       <xsl:for-each select="family">
           <family><xsl:value-of select="."/></family>
             <family><xsl:value-of select="../@name"/></family>

         <family><xsl:value-of select="@name"/></family>
         <xsl:for-each select="family">
           <family><xsl:value-of select="."/></family>

       <xsl:copy-of select="."/>



This would allow you to use:

   <familygroup name="Testgroup">

and apply it with

   xsltproc familygroup.xslt fonts.conf.in \
       | xmllint --format - > fonts.conf

Aside from that, I've just taken a look at the 65-fonts-persian.conf 
file Behdad mentioned. Actually I don't think having something similar 
for the most common CJK fonts would be that much of a problem, be it 
just to balance things out :-)


More information about the Fontconfig mailing list