By Stijn Martens


2011-02-22 19:02:54 8 Comments

The text is correctly displayed in Chrome. I want it to display this way in all browsers. How can I do this?

I was able to fix this in Safari with -webkit-font-smoothing: antialiased;

Chrome:
Chrome

Firefox:
Firefox

h1 {
    font-family: Georgia;
    font-weight: normal;
    font-size: 16pt;
    color: #444444;
    -webkit-font-smoothing: antialiased;
}
<h1>Hi, my name</h1>

And a JSFiddle: http://jsfiddle.net/jnxQ8/1/

8 comments

@mateostabio 2018-04-29 22:10:04

I have many sites with this issue & finally found a fix to firefox fonts being thicker than chrome.

You need this line next to your -webkit fix -moz-osx-font-smoothing: grayscale;

body{
    text-rendering: optimizeLegibility;
   -webkit-font-smoothing: subpixel-antialiased;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
}

@KEMBL 2017-11-15 13:01:34

I collected and tested discussed solutions:

Windows10 Prof x64:

* FireFox v.56.0 x32 
* Opera v.49.0
* Google Chrome v.61.0.3163.100 x64-bit

macOs X Serra v.10.12.6 Mac mini (Mid 2010):

* Safari v.10.1.2(12603.3.8)
* FireFox v.57.0 Quantum
* Opera v49.0

Semi (still micro fat in Safari) solved fatty fonts:

text-transform: none; // mac ff fix
-webkit-font-smoothing: antialiased; // safari mac nicer
-moz-osx-font-smoothing: grayscale; // fix fatty ff on mac

Have no visual effect

line-height: 1;
text-rendering: optimizeLegibility; 
speak: none;
font-style: normal;
font-variant: normal;

Wrong visual effect:

-webkit-font-smoothing: subpixel-antialiased !important; //more fatty in safari
text-rendering: geometricPrecision !important; //more fatty in safari

do not forget to set !important when testing or be sure that your style is not overridden

@jontro 2018-10-10 09:25:07

How would text-transform fix/break anything?

@vincicat 2011-02-22 19:21:58

Be sure the font is the same for all browsers. If it is the same font, then the problem has no solution using cross-browser CSS.

Because every browser has its own font rendering engine, they are all different. They can also differ in later versions, or across different OS's.

UPDATE: For those who do not understand the browser and OS font rendering differences, read this and this.

However, the difference is not even noticeable by most people, and users accept that. Forget pixel-perfect cross-browser design, unless you are:

  1. Trying to turn-off the subpixel rendering by CSS (not all browsers allow that and the text may be ugly...)
  2. Using images (resources are demanding and hard to maintain)
  3. Replacing Flash (need some programming and doesn't work on iOS)

UPDATE: I checked the example page. Tuning the kerning by text-rendering should help:

text-rendering: optimizeLegibility; 

More references here:

  1. Part of the font-rendering is controlled by font-smoothing (as mentioned) and another part is text-rendering. Tuning these properties may help as their default values are not the same across browsers.
  2. For Chrome, if this is still not displaying OK for you, try this text-shadow hack. It should improve your Chrome font rendering, especially in Windows. However, text-shadow will go mad under Windows XP. Be careful.

@ChrisW 2011-02-22 19:24:29

I don't understand why Chrome and Safari render differently: they're both WebKit-based.

@Stijn Martens 2011-02-22 19:26:16

Yeah, but Chrome apparantly does automatically apply `-webkit-font-smoothing: antialiased;' and Safari doesn't?

@vincicat 2011-02-22 19:38:59

chrome and safari is similar but not the same browser: they shared same base, webkit, but many platform-specific components and css modules are different - safari support more css3 property than chrome. And font-rendering is quite platform-specific.

@Domokun 2011-10-19 06:43:00

@ChrisW - Safari has it's own font rendering engine to give a similar experience as on OSX. Thus the '-webkit-font-smoothing' property will only appear to work on Safari (under Windows). And yet another variable is, you can modify the anti-aliasing in the browser Preferences.

@Kris Selbekk 2015-08-06 08:54:00

I actually had a problem on two different pages of the same site, with the same CSS applied, rendering different results. The font-smoothing: antialiased; worked wonders for me.

@Devangi Desai 2017-07-06 04:37:01

I am still facing problem with Safari - too bold and chrome normal bold. Please give me proper solution. I am using Mac

@Anne-Pieter Strikwerda 2015-07-21 10:41:58

Try -webkit-font-smoothing: subpixel-antialiased;

@Jorge 2014-10-09 22:58:49

Try text-rendering: geometricPrecision;.

Different from text-rendering: optimizeLegibility;, it takes care of kerning problems when scaling fonts, while the last enables kerning and ligatures.

@bobzIlla 2014-02-09 03:24:48

There's some great information about this here: https://bugzilla.mozilla.org/show_bug.cgi?id=857142

Still experimenting but so far a minimally invasive solution, aimed only at FF is:

body {
-moz-osx-font-smoothing: grayscale;
}

@oneiota 2013-07-18 05:56:29

In order to best standardise your @font-face embedded fonts across browsers try including the below inside your @font-face declaration or on your body font styling:

speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;

At present there looks to be no universal fix across all platforms and browser builds. As stated frequently all browsers/OS have different text rendering engines.

@Trevor 2011-02-22 19:21:51

I don't think using "points" for font-size on a screen is a good idea. Try using px or em on font-size.

From W3C:

Do not specify the font-size in pt, or other absolute length units. They render inconsistently across platforms and can't be resized by the User Agent (e.g browser).

@Stijn Martens 2011-02-22 19:27:00

But It has nothing to do with the boldness of the font?

@vincicat 2011-03-02 04:46:36

boldness is controlled by font-smoothing (and the subpixel technique by OS and browser rendering engine) most.

@user956584 2012-08-04 12:17:08

ON chrome is the same its start on Chrome 20 , chrome 17 whose OK

Related Questions

Sponsored Content

7 Answered Questions

[SOLVED] How to add multiple font files for the same font?

6 Answered Questions

[SOLVED] Font weight turns lighter on Mac/Safari

1 Answered Questions

[SOLVED] Wordpress - font weight varying across browsers

  • 2017-10-18 16:24:19
  • Mike.Whitehead
  • 247 View
  • 0 Score
  • 1 Answer
  • Tags:   css cross-browser

2 Answered Questions

[SOLVED] Google font with font-weight: bold not have same size

  • 2016-09-21 15:23:33
  • chemitaxis
  • 416 View
  • 0 Score
  • 2 Answer
  • Tags:   css css3 fonts

1 Answered Questions

[SOLVED] Safari changing font weight on bxSlider

1 Answered Questions

[SOLVED] iPhone Safari browser font displayed issue

1 Answered Questions

[SOLVED] Browser support for numeric font-weight

1 Answered Questions

[SOLVED] Safari font-weight issue , text are too bold

2 Answered Questions

Google Web Fonts and other fonts are looking bold and jaggy in Firefox

Sponsored Content