Over the last few years we have seen the rise of some fantastic tools to allow us to get creative with the typefaces we use on our websites. There are really two mainstream approaches here; @font-face, and of course, Flash. All of the solutions available have their drawbacks; not all are free for instance, but one thing is for sure; They are all advancing web typography for everyone. Let’s get stuck in and see what options are available to us to use different fonts on the web.
1.Google Font API
1 | <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Cantarell:italic|Droid+Serif:bold" /> |
2. Typekit
Typekit is a premium web font replacement service, with a useful free plan on a limited selection of fonts. They work with foundries from all over the world to provide their users with the best selection of fonts possible, and this shows with the number of fonts they are able to provide compared to other services; nearly 500! Some of the most influential web designers on the internet use it, and that’s testament to its quality and delivery.Typekit aims to make using custom fonts in your web design as easy as possible, and so offers two ways to implement your chosen fonts into your website. The first is via the kit editor. This Kit Editor is for those that are a little less web language savvy than some of us, and instead of having them hand code the fonts into their design, it asks you what selectors you want the font applied to (class’s, id’s, elements), and by clicking publish, Typekit will sort everything else out for you via the one line of code you insert into your html document.
If you are willing to pay premium for your web fonts then, this is the way to go. The range of premium and free fonts that you have access to, and the ease of implementation is incredible. A portfolio price plan weigh’s in at $49.99 a year, so it is all about weighing the pro’s and con’s of what you are getting with that, and whether the fonts you want to use are available under other font replacement techniques.
3. Google Font Loader
What the font loader does, that the Google Font API doesn’t is applies class’s to the page while the font’s are loaded, and after the font is loaded, allowing you specify a font to render in while the font loads. This is not supported in the Google Font API however, where for example, Chrome, IE and Safari will just not render the text until the font loads andFirefox will render the font in the browsers default font until the font loads causing a flash of unstyled text. Although you may still get a flash with Google Font Loader, the change won’t be so drastic as you’ll be able to choose that default font.
To learn how to use the Google Font Loader, Google have written a great guide here.
4. FontSquirrel
5. sIFR
However, like font-squirrel, and it’s font-face kit generator, it doesn’t limit you to a select library of fonts like the Google Font API does, and so provides much more versatility. Unlike the font-face alternatives above though, sIFR should only be used for small pieces of text, like headings. Using it on your whole site will seriously damage your site’s download time, and usability.
To learn how to use sIFR, and see an example, this tutorial seems to cover it all!
6. Cufon
Before font-face came along and became mainstream, the main rival to sIFR was Cufon. Instead of using flash, cufon used javascript, and makes use of elements such as the canvas tag on most browser, and VML in Internet Explorer. This means its more lightweight than sIFR, but still, it’s only really suitable for headings. While the text is selectable, it’s fairly buggy in that aspect. Like sIFR, there is no preset font library so you’ll be making your own kits via the Cufon Generator.
You upload your font (with different variants if require), choose your characters, and then optimise your performance (quality), and file size for your site. Once this is done, you’ll need to include cufon javascript file, as well as your generated font file, and then choose what selectors you want to apply the font to. Definitely not as tidy as some of the font-face examples. It is however, compatible with most javascript libraries, so with their support, your selectors can become more dynamic.If you want to use Cufon, Jeffrey Way from Nettuts has written an amazing article on how to, complete with video!
Tidak ada komentar:
Posting Komentar