Reputation: 42246
I know that there are various ways to use TrueType fonts and OpenType fonts directly on the web. However, I have been unable to find a canonical reference indicating how these files should be served. I have been having particular trouble determining their correct MIME type and have asked What is the correct MIME type for a font file? to help determine this.
I stumbled upon the W3C Specification for WOFF File Format 1.0, which includes a Media Type registration. The specification states that "Any properly licensed TrueType/OpenType/Open Font Format file can be packaged in WOFF format for Web use."
Because I have been unable to find a canonical source on how to handle TrueType and OpenType font files, I have hypothesized that converting the file to WOFF format may be the best practice. Is this the case?
If not, when should a WOFF file be used and when is it better to favor a corresponding .otf
or .ttf
file?
Upvotes: 1
Views: 1970
Reputation: 1571
WOFF format is good because it is essentially a gzipped raw font (thus reducing bandwidth). We've written what we consider the canonical CSS reference on how to server webfonts here: http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax
Bottom line: Yes, use WOFF. There is no advantage to using a raw font file unless you need to support older browsers that don't understand WOFF.
Upvotes: 1
Reputation: 5690
Browser support for woff (and other font formats) varies considerably. Most people will serve a variety of font resources to cover all the bases, including:
Upvotes: 0