[OpenFontLibrary] format() for .otf fonts
ben at readingtype.org.uk
Sun Apr 26 15:53:53 PDT 2009
Henri Sivonen wrote:
> It seems that all CSS snippets say format("truetype"). It seems to me
> that CSS snippets linking to .otf files should say format("opentype")
> Please include the PostScript name of the font face in local() as the
> first alternative in src. This way users who already have the font
> installed locally don't need to wait for it to download.
I've investigated both of those things now, and amended them to some
The content of format() is now mapped as follows:
pfa/pfb -> type-1
ttf -> truetype
otf -> opentype
This is loosely based on a subset of what is in
http://www.w3.org/TR/css3-webfonts/#src; the differences being
- OpenType has its own extension and without reading the font file,
which the codebase does not do right now, we can only identify Opentype
fonts as having the 'otf' extension
- I have omitted formats that OFLB is not supporting.
The use of local() depends on knowing the font's name as it is shown to
users. The current codebase can't do that because it never reads the
font file, so the contents of local() will generally be invalid (just
the filename for now).
We clearly need to come back to both these points soon...
Ben Weiner | http://readingtype.org.uk/about/contact.html
More information about the OpenFontLibrary