Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font weight turns lighter on Mac/Safari

On my last website, the text is perfect naturally on chrome and firefox without touching font-smoothing or anything else.
But on Mac / Safari 7 the text appears well then turns immediately thinner (too much thinner / not nice to read). enter image description hereenter image description here

After doing some research [cf http://www.usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/]
and some tests playing with

-webkit-font-smoothing     

It looks like Safari display the text first with :

-webkit-font-smoothing: subpixel-antialiased; 

Then just after you got the flickering effect, when it is turning font to :

-webkit-font-smoothing: antialiased; 

So it seems to me that I had no choice but to force

-webkit-font-smoothing: subpixel-antialiased; 

to make my website consistent on all browsers.
I am using font-face Avenir Std Roman.

Some explanations to that Safari problem ? Any better solutions ? Could my font be part of the problem ?

Thanks.

like image 475
migswd Avatar asked Jan 22 '14 08:01

migswd


People also ask

Why my font weight is not working?

font-weight can also fail to work if the font you are using does not have those weights in existence – you will often hit this when embedding custom fonts. In those cases the browser will likely round the number to the closest weight that it does have available.

How do I change the default font weight?

Syntax: font-weight: normal|bold|lighter|bolder|number|initial|inherit|unset; Property Values: normal: This is the default font-weight & defines the normal font-weight.

What is Webkit font smoothing Antialiased?

antialiased - Smooth the font on the level of the pixel, as opposed to the subpixel. Switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter.


2 Answers

So I fixed my problem with applying:

body {     -webkit-font-smoothing: subpixel-antialiased; } 

Now my font is consistent on every browsers.

like image 90
migswd Avatar answered Nov 11 '22 10:11

migswd


try both

{-webkit-font-smoothing: subpixel-antialiased; -webkit-text-stroke:1px transparent;} 
like image 43
Mihir ajagia Avatar answered Nov 11 '22 09:11

Mihir ajagia