LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Scaling individual fonts using fontconfig/Xft/GTK (https://www.linuxquestions.org/questions/linux-software-2/scaling-individual-fonts-using-fontconfig-xft-gtk-396751/)

gurulocu 12-26-2005 10:59 PM

Scaling individual fonts using fontconfig/Xft/GTK
 
Hello,

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):
Code:

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

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:

Thanks.

weeifuh 01-24-2012 07: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.

Code:

    <match target="font">
        <test name="family" qual="any">
            <string>Pothana2000</string>
        </test>
        <edit name="matrix" mode="assign">
            <times>
                <name>matrix</name>
                <matrix>
                    <double>1.1</double><double>0</double>
                    <double>0</double><double>1.1</double>
                </matrix>
            </times>
        </edit>
    </match>



All times are GMT -5. The time now is 09:48 PM.