I'm using google webfonts and they fine at super large font sizes, but at 18px, they look awful. I've read here and there that there are solutions for font smoothing, but I haven't found any where that explains it clearly and the few snippets I have found don't work at all.
My h4
looks awful in pretty much every browser, but Chrome is the worst. In Chrome, pretty much all of my fonts look terrible.
Can anyone point me in the right direction? Perhaps you know of a resource that explains this clearly? Thanks!
This screenshot shows the homepage of https://www.dartlang.org/, a programming language that is made by Google (so we can imply that this website is also build by Google) and uses Google Webfonts.
Screenshot shows Google Chrome on the left, Firefox/Internet Explorer on the right.:
This screenshot shows a product info page on Adobe.com, using webfonts provided by Typekit. Adobe & Typekit are professionals when it comes to fonts.
Screenshot shows Google Chrome on the right, Firefox/Internet Explorer on the left:
This question is related to
css
google-chrome
fonts
google-webfonts
I had the same problem, and I found the solution in this post of Sam Goddard,
The solution if to defined the call to the font twice. First as it is recommended, to be used for all the browsers, and after a particular call only for Chrome with a special media query:
@font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.eot');
src: url('../../includes/fonts/chunk-webfont.eot?#iefix') format('eot'),
url('../../includes/fonts/chunk-webfont.woff') format('woff'),
url('../../includes/fonts/chunk-webfont.ttf') format('truetype'),
url('../../includes/fonts/chunk-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'chunk-webfont';
src: url('../../includes/fonts/chunk-webfont.svg') format('svg');
}
}
With this method the font will render good in all browsers. The only negative point that I found is that the font file is also downloaded twice.
You can find an spanish version of this article in my page
I will say before all that this will not always works, i have tested this with sans-serif
font and external fonts like open sans
Sometimes, when you use huge fonts, try to approximate to font-size:49px
and upper
This is a header text with a size of 48px (font-size:48px;
in the element that contains the text).
But, if you up the 48px to font-size:49px;
(and 50px, 60px, 80px, etc...), something interesting happens
The text automatically get smooth, and seems really good
If you are looking for small fonts, you can try this, but isn't very effective.
To the parent of the text, just apply the next css property: -webkit-backface-visibility: hidden;
You can transform something like this:
To this:
(the font is Kreon
)
Consider that when you are not putting that property, -webkit-backface-visibility: visible;
is inherit
But be careful, that practice will not give always good results, if you see carefully, Chrome just make the text look a little bit blurry.
-webkit-backface-visibility: hidden;
will works too when you transform a text in Chrome (with the -webkit-transform
property, that includes rotations, skews, etc)
Without -webkit-backface-visibility: hidden;
With -webkit-backface-visibility: hidden;
Well, I don't know why that practices works, but it does for me. Sorry for my weird english.
Ok you can use this simply
-webkit-text-stroke-width: .7px;
-webkit-text-stroke-color: #34343b;
-webkit-font-smoothing:antialiased;
Make sure your text color and upper text-stroke-width must me same and that's it.
Chrome doesn't render the fonts like Firefox or any other browser does. This is generally a problem in Chrome running on Windows only. If you want to make the fonts smooth, use the -webkit-font-smoothing
property on yer h4
tags like this.
h4 {
-webkit-font-smoothing: antialiased;
}
You can also use subpixel-antialiased
, this will give you different type of smoothing (making the text a little blurry/shadowed). However, you will need a nightly version to see the effects. You can learn more about font smoothing here.
Source: Stackoverflow.com