[Fontconfig] Per application settings in .fonts.conf?

Behdad Esfahbod behdad at behdad.org
Tue Dec 11 06:02:02 PST 2012


On 12-12-10 07:26 PM, Wendell P wrote:
> 
> You can make application-specific settings in ~/.Xresources with syntax
> like:
> 
> xterm*background: #FFFFFF
> xterm*foreground: #000000
> xterm*font: <some font>
> 
> Is it possible to make settings for specific applications in
> ~/.fonts.conf? If so, what is the syntax? For example, how would I
> change this to apply only to a specific app?

Depends on the toolkit that calls into fontconfig.  In Pango I made that
possible.  The syntax is, for example:

    <match target="font">
                <test name="pangoprgname" mode="eq">
                        <string>pango-view</string>
                </test>
                <edit name="matrix" mode="assign">
                        <times>
                                <name>matrix</name>
                                <matrix><double>1.4</double><double>0</double>
                                        <double>0</double><double>1.4</double>
                                </matrix>
                        </times>
                </edit>
     </match>

There's nothing magical here.  Pango simply calls g_get_prgname() and sets the
"pangoprgname" element in the FcPattern to the prgname...  Other toolkits can
do the same.  One day we may even drop the pango prefix...

behdad





> <?xml version='1.0'?>
> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> <fontconfig>
>   <match target="font">
>     <edit mode="assign" name="antialias"><bool>false</bool></edit>
>   </match>
> </fontconfig>
> 

-- 
behdad
http://behdad.org/


More information about the Fontconfig mailing list