Ubuntu – Fonts too small in Chrome in 12.04

fontsgoogle-chrome

I'm having trouble getting fonts to display at the correct size in Chrome. Here is a side-by-side of Firefox and Chrome on the same system (Chrome left, Firefox right), and another shot from my Mac. Click through to see either image in full size.

Notice how In the Email section, and in the description below the repository (below where it says unicodeforus in blue), the text is several pixels smaller in Chrome.

I did make sure that both Firefox and Chrome are set to use the same fonts.

This doesn't look like much, but it happens for a lot sans-serif text on the web, and it's very distracting.

Best Answer

It appears to be an issue with the way subpixel rendering ends up working with Ubuntu and Arial. A suggested workaround is to make Arial automagically a size bigger when 12 pixel text is requested.

I couldn’t imagine it being so simple as putting a .fonts.conf in your home dir containing:

<fontconfig>
  <match target="font">
    <test name="family" compare="eq"><string>Arial</string></test>
    <test name="pixelsize" compare="eq"><double>12</double></test>
    <edit name="pixelsize" mode="assign"><double>13</double></edit>
  </match>
</fontconfig>

But it really is as simple as that. In human language, the XML file tells fontconfig to set the pixelsize of Arial to 13 when any program requests Arial with pixelsize 12. How beautiful.

I would guess there might be a way to tweak the subpixel renderer so that Arial doesn't appear too small at 12 pixels. If there's such a way, it's probably to be found on this crazy wiki page about fontconfig from archlinux. If someone wants to read that page and tell me what to do, I'd happily give them best answer.

For now, I just nuked the mscorefonts.

Here is another approach to getting fonts in Linux to look much more like those from Windows. I may update this answer tomorrow if I have time to try those suggestions.