Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm looking at a website that attempts to display text in the Palatino font. This is not installed on my system. I'm not sure if it's even possible to get it in Linux. (FWIW I have ttf-mscorefonts-installer installed.)

In any case, the fallback font rendered horribly in Firefox, as shown in the screenshot.

palantino in firefox

As you can see, the height of characters vary. For example, in "enslave", the a is shorter than the v. This page renders fine in Chromium. I found an old bug that was supposedly fixed three years ago, so I'm not sure if it's something odd with my system, or just a regression.

How can I fix this problem?

==EDIT==

I already have texlive-fonts-recommendedtexlive-fonts-recommended installed on my system, which supposedly contains Palatino, but I can't find it in Font Manager.

share|improve this question
    
    
@rajagenupula Thanks for the link. I've added more info. –  Sparhawk Aug 31 '13 at 5:47

2 Answers 2

up vote 1 down vote accepted

As far as I know this is a hinting issue. Try putting this into a new file in ~/.config/fontconfig/conf.d, like 20-autohint.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
    <match target="pattern">
        <test name="family">
            <string>URW Bookman L</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
    </match>
    <match target="pattern">
        <test name="family">
            <string>URW Chancery L</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
    </match>
    <match target="pattern">
        <test name="family">
            <string>URW Gothic L</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
    </match>
    <match target="pattern">
        <test name="family">
            <string>URW Palladio L</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
    </match>
</fontconfig>

If you have an older system and this doesn't work try putting it into the file ~/.fonts.conf.

share|improve this answer
    
Great! This did fix it. However, I'm wondering if there is a reason to only enable hinting for some fonts, rather than all? (Also, I had hinting enabled in KDE's system settings, but that doesn't seem to do anything.) –  Sparhawk Mar 16 at 6:06
    
Ah okay. It seems that enabling hinting for all fonts looks worse for some. In that case, how did you pick these specific fonts? –  Sparhawk Mar 16 at 6:12
    
These fonts are TeX fonts that come from the URW foundry and need special treatment for hinting, I'm not quite sure why. I don't remember where I came across this solution first, though. –  Jan Larres Mar 17 at 3:22
    
Okay. I don't understand this 100%, but seems like it makes some sense. Thanks. –  Sparhawk Mar 17 at 11:08

Another solution I've round recently is to install Infinality fonts, which fixes this problem without the file mentioned by Jan Larres. I've now using Arch, but there's no reason it shouldn't work in Ubuntu.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.