It’s not what you say, it’s which font you say it in
Wednesday, March 3rd, 2010
I’m redesigning this site at the moment and one thing I wanted to pay closer attention to this time around was choice of fonts. Notwithstanding the fact that web browsers were, until recently, pretty shoddy at allowing you to use the fonts you wanted to, the main reason I hadn’t paid much attention to fonts in the past was that it’s so darn hard picking one, for a number of reasons:
- There’s so damn many of them
- There’s no relation between names and appearance (as opposed to, say, #f60283 being guessable as a garish pink, closer to red than to mauve)
- They’re difficult to preview and compare
So in the interests of productivity, quality and, dare I say it, working smarter, not harder, I’ve devoted some time to sorting out how I choose fonts, reduced to the following four steps:
- Organise your fonts in themed folders
- Find a good stand alone font previewer i.e. don’t rely on photoshop and windows’ poor tools
- Narrow down to a short list
- Use javascript to make quick comparisons easy
Read on if your curiosity is piqued.
1. Organising the fonts
Windows’s default font collection (and, I imagine, Apple’s too) and the collection of 2000 fonts I also use are organised alphabetically which is rubbish. Unless you have web design OCD you’re unlikely to want to narrow down your choice of font by it’s first-letter. But, on the other hand, it is difficult to categorise fonts; I’m yet to see a website do it effectively, and I’m not entirely happy with my choice. But in the end I plumped for the following: serif, sans-serif, script, stylised, symbol, stencil.
Stencil could easily fall within stylised, and stylised could easily be split into subfolders (Art Deco, Gothic, Celtic …), and I realised part way through that I should have a subfolder within symbol for fonts depicting alphabets other than Roman, but I think a minimal folder system would be serif, sans-serif and other. In the serif and sans-serif folders I included only sensible fonts you could print a book not aimed at children in, which I think is a useful distinction to make; often the hardest task when picking fonts is to find the one which is subtly different to other ordinary fonts, but somehow suits the design better than almost indistinguishable alternatives. Cutting out all the fancy fonts makes this task a lot easier.
So once you have all these folders put a copy of each font you have in one of them, and you’re ready for the next step. You don’t need to bother with installing them yet.
2. Previewing your fonts
My criteria for a good font-previewer are:
- Choice of text to use for the preview
- Choice of text-size and colour
- Ability to organise fonts how you want them organised
- Speed and ease of switching between one font and another
- Ease of installing a font
Windows’ control panel fails to meet conditions 1 and 2, and Photoshop’s built-in font selector fails to meet 3 and 4, and they both force you to install a font before using it. The best free solution I’ve come across for Windows which meets all 5 conditions is Fast Font Preview.
3. Short-listing
Once you’ve got Fast Font Preview installed you can start picking your shortlist. Simply browse to your organised font folders, click on settings to type in your sample text, adjust the font-size to what you want, and double click on any contenders. Once the font is opened you can install with one click. While the font is open you’ll also want to jot down its official font name.
4. Use javascript to make comparisons
This is where I stop being pedantic and hopefully can be of some use. Insert the following script into the head of your web-page-in-need-of-a-font, substitute your list of font names and the id/tag name of the elements to be affected and, hey presto, a handy font-switcher should appear, making choosing exactly the right font much easier. If your web page already uses javascript then add the body of the function to your existing onload event. (NOTE: It tends to work better in Google Chrome than other browsers as Google Chrome seems to be a bit more forgiving when it comes to font names).
window.onload = function() {
var body = document.getElementsByTagName('body')[0];
var id = '';
var tagName = '';
var fonts = 'Comma,separated,list,of font,names';
fonts = fonts.split(',');
var elements = (id) ? [document.getElementById(id)] :
(tagName) ? document.getElementsByTagName(tagName):
[body];
var switcher = document.createElement('DIV');
switcher.setAttribute('style','position:absolute;top:0;right:0;background:white;z-index:200;padding:10px;');
for(var i=0, il = fonts.length;i<il;i++){
createButton(i);
}
body.appendChild(switcher);
var buttons = switcher.childNodes
loadFont(0);
function createButton(pos) {
var button = document.createElement('a');
button.innerHTML = fonts[pos];
button.setAttribute('style','display:block;padding:2px;');
button.setAttribute('href','#');
button.onclick = function() {loadFont(pos);};
switcher.appendChild(button);
}
function loadFont(pos) {
for (var i=0,il=elements.length;i<il;i++)
{
elements[i].style.fontFamily = fonts[pos];
}
for (var j=0,jl=buttons.length;j<jl;j++) {
buttons[j].style.backgroundColor='';
}
buttons[pos].style.backgroundColor='yellow';
return false;
};
};














