Kimler Sidebar Menu
Kimler Adventure Pages: Journal Entries
xBrowser Fonts
For years, web designers and bloggers have been limited to a select number of "web-safe" fonts. With the Jun 30th release of FireFox 3.5, it's now possible for cross-browser font embedding using the CSS3 @font-face selector. Here's a tutorial to show you how
Expand Your Font Palette Using CSS3
In a tale involving proprietary font formats and a week-old release of FireFox, I'm here to say that using the CSS @font-face selector to spice up your website typography is an easy, light-weight, valid and cross-browser solution. Finally, fancy fonts for the masses!
Can this be true? You bet your sweet bippy! Read on.
History: The Web as a Typographic Wasteland
from da'Hood?
Skip all da teknical shite dawg, an' head heer to pimp dem fonts - fas-like!
For the past decade, web designers have been limited to a selection of about 13 or so "web-safe" fonts. Out of hundreds of thousands of available fonts, this is a tad limiting.
While it's theoretically possible to utilize any font you want for a web site, in order for it to display properly, each visitor must have that particular font loaded on their computer. Because of this requirement, web typography has been a wasteland, limited to only a short list of commonly available (web-safe) fonts.
There have been several attempts to circumvent this problem and below, is a list of some of the most common. All have their short-comings and for me - no disrespect to very creative, determined and knowledgeable people - they all fall into the category: "life shouldn't be so hard"!
- Image Replacement (typography as a graphic is seen by everyone - except search engines - and one has to play CSS games, to attempt to achieve both objectives).
- sIFR (sIFR means "Scalable Inman Flash Replacement", based on work done by Shaun Inman, et. al. A convoluted solution that relies on JavaScript and Flash technologies to replace web-safe text with a Flash image of the text, in your chosen typeface.)
- Cufón - a JavaScript image replacement technique that's a worthy alternative to sIFR. The name is derived from "CUstom FONts".
- FLIR - A server-side PHP script that dynamically generates images of text in the font-face of your choosing. PHP5 is recommended and requires GD library (with FreeType and PNG support enabled).
CSS3 @Font-Face Embedding to the Rescue
Even though the ink is still drying on the official June 30th release of FireFox 3.5, which supports the @font-face CSS3 selector, there has been much buzz about how this will herald a new, creative web-font landscape. Truth is that Safari has supported @font-face for a while now and Opera 10+ is reportedly going to be supporting supports it as well.
In the Inspect Element Web Design & Development Blog, Tom Kenny writes, "Currently only Firefox 3.5 and Webkit browsers such as Safari and Google Chrome will render [the @font-face selector]. Of course, older browsers such as IE6 and IE7 will not support it and with IE8's distinct lack of CSS3 feature [sic], that doesn't support it either." (Source: "Go Beyond Web Safe Fonts with CSS3")
I know it's popular to bash Internet Explorer, but Tom (and others) need to check their facts before they publish false information!
Firstly, Microsoft has been supporting font-embedding for over a decade (since IE4 in 1997) and also the font-face tag and @font-face CSS selector. Secondly, the @font-face selector was a 1998 CSS2 recommendation (dropped in CSS2.1). It's made a comeback in CSS3 and hopefully will become a web standard.
Secondly, Chrome doesn't support @font-face by default. (Apparently, Google supported it in an early beta release and then disabled it for subsequent releases, for "security reasons". To activate it, users must add a command-line switch --enable-remote-fonts .) (source)
The beauty, of course, is that it's now possible to embed fonts for IE6, IE7, IE8, FireFox 3.5+ (PC & Mac), Safari (PC & Mac) and (soon) Opera 10. According to our June 2009 web stats, that's over 97.5 percent of our visitors - about as "cross-browser" as you're going to get in today's online world! (Dunno about macIE or other browsers ... I'll have to rely on reader feedback.)
How @font-face Works: Easy Peasy
The great news about CSS3 support of the @font-face selector, is that - unlike work-a-round techniques - it's easy to use. Yay! Fonts without hoops!
Just upload the font file you want to use to your server - making sure that you're not violating any copyright rules - then embed it, using the following CSS:
Code:
| @font-face { | |
| font-family: yourFontName ; | |
| src: url( /location/of/font/FontFileName.ttf ) format("truetype"); | |
| } | |
| /* Then use it like you would any other font */ | |
| .yourFontName { font-family: yourFontName , verdana, helvetica, sans-serif; | |
| } | |
The CSS code above defines a font called "yourFontName". You may use the actual font name - or - for testing purposes a unique, made-up name. Whichever you use, all you need to do is reference it again in the CSS, wherever you want to use it.
That's it! Note: the CSS3 specification provides for several font formats: "truetype" (ttf), "opentype" (ttf,otf), "truetype-aat (ttf), "embedded-opentype" (eot) and "scalable-vector-graphic" (svg,svgz).
C'mon, is it Really that Simple?
LOL ... of course not!
If there's one thing we've all learned about the Internet, nothing is really that simple and embedding fonts using the "new" CSS3 @font-face selector isn't any different.
"So, what's the issue?" you might ask.
Though Microsoft has been supporting font embedding since IE4 (1997), it's current support for @font-face is done a tad differently. Different enough, that it'll ignore a pure, valid CSS3 version. Internet Explorer supports only their proprietary "Embedded OpenType" font (eot) file format and it will incorrectly parses CSS that includes "format" values.
To achieve cross-browser compatibility, one must create some redundant CSS. The overhead isn't much and the gains, of course, are great. Using Microsoft's free WEFT tool (or this easy Online TTF->EOT Converter), one can create a Microsoft proprietary OpenType font file (having an EOT extension). Upload both the EOT and TTF files to your server. Using a single @font-face selector, load the Embedded OpenType font (EOT) for IE6, IE7 and IE8 first then the TrueType Font (TTF) for FireFox 3.5+, Safari (Win & Mac versions) & Opera v10+. BOOM ... you've just served the vast majority of your website visitors. In addition, the process degrades nicely. Browsers that can't load your special fonts won't miss a thing, as they'll be using the secondary, tertiary or generic fonts you specify. Additionally, the process is relatively future-proof. If Internet Explorer ever does support the CSS3 @font-face rules, then it'll simply utilize that bit of code already there. If not, you're covered there too.
An example of some final, CSS3-valid code might look like this, for a cross-browser compliant embedded font:
Code:
| @font-face { | |
| font-family: " your FontName "; | |
| src: url( /location/of/font/FontFileName.eot ); /* IE */ | |
| src: local(" real FontName "), url( /location/of/font/FontFileName.ttf ) format("truetype"); /* non-IE */ | |
| } | |
| /* THEN use like you would any other font */ | |
| .yourFontName { font-family:" your FontName ", verdana, helvetica, sans-serif; | |
| } | |
Though you can name use any font name, use the real one (capitalization matters) for the "local" declaration. This will give non-IE browsers an opportunity to look for the font on your visitor's computer. If it's loaded, it'll saves a TTF download. (Note: The local declaration is required, because it confuses Internet Explorer, which will fall back to the EOT file without trying to download the TTF).
Hints, Tips & Observations
I'm no font expert, just a web developer that's eager to utilize more than a limited number of fonts. When I realized that it would be possible to utilize embedded fonts for over 95% of our visitors, I spent a fair bit of time, playing around. Some of what I discovered along the way, contradicted what I've read elsewhere. Below is a brief list of this empirical knowledge, which I hope will help more people to use and understand this technique of font embedding.
- Use TrueType Fonts - Even though the CSS3 @font-face selector provides for several font formats, WEFT will only convert TrueType fonts (Supposedly, WEFT will convert OpenType fonts as well, but the few that I tried didn't work, as they didn't show up in the selection list of "embeddable fonts").
- Some TrueType fonts won't convert - Some fonts are designated as "non-convertible" by the designer, or there are other problems. WEFT shows a list of available fonts.
- Converting OTF to EOT is More Work - Presently, it's a two-bank shot. First, convert the OTF file to TTF using FontForge or this free online font converter . Then you can use WEFT, FontForge, ttf2eot or TTF->EOT to convert the resulting TTF to an EOT.
- Put IE First - In the CSS, it's important to put the IE EOT "src" first. It's also important that "src" is the only declaration. If you add "local" or "format", IE won't understand it and it will fail.
- CSS3 doesn't do EOT - Despite reading that the "embedded-opentype" (EOT) is one of the formats allowed in the CSS3 @font-face selector, it either doesn't work, won't read the MicroSoft proprietary EOT flavor, or something else as I couldn't get FireFox to utilize the same EOT font file as Internet Explorer. (Pity, as it means loading the TrueType version, as well as the proprietary EOT version).
- Understanding "Allowed Roots" - There are a few tricks to understanding WEFT. A big one: the EOT font file you create will only work for URL's you designate (i.e., "allowed roots"). If you own your own domain and want to be able to use the font file on any page, you'll need to specify both the "www" and "non-www" roots. (e.g., http://www.randsco.com and http://randsco.com).
- Using WEFT Dont' use the WEFT wizard. WEFT wants to create a "font object" and subset it for any and all fonts it finds in webpages you specify. All you really need is the conversion part of WEFT. Here's an easy WEFT workflow:
- Load your TrueType font (i.e., drag it into the Windows font folder);
- Start WEFT (it'll create a database of "loaded fonts" on opening, so you'll need to rebuild the database if you load your font while WEFT is running);
- Pick the font(s) you want to convert (Tools > Fonts to Embed > Add... > Select a font on the list > repeat if you want to convert more);
- Close the window and then do the conversion (Tools > Create Font Objects > Set location of the font object and "allowed roots" > Finish);
- Upload your newly-created EOT font file to your server (I generally rename mine and make all the characters lowercase).
- Testing can be tricky - In the @font-face CSS, if you use the actual font name for either the "font-family" declaration or the "local" declaration and that font is loaded on your computer, non-IE browsers IE Browsers IE browsers will never grab a local font. Once a "src" is specified, it'll download the EOT, every time. It doesn't matter if you specify the real name in the @font-face selector, or any other selector, for that matter. Click for the source of this information (based on IE4 behavior). It's the last question on the MSDN Frequently Asked Questions (at the bottom of the page). will grab your locally-loaded font (i.e., doesn't test the font download). To make sure that the browser is downloading the font from your server correctly, you'll need to either (a) unload the font from your local computer or (b) rename the font in the CSS to something you know doesn't match any of your loaded fonts.
-
src: local("font name"),
local('fontName'),
local("otherFontName"),
local('some other font name'),
url(../font/font.ttf) format('truetype'); Load Local - Once you determine your font download is working, rename the font in your CSS to its true name. Your visitor might have that font installed. You can use multiple local() declarations. If you know the font might have several names, use this to your advantage, like the example here (note syntax options). Non-IE browsers will look for the font in each location, stopping when it finds one or at the TTF download. (IE doesn't look locally in @font-face, so don't even try adding local() for the EOT line).
Conclusions
Because FireFox 3.5+ supports the CSS3 @font-face selector, cross-browser font embedding is now both possible and practical. The effect this will have on the web should be dramatic, replacing a decade-old typographic wasteland with a tastier and richer diversity of fonts.
While cross-browser deployment isn't ideal, the benefits of utilizing CSS to embed fonts is obvious: It's lightweight; it's valid CSS (CSS3); it's easy to do; it's search engine friendly; it's cross-browser compatible; and (yay) it relies neither on either JavaScript or Flash. The only downside is the slight overhead in downloading font file(s) and -
depending on browser settings
Defeating Font Embedding
Internet Explorer
In Internet Explorer 8, users may elect to disable font downloading or they may ask to be prompted, resulting in a message similar to the one below. (I believe, by default, this is set to "enable", so visitors would have to explicitly re-set the value and the majority won't).
To reset in IE8: Tools > Internet Options > Security Tab > Custom Level > Downloads Section > Font Download (last one in the section).
FireFox
In FireFox, users can elect to replace all web fonts with fonts of their choosing. (This is defeated, by default and again, it would be up to users to explicitly re-set this value and the majority won't).
To reset in FFx: Tools > Options > Content Tab > Fonts & Colors (Advanced Tab) > un-tick "Allow pages to choose their own fonts, instead of my selections above").
- may not render even for those browsers that support it. No worries! The technique degrades nicely to the normal "web-safe" or generic fonts you specify.
Now Go have some fun!
UPDATE 25-Aug-2009: I've recently found two online TTF->EOT converters:
- Casey Kirsle's TTF to EOT Font Converter (easy-to-use & works)
- Sebastian Kippe's Converter (which doesn't appear to be working at the moment)
Hint: Both conversion tools are based on an Open-Source utility called "ttf2eot". The utility is written for a UNIX O/S, but the download ships with a windows-based, command-line binary. (See the ttf2eot demo page for more information).
UPDATE 30-Aug-2009: Found an easy online converter that converts OTF to TTF (it also converts .dfont files to .ttf). Works a treat!
UPDATE 1-Sep-2009 Opera 10 released It supports @font-face, but is picky about the syntax in the "local" declaration. Needs local('font') or local("font"), but won't interpret local(font).
UPDATE 4-Sep-2009: Based on work by Paul Irish and Andrea Giammarchi, the cross-browser @font-face CSS has been improved. (Learn How)
UPDATE 8-Sep-2009: Had a devil of a time getting the Chrome command-line switch to work, until I discovered that it's --enable-remote-font (not --enable-remote-fonts - plural). (EDIT: The problem was likely some internal developer confusion over the spelling, but issue appears to be limited to version 2.0.172.43 (and earlier?). I'm now on v3.0.195.21 (winXP sp3) and it's definitely plural.)
UPDATE 19-Oct-2009: Looks like the next release of Chrome will have font-embedding turned "on", by default.
























There is still a slight "flash of unstyled fonts" on first visit however it's minor.
The problem seems to be limited to FireFox, as all the IE's and Safari render fancy fonts without that "flash".
A good font really makes a page. Doesn't it?
Fonts can enhance a page, but - like any design element - they can be abused, make a page look horrid, as well.
@font-face {
font-family: Kunstler Script;
font-style: normal;
font-weight: normal;
src: url(styleKUNSTLE0.eot);
src: url(stylekunstler.ttf) format("truetype");
}
Its fine in IE, but just can't get it to display in FF 3.5.2.
First, I see no benefit in setting font-style and font-weight to "normal", as both are defaulted to "normal" anyway. For the sake of brevity, omit them.
Second, your results are odd, because testing shows that FFx would be the browser that understands this code, not IE. (IE doesn't understand "format()" and skips over tries to download a very strange font file, which results in a 404 "File Not Found" from the CSS contained in this @font-face selector).
Bottom Line: You'll need to use two @font-face selectors Use one @font-face selector, as described in the examples above.
Hope this helps.
I've actually just written up a summary of all the @font-face implementation syntax techniques, along with the best one I think there is... which hasn't been covered yet!
Bulletproof @Font-Face implementation syntax
I'd invite you and everyone to give it a peek.
*runs off to look at server logs*
This technique replaces text by cached images that are created server side. One of the advantages is that the XHTML source contains the 'normal' text so it's read by bots.
However the latest HTML5 techniques (not only the fonts) are awesome. It won't be long before I completely ignore backward compatibility. I've waited too long for this.
Maybe degrade gracefully like we did with jS: "You have a shitty browser, contact the vendor."
@Foppe - In the past, I've done zero font replacement because all the techniques were just too much work. I'm thrilled that now over 97% of our visitors get fancy fonts with @font-face!
Thanks.
This is incorrect. There was one version of Chrome - which is the one you might have tested on - that has @font-face linking enabled. In the very next release they turned it off.
My understanding from Ralph Herrmann's webfonts blog is that it can be enabled by launching Chrome with a particular command-line switch.
Nice write up.
Cheers,
Richard Fink
LOL ... turns out - I did. I spent so much time the other day, testing and retesting Paul's "bulletproof" CSS, that I left that fancy font loaded on my computer. (Bit by #8 in my own "hints" section!!). Oops. My bad!
Hopefully, Chrome will support @font-face 'out of the box' at some point in the future. *goes to fix the text copy* (In addition to embarrassing myself of Ralf's blog, I've included his information on Chrome support).
Thanks, Richard, for pointing this out, making me look twice and for the informational link!
Once font-linking really gets rolling - and if FF supports the new iteration of EOT it will happen really fast - investing in a font-management program that can dynamically load/unload or install/uninstall fonts quickly and easily becomes a must-have in any web designers toolkit.
Don't feel bad. I reported that Chrome had font-linking, too.
I wasn't wrong, and neither were you, technically.
It did support it, but then, in the next upgrade, they turned it off!
Cheers, rich
My code looks like this
<style type="text/css">
@font-face {
font-family: kingthings;
src: url(/kingthings.eot);
src: local(kingthings), url(/kingthings.ttf) format("truetype");
}
.kingthings {
font:kingthings;
}
</style>
<p class="kingthings">test123</p>
The ttf and eot files are placed in the root. I've tested on IE8
st here
To be able to post the code here, I have replaced the < and > than sign with < and >
Two quick comments:
1) I hit the www.gaz.gk link and didn't see a test page. I also tried hitting www.gaz.dk/kingthings.ttf and got a 404. (i.e., a link to your test page would help and are you sure the font is where you think it is?)
2) AFAIK, the font directive in the "kingthings" class won't work. If you use "font" shorthand, you need to include (at least) the font size and family, in that order. Try:
a) {font: 100% kingthings,sans-serif; }
or (non-shorthand)
b) { font-family:kingthings, sans-serif; }
Discovered that the Chrome command-line switch to enable @font-face is --enable-remote-font (singular) ... as opposed to --enable-remote-fonts (plural).
It's being reported around the web incorrectly, no doubt because developers are mixing it up.
Tested. Article updated.
The fancy fonts in your "Empress Design & Print" site looks fine in my FireFox3.5 (and IE8)?
(Assume you got it sorted & sorry for the response delay)
But I guess the code is ok then so I'm just doing something else wrong!
@font-face {
font-family: "Little Days";
src: url(../fonts/Little-days.eot ); /* IE */
src: url(../fonts/Little-days.ttf) format('truetype');
}
h1 {
font-size: 40px;
font-family: "Little Days","Trebuchet MS", Arial, Helvetica, sans-serif;
font-weight: normal;
line-height: 30px;
}
Is there something wrong with the code? Any suggestions?
>Discovered that the Chrome command-line switch to enable @font-face is --enable-remote-font (singular) ... as opposed to --enable-remote-fonts (plural).
--enable-remote-fonts is working for me. ??
Also, with regards to using local('fontname') as a way of preventing IE from attempting to download the TTF font file, Opera does not seem to support local() in my testing.
Can anyone confirm?
1) Keep in mind that testing your @font-face cross-browser can be difficult (see #8 in Hints above). Browser version, cleared cache, code syntax, locally loaded fonts, file type, conversion success and file location all affect results.
2) I don't mind helping you sort your @font-face issues, but posting a link to your test page helps me far more than pasting code (saves you work too!)
What you say about "Quicksand" confirms my findings that not all TTF fonts can be successfully converted to EOT using WEFT. Did you try one of the online converters? (This one or This one)
RE: Your code is missing the necessary local() bit, which is what makes IE lose it's head and focus on the EOT line, instead of the TTF line.
[i.e., src: local("Little Days"), url(../fonts/Little-days.ttf) format("truetype");]
and thanks a lot for your help!
So, Little Days works now - almost! My next "challenge" concerns scandinavian characters (ä, ö) which eot didn't preserve for some reason.
It's --enable-remote-font for me, as plural doesn't work (and why I was frustrated, when I first tried to use it).
I'm still digging into this. I've been rooting around in the Chromium/Webkit code and realize there's a way to enable remote fonts via the preferences file (just not sure the syntax). While I've seen the command-line switch as --enable-remote-fonts (plural) in the code, I can't explain why it doesn't work for me (it's singular in a couple of the bug / review responses).
What version of Opera are you using (and platform)? Do you have a link to the test page that's not working for you with local()? (I'll come round and have a peek with my version - 10.00/b1750/Win32/XP).
I was wrong about Opera and local(). That's not why Paul Irish's syntax isn't working.
Will explain, along with presenting an alternate syntax, shortly.
As far as Chrome - using ver 3.0.195.20 on win xp SP3.
It's definitely "fonts" plural, for this version but I admit, I haven't tried the singular. Maybe both work!
Regards, Rich
Eager to see your Opera stuff + alt syntax.
Alternate CSS syntax with notes is now online.
Syntax that makes Opera happy, keeps the backward compatible @font-face declarations separate from the forward compatible ones without relying on IE Conditional Comments, avoids any additional HTTP request(s) by IE, and leaves local() as an option, not a requirement.
Mo' Bulletproofer @Font-Face CSS Syntax
CSS: http://customagentwebsites.com/agentsuccess/wp-content/themes/FlexxCanvas-Arial/style.css
@font-face {
font-family: 'PortagoITC_TT';
src: url(http://www.customagentwebsites.com/agentsuccess/wp-content/themes/FlexxCanvas-Arial/images/PortagoITC_TT.eot);
src: local('PortagoITC_TT'), local('PortagoITC_TT'),
url(http://www.customagentwebsites.com/agentsuccess/wp-content/themes/FlexxCanvas-Arial/images/PortagoITC_TT.ttf) format('truetype');
}
[Ignore the lack of styling and margin issues as this is a work in progress]
@Brian - LOL ... just replying with your solution, as you wrote. To avoid similar problems, I created a /fonts folder off of the webroot, which has the side benefit of shortening the CSS [i.e., src: url(/fonts/font.ttf);]
Glad you got it sorted.
So please help me to fix this problem i am using ML-TTKarthika.ttf font (Indian language) is using this website
Current CSS
@font face{
font-family: ML-TTKarthika;
src: url(fonts/MLTTKAR0.eot);
src: url(../Fonts/ML-TTKarthika);
}
Recommended CSS
@font-face{
font-family: "ML-TTKarthika";
src: url(/fonts/MLTTKAR0.eot);
src: local("ML-TTKarthika"), url(/fonts/ML-TTKarthika.ttf) format("truetype");
}
1) It's a good habit to put quotes around your font-family & local() ... covers the case where a font name has a space in it and Opera requires it for local().
2) Putting a slash (/) in front of the fonts directory tells the server that fonts is off webroot and changes it from a relative to an absolute path (it's also domain-independent, so if you move to a different domain, your links won't break).
3) Local() is required for this syntax to work (it confuses IE, which will then fall back and pick up the EOT file, while other browsers will pick up the TTF. Besides ... some users might actually have the font loaded, which will save server load if they do.
4) You'll need to include the ttf file extension and I'd put the file in the same /fonts directory as the eot file (keeps things simple).
5) *EDIT* forgot to tell the browser to expect "truetype" - added.
6) *EDIT* forgot the dash in @font-face too! (Sometimes it's the simple things!)
Hope this helps.
Make a simple sample page with the font in the same directory as the sample page and test to make sure the correct font is showing up without the complications of a lot of CSS on a complex page.
How was the EOT created?
There's always the possibility it's corrupted or has root strings enabled and IE is simply refusing to display it.
A simple sample page will reveal that.
Always a good idea to take variables out of the mix and test for basic functionality first.
Cheers, Rich
While I tend to "cowboy" things, a simple test page is a good place to fall back, before you start banging your head against a much more complicated wall.
Thank you, Thank you, Thank you, Thank you, Thank you,
Thank you so much. Finally it is working in IE and fire fox. Not in working in Google chrome. I was looking to resolve this issue almost 1 month; finally you fix it for me (STK). I don’t know how to express my sincere thanks to you. Again thank you so much for helping me. One more question this code work for Google chrome?
Yes, the code works in Google Chrome. Unfortunately, Google has disabled remote font embedding, because of "security problems". To enable it, one must start Chrome with an "--enable-remote-fonts" flag.
Chrome developers are hoping to get the security issue resolved and enable font embedding (soon).
Richard - Funny!
The site I'm hacking on is http://art.waywardgypsy.com/ which is a work in progress.
Any hints?
If you are following the tips for cross browser @font-face syntax as has been discussed here (follow links, too!), the culprit is probably a bad EOT file.
In any event, that should be what you test for first with a bare-bones page, just for IE.
Do the fonts show up then?
Cheers, Rich
Either I've done something wrong, or browserlab.adobe.com doesn´t fetch the @font-face fonts for IE.
Would anyone be so kind and confirm, or even better give me a hint om what's wrong?
font-family: "Zapfino";
src: url( /fonts/Zapfino.eot ); /* IE */
src: local("Zapfino"), url( /fonts/Zapfino.ttf ) format("truetype"); /* non-IE */
}
zapfino is a script font, no?
I'm not seeing it in any browser.
Are you?
First thing I would do is move the @font-face declaration up to the top of the style sheet. And then move the part of it that's for EOT, into its own @font-face declaration right above it. In other words, two @font-face declarations, the first one specifically for IE.
See what happens.
rich
The bad news is that the TTF file is corrupt (assume the EOT too). It downloaded on my XP machine as a 517KB file, which seemed a tad large and wouldn't open - "not a valid font file".
More good news. I was able to snag a free copy of the (comes-with-a-Mac) Zapfino font following the links on this page. It's only 77KB and you can download it here.
I'll leave it to you to make the EOT, though I do recommend you follow Richard's suggestion and put any/all @font-face selectors first in your CSS.
Hope this helps.
Once again, the magic man. From here on in, when I run into trouble with @font-face, I'm asking you!
I think a diagnostic "best practice" is beginning to emerge here.
#1 Check that the fonts show up in a simple demo page, free of anything that might mask a basic problem with the font itself.
The TTF is from my Mac, and the EOT was created from console using ttf2eot.
517K Zapfino.eot
516K Zapfino.ttf
FireFox (3.5.3 Mac) recognize correct filetype for both.
I noticed that it´s not only IE that don´t use the provided fonts. Non of the browsers on Windows displays it. Mac works as it´s embedded there.
I tried the fonts you found online too, without luck I´m afraid.
(http://titti.bull.owren.no)
Tested http://www.alistapart.com/d/cssatten/poen.html, and it seams like non of the Windows browser it provides supports @font-face.
Try browsershots.org.
Web fonts show up on their screen shots. Works fine.
rich
Secondly, I don't have a Mac (Help change that! Download my FireFox design entry, vote for it and leave a comment at the WebMynd design contest!
Have a look at this test page, where I've used your CSS and point to the EOT and TTF file I suggested you download earlier. It *should* look fine in your Mac (Safari or FireFox3.5+). It also looks fine in IE6,7,8; winSafari; FireFox3.5 and Opera10 on a PC. (Try that service Richard mentioned).
I did have to fiddle with the font sizing, as your font stack sizes were a tad small for the Zapfino font (which is one of my gripes about CSS: You can't easily assign font sizes for each font in a font stack - independently).
EDIT: Though the fonts show fine, you've got some CSS breaks in the menu area between IE8, IE7 and IE6 ... plus the Tittinn graphic appears to be a PNG with transparency, which doesn't render in IE6 (change to a GIF and you'll be fine).
I was initially impressed at the selection of platforms and options, but (a) why are so many selected by default?; (b) why are there only 'ads' under Mac OS? (no browsers to select) and (c) a lag time of 19 minutes for my 2 shots is too long between iterations and I couldn't use this for site development. Bummer.
Far from perfect but better than nothing. Now you'll know to initiate the preview right before lunch.
I uncheck nearly all the browsers except the important ones. Much faster and manageable.
Stk, I switched to the font you found and it now works in IE8.
I installed Windows 7 through Parallels and tested Opera 10.
Nope, no Zapfino fonts seen there.
BTW: http://www.webmynd.com/look/designs/by_id/68 gives a 500 internal error page.
Found out about another couple of browsershots.org type sites.
Tried one and it works great so far. Speedy too.
http://ipinfo.info/netrenderer/
for testing your site in earlier version of IE.
Rendered really fast. Picked up the webfonts, everything.
http://litmusapp.com/browser-testing
This one I haven't tested yet but if it works anything like the first, far better than b-shots.
There's a link to this from the first one so go there first.
cheers, rich
BTW, a reader (via email) came across a TTF font that wouldn't load in FireFox. In an effort to determine why, I installed FontForge and made some interesting discoveries. I'll be sharing them in an upcoming post. (You work w/FontForge much?)
Lost Souls - Glad you like the tutorial. Thanks for saying so and good luck getting those Rock'n-Roll fonts going (and with the band)!
big YET. I'm a windows guy who's going to have to invest in a Mac. don't want to go to the installation troubles of installing fontforge on windows.
love to hear what you've discovered.
Major rumblings in the web fonts department over the past few days. Two web fonts related articles in AlistApart:
Alistapart
And my own chirpings from the trees:
An Open Letter To Retail Font Vendors
IMHO - web designers will, and should, become active in screen font design - especially in the tweaking and repairing of existing fonts with open licenses. Unfortunately, I don't believe the "pros", that is, the retail font design community is going to be of much help.
And we'll soon see where Microsoft stands in all this, too.
Let's proceed. (As if we weren't going to!)
rich