Utilo

OTF MIME Type – Free, Online, Private

font/otf is the type for an OpenType font with CFF outlines. The file starts with the tag OTTO.

What .otf is

OpenType is a font container. When the outlines are CFF or CFF2 rather than TrueType glyf data, the scaler type is the four characters OTTO and the usual extension is .otf. RFC 8081 registers font/otf. A TrueType-outline font is font/ttf even though people call both 'OpenType' in conversation. The media type follows the file, not the marketing name. application/vnd.ms-opentype and the x-font-otf alias are not what you should send. WOFF 2 can wrap an OTTO font, and the wrapped file is font/woff2, magic wOF2, not this type.

IANA registers font/otf in RFC 8081. The media type is font/otf. Extensions that use it on this page: .otf. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.

What sends font/otf

What sends font/otf: Send font/otf for a .otf download or for an @font-face URL that really returns the OTTO bytes. Cross-origin use needs CORS, as with the other font types. For the web, ship a WOFF 2 derivative. Keep font/otf on the master. Do not add a charset. If a design app uploads an .otf, check for OTTO before you store the type, because a renamed TTF will fail a CFF decoder later. The file on disk is still .otf. Once the response exists, a client trusts font/otf, not the filename. If you convert OTF to WOFF 2, keep the OTTO master in storage and the web file on the CDN. The master response, if you expose it, stays font/otf. The CDN response stays font/woff2. Do not overwrite one with the other's bytes.

Content-Type for .otf

Send font/otf and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.

Content-TypeContent-Type: font/otf

nginx, Apache, and Express

These snippets map .otf to font/otf. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .otf so a stale mime database in the framework cannot disagree with the type on this page.

nginx# /etc/nginx/mime.types, inside the types { } block
font/otf                    otf;
ApacheAddType font/otf .otf
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".otf")) {
      res.setHeader("Content-Type", "font/otf");
    }
  },
}));

Pitfalls for font/otf

Pitfalls that show up for font/otf, and not for a neighboring type with a similar extension: Calling every OpenType file font/otf is the classification bug. TrueType outlines use font/ttf. Check the first four bytes. A second bug is a variable font with an fvar table served from a URL that a cache filled with the static instance. Version the URL when you change masters or axes. A third is a font tools export that writes a Mac resource fork next to the file and a server that picks up the wrong fork. Serve the data fork. A fourth is an old types map of application/octet-stream, which nosniff then blocks.

  • font/otf is the registered type. application/x-font-otf is unofficial.
  • OTTO at byte zero is the CFF OpenType signature. 00 01 00 00 is TrueType and should be font/ttf.
  • A WOFF 2 package of this font is font/woff2, not font/otf.
  • PostScript outlines do not mean the HTTP body is application/postscript. The font package is font/otf.

Frequently asked questions

How is font/otf different from font/ttf?

font/otf is for an OTTO file, CFF outlines. font/ttf is for a TrueType outline, scaler type 00 01 00 00 or true.

What is the signature?

The four characters OTTO.

Is application/vnd.ms-opentype the right type?

No. RFC 8081's type for this file is font/otf.

Should pages use this type?

Use font/woff2 on the site. Use font/otf when you are actually delivering the OpenType file.