I remember reading somewhere that you can dynamically load a font into a user's computer so that you can include any font you want in a website. Is this possible - is my memory playing tricks on me?
EDIT (Removed my orignaly answer saying it can't be done).
The choice of fonts that is available across most systems is not something that thrills designers, so I know why its appealing to want to embed custom fonts your site.
It appears there are a few methods out there to do what your looking for, but nothing is yet widely supported. There for its not going to be an easy task to keep consistent across the different browsers and operating systems.
I vote you stick to what's available on the users systems, keep it a consistent style no-matter what browser or OS is used.
You will also need to look at the license details for the font your looking to embed to see how it effects you.
CSS3 provides a @font-face
directive that allows you to use arbitrary fonts on your webpages. But I doubt that it's widely adopted even with most recent browsers.
Further information:
- Web fonts with @font-face
- CSS @ Ten: The Next Big Thing
- Comparison of layout engines (Cascading Style Sheets)
- @font-face browser support
The compatibility (for TrueType/OpenType fonts) should be given with the following browsers:
- Webkit/Safari: >= 3.1
- Opera: >= 10 (most likely)
- Internet Explorer: not supported (supports only Embedded OpenType fonts)
- Mozilla/Firefox: >= 3.5
- Google Chrome: >= 2.0
- Netscape: not supported
Some browsers support downloading of fonts. See Webfonts.info and FontEmbedding.com for everything you could want to know about the subject, including technical and legal issues, and which browsers support which mechanisms.
The specification at the W3C includes some examples, like this, but not everyone supports them:
@font-face {
font-family: OCRB;
src: local(OCRB), url(http://site.com/fonts/ocrb.ttf);
}
p { font-family: OCRB, monospace; }
The W3C defined a standard for this many years ago. As with many such "standards", web browsers need not support them so you can't rely on this.
See here for a list of browsers that work.
Cufon provides javascript based text replacement - it works quite well but can slow down the computer on some fonts if you overuse it though.
sIFR does something similar but uses Flash - but I have always had problems with it so I wouldn't advise it.
The font-face css selector also provides inline font embedding, but unfortunatley since the majority of browsers do not use it it may not be worth using - at least for a while yet.
A very good answer given right here on stack overflow by a man extremely knowledgeable on the subject: http://stackoverflow.com/questions/933098/web-font-embedding-vs-sifr