16

I've just updated Google Chrome to version 37 on my Linux system. Now code blocks look like this:

enter image description here

And text while I write this question looks like this:

enter image description here

On the same system, the question with code blocks looks ok with Firefox.

What is the problem with fonts in Chrome 37?

Detailed information

According to the Google Chrome developer tools, the following font families were computed:

Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;

In Firefox:

Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif
Martin Thoma
  • 3,384
  • 9
  • 31
  • 65
  • Right-click the code block, select "Inspect element", in the right-side panel of the developer console choose the "Computed" tab, scroll down to the bottom, and post the font name that's listed there -- do this both on Chrome and Firefox. I'm wondering if Chrome is choosing a bitmap font... – u1686_grawity Aug 27 '14 at 17:37
  • I meant the font name _at the bottom_; in Chrome it's under the label "Rendered Font". The computed styles would be same on both browsers anyway, but the actually chosen font might differ. – u1686_grawity Aug 27 '14 at 17:47
  • I'm having a lot of trouble with Chrome on Linux too with certain fonts. I had to edit the .font.cfg file (or something like that) to force it replace those fonts. I'll post later if I have time. – LatinSuD Aug 27 '14 at 17:53
  • Did you installed a new font? – Rosenthal Aug 27 '14 at 18:35
  • I have other fonts besides the stnadard fonts installed, yes. But the last time I've installed a font is at least a month ago. The font problem appeared today. And I've updated Chrome today – Martin Thoma Aug 27 '14 at 18:37
  • 4
    Apparently they switched from using a strongly-typed language to a weakly-typed one. – Daniel R Hicks Aug 27 '14 at 19:05
  • 4
    @DanielRHicks: How does that even... – u1686_grawity Aug 27 '14 at 19:07
  • I had [a similar problem](http://superuser.com/questions/749500/different-font-rendering-in-same-computer) (although not related to Chrome and in Windows), that was due to having a crude form of ClearType enabled. Could you have some sort of option on Linux that changes the font rendering or the DPI scale of the text? – Doktoro Reichard Aug 28 '14 at 22:31
  • @gawity It's a joke. The text is being typed like the typewriter isn't pressing down hard enough. The type is not strong enough. – trlkly Sep 11 '14 at 22:01
  • 1
    This probably belongs on either meta.SO if the problem is specific to SO, or meta.SE – Crippledsmurf Dec 04 '14 at 02:18
  • @Crippledsmurf I think I have read that this problem appears on other pages, too. But SO is the easiest to show for other people (and the most obivious one, because it has so many code blocks). – Martin Thoma Dec 04 '14 at 09:54

4 Answers4

8

Do the following:

  1. Create the file ~/.fonts.conf
  2. Add the following text

    <match target="font" >
        <edit name="embeddedbitmap" mode="assign"><bool>false</bool></edit>
    </match>
    
  3. Restart Chrome

Source: https://code.google.com/p/chromium/issues/detail?id=408059

Rubens Mariuzzo
  • 427
  • 5
  • 8
Martin Thoma
  • 3,384
  • 9
  • 31
  • 65
  • 2
    Worked for me. Although, font on stackoverflow definitely appears differently than it did before this bug, but at least it is readable now. – Josh Bothun Nov 05 '14 at 02:44
  • It happened to me just after registering Monaco font using Fedora 19. This answer worked for me as described. – Rubens Mariuzzo Dec 03 '14 at 23:26
  • 1
    In recent distro creating the file `~/.fonts.conf` will raise a _deprecation warning_. Instead, create the file at: `~/.config/fontconfig/fonts.conf`. More info at: http://askubuntu.com/a/231274/24159 – Rubens Mariuzzo Dec 03 '14 at 23:46
2

You appear to be running into a Chrome 37 bug with Linux font rendering that likely is caused by them updating rendering in Windows. It was supposed to have been fixed before release, according to some posts there, but others are clearly saying it wasn't. Multiple suggestions for dealing with this are offered there, including jumping to the 38 beta or updating your local font information and changing the auto-hint option.

I'll repost their example ~/.fonts.conf, but I would only try it as a last resort. Try the beta first.

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="autohint"><bool>false</bool></edit>
  </match>
</fontconfig>`
trlkly
  • 1,677
  • 14
  • 18
0

I had the same problem. OS: Linux Mint 17 Cinnamon with font extensions.

Check the Zoom of your current Chrome display. Reducing or increasing zoom should clarify your font rendering.

0

Edit ~/.fonts.conf is working for me, my ~/.fonts.conf (debian Jessie, xfce4, chrome 43.0.2357.81 (64-bit)) is:

<!-- put to ~/.fonts.conf to improve chrome font rendering -->
<match target="font">
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
  • The question seems to be about version 37. Do you know if your solution would work with version 37 as well as version 43? – Jason Aller Jul 09 '15 at 02:44
  • Works on version 37 for me, but this should depend on which platform you are using, you can try these options one by one if it doesn't work. – kurtmeln Jan 25 '16 at 07:00