6

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.

6
  • Wrench>Configuration>Advanced Configuration>Web Content>Font Size. Commented Aug 6, 2012 at 6:01
  • That increases the size for all fonts, but only certain fonts are problematic. Commented Aug 6, 2012 at 6:16
  • Do you have this problem with generic fonts like sans-serif, sans etc or with all fonts?
    – Anwar
    Commented Aug 6, 2012 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. Commented Aug 6, 2012 at 6:40
  • Check out this : askubuntu.com/questions/885347/… seems better approach.
    – EetSandhu
    Commented Feb 21, 2017 at 2:01

1 Answer 1

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.

2
  • 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?" Commented Sep 30, 2012 at 18:05
  • @GeorgeKatsanos Simply remove the second <test> line ?
    – Irfan
    Commented Mar 20, 2015 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .