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 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.

share|improve this question
    
Wrench>Configuration>Advanced Configuration>Web Content>Font Size. –  Uri Herrera Aug 6 '12 at 6:01
    
That increases the size for all fonts, but only certain fonts are problematic. –  notJim Aug 6 '12 at 6:16
    
Do you have this problem with generic fonts like sans-serif, sans etc or with all fonts? –  Anwar Shah Aug 6 '12 at 6:32
1  
If I set the font to sans-serif or DejaVu Sans using the Chrome inspector, it appears in the correct size. If I set it to Arial or Helvetica, it appears in the wrong size. I think this might be an issue related to Ubuntu's font substitution. –  notJim Aug 6 '12 at 6:40

1 Answer 1

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.

share|improve this answer
    
This solution will make 12px fonts 13px but what happens with 8px,9px,10px fonts.. isn't there a generic way to say "all arial fonts get 1px?" –  George Katsanos Sep 30 '12 at 18:05

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.