0

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.

Sparhawk
  • 6,929

2 Answers2

2

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.

  • 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 '14 at 06: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 '14 at 06: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 '14 at 03:22
  • Okay. I don't understand this 100%, but seems like it makes some sense. Thanks. – Sparhawk Mar 17 '14 at 11:08
0

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.

Sparhawk
  • 6,929