Ubuntu – Ubuntu 16.04 – How to override fonts

fontsgoogle-chrome

I recently installed Ubuntu 16.04, everything went nice and smooth except when I installed Chrome, and logged in to my account to check my watch history on YouTube, then I came across this weird looking font:

image.

I checked with Inspect Element to see what font it was, turns out it was

font: 12px Roboto,arial,sans-serif;

Personally, I don't like it, though on Windows I like it.
Inspect Element's font is weird also.

Why are they different?
Can I change it, currently I'm using Open Sans as my main font.

Best Answer

The default fonts you're disatisfied with are those which are set within your browser, and overriding the system fonts may not be the best approach. If you are using Firefox there are font setting preferences, and if using Chromium you will need to install an extension. You can then preview and choose your preferred fonts in a more flexible way. To get the Microsoft default system fonts in Ubuntu, install the package ttf-mscorefonts-installer via your preferred method (ie apt in a terminal, synaptic, or otherwise) to get Arial. As an alternative to Arial, I also recommend the fonts-texgyre package, with TeX Gyre Heros as the best free Helvetica alternative (actually a highly developed and extended set of Nimbus, a grotesk which has a history prior to Helvetica).

More specific to your situation, the diagonal stroke thinning on the "S" and "s", as well as the compressed counters and narrowed aperture in "e", and too-low middle stroke of the "E" seems to indicate that you are using the infinality package. To my taste, this package is very unsuited to the default tweaks Ubuntu is already applying to the freedesktop font rendering, and much better for most other distros (like Fedora or OpenSUSE). Basically, it's correcting in addition to the corrections that are built into Ubuntu by default, rather than replacing them. I think the Ubuntu defaults are the best font rendering on any desktop operating system, but if you are a long-time Windows user they will look very different (much less strongly aliased). I recommend uninstalling infinality if you do have it on an Ubuntu installation, and if you want to try a tweak, use unity-tweak-tool to turn font hinting off completely (allowing the renderer to make all the decisions itself).

Some example screen shots of Youtube at different magnifications, in Chromium. Note that changing system hinting preferences in unity-tweak-tool (and logging out and back in to restart the session) did not change the rendering of these tiles in-browser.

Roboto (Youtube default, to compare with OP's screenshot):

Roboto - 110%

Roboto (size decreased as a test of the compositor's aliasing capabilities): Roboto - 75%

Arial (as alternative font) this is with hinting turned off completely, RGBA aliasing. The font renders in a very crisp, MS way.

Arial - 110% Arial - 75%

Related Question