mcdruid.co.uk - comic sans http://mcdruid.co.uk.php53/taxonomy/term/76/0 en the elusive cursive font stack http://mcdruid.co.uk.php53/content/cursive-font-stack <div class="field field-type-filefield field-field-image"> <div class="field-items"> <div class="field-item odd"> <img src="http://mcdruid.co.uk.php53/sites/mcdruid.co.uk.php53/files/imagecache/thumbnails/sites/mcdruid.co.uk/files/images/comic_sans.png" alt="" title="comic sans in ubuntu" width="150" height="26" class="imagecache imagecache-thumbnails imagecache-default imagecache-thumbnails_default"/> </div> <div class="field-item even"> <img src="http://mcdruid.co.uk.php53/sites/mcdruid.co.uk.php53/files/imagecache/thumbnails/sites/mcdruid.co.uk/files/images/purisa.png" alt="" title="parisa in ubuntu" width="150" height="23" class="imagecache imagecache-thumbnails imagecache-default imagecache-thumbnails_default"/> </div> <div class="field-item odd"> <img src="http://mcdruid.co.uk.php53/sites/mcdruid.co.uk.php53/files/imagecache/thumbnails/sites/mcdruid.co.uk/files/images/urw_chancery_l.png" alt="" title="urw chancery l in ubuntu" width="150" height="33" class="imagecache imagecache-thumbnails imagecache-default imagecache-thumbnails_default"/> </div> <div class="field-item even"> <img src="http://mcdruid.co.uk.php53/sites/mcdruid.co.uk.php53/files/imagecache/thumbnails/sites/mcdruid.co.uk/files/images/ios_cursive_fonts_screenshot.png" alt="" title="Chalkboard and Market Felt on a (simulated) iPhone running iOS 4.3" width="150" height="285" class="imagecache imagecache-thumbnails imagecache-default imagecache-thumbnails_default"/> </div> </div> </div> <p> There are some great articles and resources out there on the interweb about using <em>font stacks</em> in your CSS to ensure your site has the best chance of working well and looking as it's intended to on any combination of browser and operating system / device you can throw at it. </p> <p> However, a site I worked on recently used the font all designers love to hate: <em class="comic">Comic Sans</em>. Almost all of the advice I could find about this font went along the lines of <em>"it's rubbish - don't use it"</em> (that's the polite version, obviously). </p> <p> Luckily for those of us that absolutely positively have to use comic sans (and for the record, it's actually a really good fit for the site in question), it's very widely available across the main desktop platforms, and can generally be considered <em>web safe</em>. Probably for this reason - and its unpopularity with designery types - it tends not to feature in the most popular '10 great font-stacks'-type articles. </p> <p> So, when I found out that comic sans is not included on the iPhone (or in iOS in general), I had a bit of a problem. Thankfully, there is a fairly close substitute font on iOS called <a href="http://typedia.com/explore/typeface/marker-felt/" rel="nofollow">Marker Felt</a>, and it seems to work okay as a fallback. </p> <p> [edit] not long after I came up with my font stack Apple added Chalkboard to iOS; I believe it replaced Marker Felt as the default in the Notes app, and it's arguably a better substitute for Comic Sans (see iOS screenshot for comparison). As far as I'm aware <a href="http://www.whatsyourdigitaliq.com/fonts-available-in-various-versions-of-ios/" rel="nofollow">Chalkboard is available in iOS 4.2 and later</a>, which should cover most iOS devices. I've now added this to the stack. Note the slightly arcane font name you actually have to use in the CSS.[/edit] </p> <p> [edit] a helpful commenter has pointed out that in <em>normal</em> OSX, the font is just called <em>Chalkboard</em>. So, you can add this to the font-stack too. Note though that OSX has Comic Sans (where iOS does not), so it's up to you whether you'd prefer OSX users to get Chalkboard or Comic Sans and therefore where you place it in the list of fonts.[/edit] </p> <p>So without further ado, I present to you my CSS font stack for comic sans, and the cursive font family: </p> <p><div class="geshifilter"><pre class="css geshifilter-css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span>/<span style="color: #933;">1.5em</span> <span style="color: #ff0000;">'Comic Sans'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Comic Sans MS'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Chalkboard'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'ChalkboardSE-Regular'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Marker Felt'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'Purisa'</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">'URW Chancery L'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">cursive</span><span style="color: #00AA00;">;</span></pre></div></p> <p> I found the <a href="http://www.codestyle.org/css/font-family/sampler-Cursive.shtml" rel="nofollow">font survey at codestyle.org</a> very interesting and useful in putting this together. I'm pretty confident that between Comic Sans and Chalkboard / Marker Felt most MS and apple platforms are covered. </p> <h3>What about linux and android?</h3> <p> Some sites won't care much about desktop linux, but android is surely on the support wishlist for the majority of new projects now.</p> <p> The codestyle font survey suggests around 2/3 of unix users have Comic Sans. It is included in the <a href="http://packages.ubuntu.com/search?searchon=names&amp;keywords=msttcorefonts" rel="nofollow">msttcorefonts</a> package but it's not included in stock Ubuntu. Derivative distros such as mint do include it by default I believe. There are of course other linux distros, for which the MS core fonts are also available (you're arguably looking at a small share of a small share...) but again it doesn't look like they're installed by default in SUSE, for example. </p> <p> The codestyle font survey suggests "URW Chancery L" is the most commonly available cursive font for unix (almost 98% apparently). I can however see two problems with using this font; in my testing on Ubuntu it <a href="http://support.mozilla.com/ilo/questions/695166" rel="nofollow">doesn't seem to work in recent versions of firefox</a>, and I also don't think it looks very much like comic sans (see screenshots). </p> <p> I don't know much about <a href="http://www.miriamruiz.es/debfonts/fnt-1754ebd3bc2e1eaf5b833389bd7b72de.html" rel="nofollow">Purisa</a>; other than the fact that it's installed in stock Ubuntu, and seems to be quite a nice hand-writing type font. Google tells me it's actually a thai font, but works well in English. I put it before URW Chancery L. </p> <p> Realistically if a lot of the text on your site is supposed to be in comic sans, you'll want to do a good bit of testing with how it would look using one of these fallbacks. I'm not supremely confident that a site all in Purisa or URW Chancery L would be very legible. You may decide you're better off falling back to something simple (or providing an alternative using @font-face perhaps). </p> <p> It looks like the list of default <a href="http://stackoverflow.com/questions/2065818/what-fonts-are-available-on-android" rel="nofollow">fonts available on android</a> is very limited, and sadly there's no good substitute for comic sans. You could use some form of browser / agent sniffing conbined with JS and italicise your text in android perhaps. </p> <p> On the other hand there is support for font-face if you want to supply your own substitute (although beware that one of the <a href="http://paulirish.com/2010/font-face-gotchas/#comment-33235" rel="nofollow">common 'bullet proof' font-face approaches doesn't actually work in android</a>, but there is a <a href="http://paulirish.com/2010/font-face-gotchas/#comment-35739" rel="nofollow">simple solution</a>). </p> <p> I have also come across another quirk in android font-face support when experimenting with my cursive font stack. I've tried using a font-face font at the end of the stack (but before the generic family) - the aim obviously being that the android browser will use the font-face font when it fails to find any of the others. </p> <p> This doesn't seem to work though - I can only get android to use the font-face font if it's at the start of the stack, which is not very useful when it should be the last resort fallback. A quick experiment with firefox suggests that it should work (and it's my understanding of the spec that it should - font-face is just defining another font-family for use elsewhere in the CSS). </p> <p> I'll keep looking into it, but it seems for now that a font-face fallback for android would only work via browser sniffing and scripting. Which is a shame - hopefully I'll be proved wrong on that. </p> <p> If you're tempted to supply your own copy of actual comic sans, I'd advise caution on the legal / licensing front, and also that you're careful to avoid the situation where browsers that already have the font available download your version instead. <a href="http://www.broken-links.com/2009/06/30/checking-for-installed-fonts-with-font-face-and-local/" rel="nofollow"><em>local()</em> is supposed to deal with that situation</a>, but also seems to be a cause of problems in android (as per links given above). </p> <p class="cursive-stack"> Finally here's a few words of text using my font stack, which can be used for testing on different browser / platform combinations... and a few specific fonts: </p> <ul> <li class="comic-sans">Is Comic Sans available?</li> <li class="chalkboard">Is Chalkboard (OSX variant) on your system?</li> <li class="chalkboard-ios">Is Chalkboard (iOS variant) on your system?</li> <li class="marker-felt">Do you have Marker Felt?</li> <li class="purisa">Do you have Purisa?</li> <li class="urw-chancery-l">How about URW Chancery L?</li> </ul> comic sans cross-platform CSS cursive font font-stack Wed, 15 Dec 2010 18:53:28 +0000 drew 32 at http://mcdruid.co.uk.php53