Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-Smoothing in Firefox

Using Google WebFonts ("Oswald" in this case), I have found that my fonts are rendered bolder than they should be. I have solved this problem in webkit based browsers using:

-webkit-font-smoothing: antialiased;

but in Firefox I cannot find the declaration that controls this. I have heard of using a text-shadow hack to fix this, but I would prefer not to use this as it will undoubtedly change the geometric properties of the fonts.

Here is what it looks like in webkit (Chrome):

Chrome looks good

This is the blocky horrible rendering thanks to Firefox:

Firefox ugly

I know there is a way to achieve this in FireFox, because I found this font on font-combinator.com, and it renders properly on font-combinator using Firefox. Here is what it looks like on Firefox through font-combinator.com:

on Font-combinator.com using firefox

After browsing through the css used to create font-combinator, I found this declaration: text-rendering: optimizelegibility;, but this does not work when applied to my element.

I have also tried:

text-rendering: optimizeLegibility;
text-rendering: geometricPrecision;
font-smooth: always;
font-smooth: never;
font-smoothing: antialiased;
-moz-font-smoothing: antialiased;

How can I get Firefox to antialias my fonts so that they look right when displayed? Can you find the declaration, or combination of declarations that makes them display properly on www.font-combinator.com?

I am using an relatively old version of FireFox (16.0.2) because this machine has an old version of OSX installed.

like image 214
Nick Bewley Avatar asked Mar 03 '13 06:03

Nick Bewley


People also ask

How do I make my font look smoother?

Open the Control Panel. Double-click the Display icon. In the Display menu, click the Effects tab and check the box on smooth edges on-screen fonts. After that, click Apply and then click Ok.

Why do fonts look weird in Firefox?

Make sure you haven't enabled a High Contrast theme in the OS settings. you have installed locally and that might be corrupted or are missing some variants. Also, make sure you allow pages to choose their own fonts and that you do not block remote (downloadable) fonts.

How do I increase font rendering in Firefox?

You can access Firefox's font settings by first clicking the menu icon (three stacked lines in the upper right corner), and selecting Preferences. Make sure you're on the General tab, then scroll down just a bit to the “Language and Appearance” section. You can now change the default font and font size for Firefox.

What does font smoothing do?

The font-smooth CSS property controls the application of anti-aliasing when fonts are rendered. This feature is non-standard and is not on a standards track. It depends on the browser used and the system specifications; thus, it may not work for every user.


2 Answers

This is a Firefox on OSX problem only...

I just answered this question: How to antialias SVG text in Firefox with a possible solution form your problem.

I think you could use the following attribute:

-moz-osx-font-smoothing: grayscale;

This will be released with firefox 25 (a nightly build can be found at http://nightly.mozilla.org/)

like image 154
Tieme Avatar answered Oct 22 '22 02:10

Tieme


Have you tried declaring a numerical font-weight instead of just 'normal' or 'bold'? There's a lot of differences in rendering of webfonts in different browsers.

Try setting {font-weight: 400;} for normal text and {font-weight: 700;} for bold.

like image 1
BraMKJ Avatar answered Oct 22 '22 02:10

BraMKJ