Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created November 27, 2012 14:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/4154587 to your computer and use it in GitHub Desktop.
Save barneycarroll/4154587 to your computer and use it in GitHub Desktop.
Fixing shitty WebKit text rendering for thin and quirky fonts
/**
* Fixing shitty WebKit text rendering for thin and quirky fonts
*/
html {
font-family: 'Quicksand';
font-size: 24px;
padding: 1em 5em;
-webkit-text-stroke-width: .25px;}
code {
-webkit-text-stroke-width: 0;}
p + p {
font-weight: 300;
-webkit-text-stroke-width: .5px;}
<link href='http://fonts.googleapis.com/css?family=Quicksand:300,400,700' rel='stylesheet' type='text/css'>
<h1>Quicksand is quite a cute font.</h1>
<p><strong>Toggle the <code>-webkit-text-stroke</code> property to see the difference.</strong></p>
<p>It's been around for free for a while, but standard-PPI (ie non-retina, ie your PC) combined with horrifically unreliable browser text-rendering engines have made it impossible to commit to.</p>
<p>WebKit in particular is criminal. They change everything all the time. It used to be the unequivocal best text-rendering browser out there, but thin or particularly detailed glyphs have rendered as awfully badly sampled, unhinted, blocky lumps of shit for a while now. Chrome and Safari are the culprits &#8212; and usually hacks like toggling -webkit-backface-visibility will fix one and break the other. There've been all sorts of hacks for forcing it to resample, but all of them get squashed at some point. This one didn't work last time I tried it &#8212; but it does now!</p>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment