Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari font-weight issue , text too bold

Tags:

When I apply a font-weight:bold style, the look of the font is too bold in Safari when compared to other browsers. I tried below css as suggested in some site but its still the same.

text-shadow: #000000 0 0 0px; 

Screenshots of text rendering:

Chrome
enter image description here

Safari
enter image description here

Here's my css declaration:

p {  margin: 8px 5px 0 15px;  color:#D8D2CE;  font-size:11pt;   letter-spacing:-1px;  font-weight: bold;   font-family: LektonRegular;   }  @font-face { font-family: 'LektonRegular'; src: url('myfonts/lekton-regular-webfont.eot'); src: url('myfonts/lekton-regular-webfont.eot?#iefix') format('embedded-opentype'),      url('myfonts/lekton-regular-webfont.woff') format('woff'),      url(myfonts/lekton-regular-webfont.ttf)  format('truetype'),      url('myfonts/lekton-regular-webfont.svg#LektonRegular') format('svg'); font-weight: normal; font-style: normal;  } 

How can this be fixed?

like image 248
user1184100 Avatar asked Feb 26 '12 05:02

user1184100


People also ask

How do I reduce the boldness of text?

font-weight: lighter; - uses a weight of the font that is less than "normal" if the font contains this weight. Fallback is the use of the "normal" weight. font-weight: inherit; -- Inherits the weight of the parent element. font-weight: initial; -- uses the default weight of the font.

How do I change the boldness of text?

Type the keyboard shortcut: CTRL+B.

Can you set the font weight property to make the declarations look bold?

You can use the CSS declaration font-weight: bold; .

What is font weight bold?

Note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900).


2 Answers

Use -webkit-font-smoothing: antialiased;

The text-shadow trick doesn't work anymore.

like image 50
Paul Armstrong Avatar answered Sep 28 '22 05:09

Paul Armstrong


For rendering bold text consistently across browsers, your font should explicitly contain bold characters. Otherwise, browsers probably try to make bold variants of characters based on their normal variants, and results are inconsistent across browsers since they likely have different algorithms for such conversion.

Also note that text rendering may be different on different platforms on system level (e.g. Windows, Mac OS). Such differences are OK and do not typically need to be fixed.

See also topic about -webkit-font-smoothing property.

like image 28
Marat Tanalin Avatar answered Sep 28 '22 05:09

Marat Tanalin