-   Linux - Software (
-   -   Scaling individual fonts using fontconfig/Xft/GTK (

gurulocu 12-26-2005 11:59 PM

Scaling individual fonts using fontconfig/Xft/GTK

On my Ubuntu system, there is a TrueType font called "Pothana2000" that is used to render Unicode text for the Telugu language. This font comes with the ttf-indic-fonts package which is also available on Debian systems.

My problem is that, in all GTK programs that use Xft (and therefore also use fontconfig), this Pothana2000 font appears much smaller than all other fonts at the same point-size. For example, see this screenshot and notice how the English words "Link" and "Mouse" (near the bottom of the picture) appear much bigger than the surrounding Telugu text.

To solve this problem, I have tried to force scaling of this font using a fontconfig configuration file, but was unsuccessful. Here is the configuration file I have tried (~/.fonts.conf):

<?xml version="1.0"?>
 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <!-- ~/.fonts.conf for per-user font configuration -->
        <match target="font">
                <test name="family">
                <edit name="scale" mode="assign_replace" binding="strong">

Is it possible to use something like fontconfig to specify that a particular font should have a larger default size than others? Maybe by specifying a larger DPI for that particular font? For example, if all fonts on my system are made for 75 DPI, can I configure fontconfig/Xft/GTK/whatever to render Pothana2000 text at a higher DPI?

I would really appreciate any thoughts or comments on this problem. It has been annoying me for two years now. :cry:


weeifuh 01-24-2012 08:55 AM

Maybe you can try this code. I'm using a matrix to get a resized font, change the 1.1 to a value that fixes your font.


    <match target="font">
        <test name="family" qual="any">
        <edit name="matrix" mode="assign">

All times are GMT -5. The time now is 10:20 PM.