10

I can specify the default font family used to display a particular language in X by editing .fonts.conf in my user directory (or editing the global /etc/fonts/fonts.conf). However, I've not been able to force a particular font size in the same way.

For example, the following forces the Russian language to be displayed in Linux Libertine:

<fontconfig>
    <match>
        <test name="lang">
            <string>rus</string>
        </test>
         <edit mode="prepend" name="family">
            <string>Linux Libertine</string>
        </edit>
    </match>
</fontconfig>

I have tried adding the following XML tag, but it does not work:

         <edit mode="assign" name="size">
             <int>18</int>
         </edit>
SigueSigueBen
  • 1,290
  • 12
  • 14

1 Answers1

12

You can try re-using this my snippet which increases font size of specified font by a given factor:

<!--
    Scaling a chosen font with Fontconfig.
    By poige, 2008.
-->
<match target="font">
    <test name="family">
        <string>Liberation Sans</string>
    </test>
    <edit name="pixelsize" mode="assign">
        <times><name>pixelsize</name>, <double>1.1</double></times>
    </edit>
</match>
poige
  • 6,195
  • 2
  • 30
  • 57
  • Changing the tag `` to `` was enough to get my current `.fonts.conf` to work. – SigueSigueBen Jun 19 '12 at 14:22
  • Apparently you cannot change the `` of a font, but setting its `` works perfectly. Very useful to force a given size on bitmap fonts. Thanks. – Tobia Jan 05 '17 at 14:31
  • @SigueSigueBen Does your snippet work in Firefox? I'm trying to change the size of Inconsolata, which is my favorite font but is smaller than other fonts. It works in some apps, such as Urxvt, but in Firefox does not seem to do anything. Other font configurations, such as `` substitutions, work in Firefox too. – Tobia Oct 02 '18 at 05:05
  • Haven't been using it all for a while (Mac OS mostly now) but AFAIR, FF could have own approach to font rasterisation — not sharing the system's one, probably. – poige Oct 04 '18 at 02:48