Blog of Raivo Laanemets

Stories about web development, freelancing and personal computers.

Chrome 59/60+ font rendering in Linux

On

Chrome 59 on Linux renders fonts differently than the rest of the system. This happens when you use subpixel hinting on your system. Chrome 59+ seems to ignore your settings. It can be fixed by tweaking the FreeType configuration. FreeType is a font rendering system used by most Linux distributions.

The issue can be fixed by setting an environment variable before launching Chrome:

export FREETYPE_PROPERTIES="truetype:interpreter-version=35"
google-chrome

I'm using an Application Launcher in MATE desktop to start Chrome. To automatically set the environment variable, I created a wrapper script chrome-wrapper.sh in my home directory and edited the launcher settings to invoke the wrapper script instead of google-chrome directly. The full contents of the script:

#!/usr/bin/env bash
export FREETYPE_PROPERTIES="truetype:interpreter-version=35"
/opt/google/chrome/google-chrome &

With medium or full hinting this brings back skinny font rendering in the browser. Without the fix, the text looks similar to text on Windows 10.

More information:

Update 2018-11-04

It seems like the font rendering has been broken in versions 69/70 too. The fix seems to be similar (and same works for Chromium, see comments).


Comments

Andrej Pandovich at 2017-12-14
Life saving tips! Thanks!

R Buurke at 2018-02-24
Brilliant! Thanks so much. This was really bothering me :)

Wayne at 2018-05-22
Thanks. There was some actual violent corruption in text on my desktop inside Chromium, making text hard to read, and that FREETYPE_PROPERTIES environment variable mostly solved the problem.

Gen at 2018-10-23
Thnx for the information. Could you please tell how the variables should be set if chromium-browser is used ?


Gen at 2018-10-23
Thnx. Just have no idea with what to replace this line in case of chromium: /opt/google/chrome/google-chrome & as chromiumis named as: chromium-browser

RLa at 2018-10-23
@Gen, it should be just chromium-browser or if you want full path (maybe necessary on some distros) then you can find it using the command which chromium-browser on the terminal and use the path that it outputs.

Email is not displayed anywhere.
URLs (max 3) starting with http:// or https:// can be used. Use @Name to mention someone.