font/otf means: font/otf is the registered media type for OpenType Font files, a format extending TrueType with support for CFF/PostScript outlines and advanced typographic features like ligatures, alternate glyphs and expanded character sets. OTF is common in professional design and publishing. Font media types identify web font files served to browsers via @font-face. The subtype maps to a font container format, and the correct type lets browsers validate and cache fonts efficiently. Modern web delivery favors compressed WOFF2; serving fonts with a generic or wrong type can trigger download failures or CORS-related blocking. You will encounter font/otf in contexts such as professional typography and design fonts; fonts with advanced opentype features; source fonts before web compression to woff2. It is commonly associated with the file extension(s) .otf. Like TTF, raw OTF is uncompressed and larger than WOFF2. Convert OTF to WOFF2 for web delivery while preserving the OpenType features your design needs. The registered type is font/otf; application/x-font-opentype is a legacy alias.
When you'll see font/otf
- Professional typography and design fonts
- Fonts with advanced OpenType features
- Source fonts before web compression to WOFF2
How to handle it
When serving web fonts, use WOFF2 for the smallest payload, set immutable cache headers, and add Access-Control-Allow-Origin when fonts are cross-origin. Reference them in @font-face with the correct format() hint and a font-display strategy (swap or optional) to control flash of invisible text. Subset fonts to the glyphs you actually use to cut download size further. As a final checklist for font types: prefer WOFF2, subset to used glyphs, set immutable caching and cross-origin CORS headers, choose a font-display strategy to avoid invisible text, and preload the critical fonts so first paint is not delayed by late font downloads.
Notes & gotchas
Like TTF, raw OTF is uncompressed and larger than WOFF2. Convert OTF to WOFF2 for web delivery while preserving the OpenType features your design needs. The registered type is font/otf; application/x-font-opentype is a legacy alias.
Examples
HTTP/1.1 200 OK
Content-Type: font/otf
Content-Disposition: inline; filename="sample.otf"
[binary font payload: the encoded bytes of a sample .otf] curl -i -H "Accept: font/otf" https://api.example.com/v1/resource # inspect the returned Content-Type const res = await fetch("/v1/resource", { headers: { Accept: "font/otf" } });
// verify res.headers.get("Content-Type") starts with "font/otf"
const text = await res.text(); // handle according to the declared type import requests
res = requests.get("https://api.example.com/v1/resource",
headers={"Accept": "font/otf"}, timeout=30)
res.raise_for_status()
assert res.headers["Content-Type"].startswith("font/otf")
with open("sample.otf", "wb") as fh:
fh.write(res.content) # raw bytes; use stream=True for large files Frequently asked questions
Is OTF better than TTF?
OTF supports advanced typographic features and PostScript outlines, which designers often prefer; TTF is simpler and widely supported. For the web both are typically converted to WOFF2.
Can WOFF2 preserve OpenType features?
Yes — WOFF2 is a compression wrapper that preserves the underlying font's features, including ligatures and alternates, so converting OTF to WOFF2 keeps typographic behavior intact.
Which font MIME type should I use for @font-face?
font/woff2 for modern compressed fonts (best compression, universal support), font/woff as a fallback. Older font/ttf and font/otf work but are larger. Always serve fonts with correct CORS headers when hosted on another origin.
Why do my web fonts 404 or get blocked?
Usually a wrong path, a missing CORS header on cross-origin font hosts, or an incorrect MIME type. Verify the server returns font/woff2 with Access-Control-Allow-Origin when the font lives on a CDN or another domain.
How do I avoid invisible text while fonts load?
Use font-display: swap (or optional) in @font-face so fallback text shows immediately, and preload critical WOFF2 files. This prevents the flash of invisible text that hurts perceived performance.
Try the Base64 Encoder
Encode and decode Base64 with UTF-8 and URL-safe options.