Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font renders thicker in browsers [closed]

I am using the Open Sans font on a web site, but it appears much thicker in all browsers than in Adobe Illustrator (see attached images). Why is this and is there any way I can get the font in the browser to display "thinner" please?

Illustrator

Browser

Note Both the browser and Illustrator are rendering the Semibold weight (600)

like image 270
RunLoop Avatar asked Jan 29 '15 14:01

RunLoop


People also ask

Why do fonts render differently in different browsers?

If you notice that your text fonts look different on different browsers, it is because different browsers and devices use different rendering engines, and therefore may result in minor differences. Sometimes these minor differences can have a domino effect.

How do I stop different browsers rendering fonts differently?

To stop this happening make sure in your CSS you have font-weight: normal and font-style: normal in your @fontface code block. You then need to apply the necessary styles to the HTML elements. And then add the specific styles for each element that uses that font.

How do I fix rendering font?

Go to Control Panel > Appearance and Personalization > Display > Adjust ClearType text (on the left). Check the box entitled “Turn on ClearType.” After going through a short wizard, this will fix some of the text rendering issues in Chrome.

Should I use font smoothing?

I recommend not using it, and instead if you're looking to get a lighter version of the font then use the font-weight to control this so that it appears nicely across both Mac and Windows, and works across all browsers without the need of a browser prefix.


2 Answers

The issue was with aliasing. The following css solution will work for safari, chrome and firefox:

-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
like image 83
RunLoop Avatar answered Oct 20 '22 00:10

RunLoop


Make sure you're including the light (300) and normal (400) weights for Open Sans, then you can simply:

body {
    font-family: 'Open Sans', sans-serif;
    font-weight: 300; /* Or 400, if 300 is too light. */
}
like image 4
James Donnelly Avatar answered Oct 20 '22 00:10

James Donnelly