OpenType Font
An OTF file stores scalable glyph outlines as PostScript cubic Bezier curves in the SFNT container, identified by magic bytes 4F 54 54 4F. Developed by Microsoft and Adobe in 1996 (ISO/IEC 14496-22), it holds up to 65,535 glyphs with GSUB/GPOS layout for ligatures and variable font axes.
Font format conversion requires glyph table remapping, CFF-to-quadratic outline conversion, and hinting recalculation. These operations depend on fontTools (Python) or HarfBuzz (C++) libraries that are not available in the browser WASM sandbox. FileDex provides CLI commands and reference information for desktop-based font conversion workflows.
Common questions
What is the difference between OTF and TTF fonts?
Both are OpenType fonts sharing the same SFNT container and layout features. OTF stores glyph outlines as PostScript cubic Bezier curves (CFF format), while TTF uses TrueType quadratic B-splines. CFF curves represent complex shapes with fewer control points, often producing smaller files. Modern renderers treat both identically.
Should I convert OTF to WOFF2 for my website?
Yes. WOFF2 applies Brotli compression to OTF data, reducing file size by 20-30% with zero quality loss. All browsers released after 2015 support WOFF2. Google Fonts serves exclusively WOFF2. Use Font Squirrel's web generator or a Python font library to convert, and declare the result in a CSS @font-face rule.
What are OpenType variable fonts and why do they matter?
Variable fonts (OpenType 1.8, September 2016) embed an entire design space within a single file. Named axes like weight, width, and optical size allow continuous interpolation between extremes. One variable font replaces 12-24 separate static files, cutting page load times significantly.
How many glyphs can an OTF file contain?
The OpenType specification allows a maximum of 65,535 glyphs per font, constrained by the 16-bit glyph index. Large CJK fonts like Noto Sans CJK approach this limit. Adobe's Source Han Sans contains over 65,000 glyphs covering Simplified Chinese, Traditional Chinese, Japanese, and Korean.
Can OTF fonts display Arabic text correctly?
Yes, and OpenType is the only modern font format with full Arabic shaping support. GSUB features (init, medi, fina, isol) select the correct positional form for each letter. GPOS features (curs, mark, mkmk) handle cursive connection and diacritical mark placement. Fonts like Noto Naskh Arabic and Adobe Arabic implement these features.
Is OTF or TTF better for print design?
For print, both produce identical output because physical resolution eliminates hinting differences. OTF with CFF outlines has a slight edge in file size and is the format Adobe used for its professional Type Library conversion. Most professional type foundries ship OTF as their primary format.
What happens if an OTF file is corrupted?
Font validators check table checksums during installation. A corrupted cmap table causes all text to render as empty rectangles. Damaged CFF data produces distorted or missing glyphs. Missing required tables (head, name, OS/2) cause the OS to reject the font entirely. Re-download from the original source to fix.
How do I check which OpenType features a font supports?
Drag the OTF file into Wakamaifondue.com for an interactive browser-based report showing every GSUB and GPOS feature, Unicode coverage, and variable axes. Desktop alternatives include decompiling the font to XML with a Python font library, or using a font inspection utility to list features from the terminal.
What makes .OTF special
Four bytes at the start of a file — 4F 54 54 4F, ASCII for "OTTO" — identify it as an OpenType font with PostScript outlines. That signature is the calling card of a format born from one of the most consequential partnerships in computing history: Microsoft and Adobe, longtime rivals, joining forces against a shared problem.
Continue reading — full technical deep dive
The font wars and the birth of OpenType
By 1995, the font landscape was a mess. Adobe controlled PostScript Type 1, the professional standard, and charged licensing fees that Apple and Microsoft resented. Apple had retaliated in 1989 by creating TrueType, then licensed it to Microsoft. Windows 3.1 shipped with TrueType in 1992, bringing scalable fonts to the mass market. But now two incompatible font technologies divided the industry: Type 1 for print professionals and TrueType for everyone else.
Microsoft's answer was OpenType, announced in 1996. The concept was straightforward — put both outline technologies (Adobe's cubic Bezier curves and Apple's quadratic splines) into a single container format, the same sfnt structure that TrueType already used. Adobe joined as co-developer in 1997, bringing CFF (Compact Font Format) as the PostScript outline representation. The .otf extension identifies fonts using CFF outlines, while .ttf identifies those using TrueType outlines. Both are OpenType; the difference is purely in how glyph shapes are mathematically described.
The turning point came in 2000 when Adobe converted its entire Type Library — thousands of professional fonts — from Type 1 to OpenType. Overnight, OTF became the format of professional typography. ISO standardization followed in 2005 as ISO/IEC 14496-22, part of the MPEG-4 family.
Inside the SFNT container
An OTF file is a collection of binary tables packed into the SFNT (Scalable Font) container. The file begins with a 12-byte header: the 4-byte OTTO magic, a 2-byte table count, and three 2-byte binary search optimization values (searchRange, entrySelector, rangeShift). Following the header is the table directory — an array of 16-byte records, one per table, each containing a 4-character ASCII tag, a 32-bit checksum, a 32-bit offset from the file start, and a 32-bit length.
The required tables form the skeleton of every OTF file. The cmap table maps Unicode code points to glyph indices — without it, the font cannot associate characters with their visual forms. The head table stores fundamental metrics: unitsPerEm (typically 1000 for CFF fonts, 2048 for TrueType), creation and modification dates, and the font's bounding box. The hhea and hmtx tables define horizontal layout: ascent, descent, line gap, and per-glyph advance widths. The name table holds human-readable strings — font family name, designer, copyright, license URL — encoded for multiple platforms and languages. The OS/2 table provides Windows-specific metrics: weight class, width class, Panose classification, Unicode range coverage bits, and vertical metrics. The post table maps glyph indices to PostScript glyph names.
For CFF-based OTF files, the CFF table (or CFF2 in variable fonts) contains the actual glyph outlines as cubic Bezier curves encoded in a compact charstring format. CFF uses subroutine sharing to compress repeated outline segments — a significant space savings for fonts with large glyph counts.
Cubic Bezier vs quadratic splines
The fundamental technical difference between OTF and TTF is the mathematics of their curves. CFF outlines in OTF files use cubic Bezier curves (third-degree polynomials), defined by four control points: a start point, two off-curve control handles, and an end point. TrueType outlines use quadratic B-splines (second-degree polynomials), with only one off-curve control point between two on-curve points.
Cubic curves can represent a wider range of shapes with fewer control points. A typical letter 'S' might require 12 control points in CFF but 20 or more in TrueType to achieve the same fidelity. This means CFF-based OTF files are often slightly smaller than their TrueType equivalents. The trade-off is that quadratic splines are computationally cheaper to rasterize — a consideration that mattered in the 1990s but is irrelevant on modern hardware.
Conversion between the two formats is mathematically possible but not lossless in the cubic-to-quadratic direction. A cubic curve can only be approximated by a series of quadratic segments. Converting OTF to TTF introduces infinitesimal rounding errors that may be visible at extreme magnifications but are invisible in normal typographic use.
OpenType Layout: GSUB and GPOS
OpenType's most powerful capability is its layout engine, expressed through two tables: GSUB (Glyph Substitution) and GPOS (Glyph Positioning). These tables encode rules that the text shaping engine applies to transform a sequence of Unicode characters into a sequence of positioned glyphs.
GSUB handles replacements. Standard ligatures (liga) combine character sequences into single glyphs — 'f' + 'i' becomes the fi ligature. Small capitals (smcp) replace lowercase letters with proportionally designed small cap forms. Contextual alternates (calt) select different glyph variants based on surrounding characters — a feature that handwriting fonts use to vary letter shapes naturally. Stylistic sets (ss01 through ss20) group alternate designs that can be activated as a unit.
GPOS handles spatial adjustments. Kerning (kern) tightens or loosens spacing between specific letter pairs — 'AV', 'To', 'We' all need kerning for professional appearance. Mark positioning (mark) places combining diacritical marks precisely above or below base characters. Mark-to-mark (mkmk) stacks multiple diacritics — essential for Vietnamese and Arabic with vowel marks.
For Arabic script, these tables are not optional luxuries — they are essential for correct rendering. Arabic letters take four distinct forms (initial, medial, final, isolated) depending on their position in a word, selected by init, medi, fina, and isol GSUB features. The rlig feature handles required ligatures like lam-alef. The curs GPOS feature manages cursive attachment between connected glyphs. Without these features, Arabic text is illegible.
Variable fonts
OpenType 1.8, released in September 2016, introduced variable fonts — arguably the most significant advancement in font technology since OpenType itself. A variable font contains multiple design variations along named axes within a single file.
The fvar table defines the axes of variation: wght (weight: light to bold), wdth (width: condensed to extended), slnt (slant), opsz (optical size), and any number of custom axes. Each axis has a minimum, default, and maximum value. The gvar table (for TrueType outlines) or CFF2 blend operators (for PostScript outlines) store per-glyph variation deltas that the rasterizer interpolates based on the chosen axis values.
A traditional font family might distribute 18 separate files: 9 weights times 2 (upright + italic). A single variable font replaces all 18 — and offers every intermediate value in between. Google Fonts reports that variable fonts reduce total transfer size by 44% on average compared to serving four static weights. A single variable weight axis in a font like Inter saves approximately 200 KB versus downloading Regular and Bold as separate WOFF2 files.
Color fonts
OpenType supports four color font technologies. COLR/CPAL defines colored glyph layers with palettes — COLRv0 (basic layering) shipped in 2013, COLRv1 (2021) added gradients, compositing modes, and transformations. SVG embeds Scalable Vector Graphics per glyph, used by some emoji fonts. CBDT/CBLC stores pre-rasterized color bitmaps at multiple sizes — used by Android Noto Color Emoji. sbix is Apple's bitmap color format used by Apple Color Emoji.
COLRv1 is emerging as the preferred color font technology because it stays within the OpenType outline paradigm while supporting complex visual effects. Google Chrome and Firefox fully support COLRv1 as of 2022.
Web delivery: OTF to WOFF2
While browsers can render OTF files served via @font-face, raw OTF is inefficient for web delivery. WOFF (Web Open Font Format, 2010) wraps OTF/TTF with zlib compression and metadata. WOFF2 (W3C Recommendation, 2018) replaces zlib with Brotli compression, achieving 20-30% better compression than WOFF1. A 200 KB OTF file typically compresses to 140-160 KB as WOFF2.
The CSS @font-face rule with format('woff2') is the standard approach. Google Fonts exclusively serves WOFF2 in 2026, with a CSS API that returns @font-face declarations optimized for each browser. The unicode-range descriptor enables subsetting — downloading only the character ranges actually used on the page, which is particularly valuable for CJK fonts that can exceed 10 MB uncompressed.
Font security
Fonts are parsed by OS-level text rendering engines that run with elevated privileges, making them a recurring target for exploits. Windows Adobe Type Manager (atmfd.dll) has been the subject of multiple critical CVEs, including CVE-2020-1020 (remote code execution via malformed CFF data) and CVE-2015-2426 (buffer overflow). The TrueType hinting engine's bytecode interpreter was exploited by the Duqu malware in 2011 (CVE-2011-3402), one of the most sophisticated state-level attacks ever documented.
Modern operating systems have hardened their font parsers significantly. Windows 10+ processes untrusted fonts in an AppContainer sandbox. Chrome and Firefox parse web fonts in sandboxed renderer processes. But the attack surface remains — HarfBuzz, FreeType, and CoreText each process billions of font files daily, and any parsing bug in these engines has wide-reaching consequences.
.OTF compared to alternatives
| Formats | Criteria | Winner |
|---|---|---|
| .OTF vs .TTF | Outline curve type and efficiency OTF uses cubic Bezier curves (CFF) that represent complex shapes with fewer control points than TTF's quadratic B-splines. A typical letter S requires 12 CFF control points versus 20+ in TrueType, producing smaller files for complex glyph sets. | OTF wins |
| .OTF vs .TTF | Screen hinting precision TrueType's bytecode hinting language programs glyph outlines to snap to the pixel grid at small sizes. CFF uses simpler stem hints. On older Windows with ClearType, TTF rendered sharper at 9-12px. Modern DirectWrite and FreeType render both equally. | TTF wins |
| .OTF vs .WOFF2 | Web delivery file size WOFF2 applies Brotli compression to OTF table data, reducing file size by 20-30%. A 200 KB OTF becomes 140-160 KB as WOFF2. All browsers since 2016 support WOFF2. Google Fonts serves exclusively WOFF2. | WOFF2 wins |
| .OTF vs .WOFF | Compression and compatibility WOFF1 uses zlib compression (10-15% savings). WOFF2 uses Brotli (20-30% savings). WOFF1 retains value only for IE11 fallback. All modern browsers support WOFF2, making WOFF1 largely obsolete for new deployments. | WOFF2 wins |
| .OTF vs .EOT | Browser support and openness EOT (Embedded OpenType) was a proprietary Microsoft format supported only by Internet Explorer. OTF (via WOFF2) works in every modern browser. EOT required DRM-style URL binding and has been effectively dead since IE11's decline. | OTF wins |
Technical reference
- MIME Type
font/otf- Magic Bytes
4F 54 54 4FOTTO signature for CFF-based OpenType.- Developer
- Microsoft / Adobe
- Year Introduced
- 1996
- Open Standard
- Yes — View specification
OTTO signature for CFF-based OpenType.
Binary Structure
OTF files use the SFNT (Scalable Font) container format. A CFF-based OTF starts with the 4-byte OTTO magic (4F 54 54 4F), followed by 8 bytes of table count and binary search fields, then a table directory where each entry is a 16-byte record (tag, checksum, offset, length). Tables are padded to 4-byte boundaries. Required tables include cmap (character mapping), head (font header with unitsPerEm, dates, bounding box), hhea/hmtx (horizontal metrics), name (naming strings), OS/2 (Windows metrics), and post (PostScript names). CFF-based OTF files contain a CFF or CFF2 table with glyph outlines encoded as cubic Bezier charstrings. OpenType Layout tables GSUB and GPOS enable ligatures, contextual alternates, kerning, and complex script shaping.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
0x00 | 4 bytes | sfVersion / Magic | 4F 54 54 4F | OTTO signature identifying a CFF-based OpenType font. TrueType-based OTF uses 00 01 00 00 instead. |
0x04 | 2 bytes | numTables | 00 0E (14) | Number of font tables in the file. Typical OTF has 12-20 tables depending on features. |
0x06 | 2 bytes | searchRange | 00 80 (128) | Maximum power of 2 <= numTables, multiplied by 16. Optimizes binary search of the table directory. |
0x08 | 2 bytes | entrySelector | 00 03 (3) | Log2 of the maximum power of 2 <= numTables. Used with searchRange for efficient table lookup. |
0x0A | 2 bytes | rangeShift | 00 30 (48) | numTables * 16 - searchRange. Remainder value for the binary search algorithm. |
0x0C | 16 bytes each | Table Directory Entries | 43464620 (CFF ) + checksum + offset + length | Array of table records. Each entry: 4-byte ASCII tag, 4-byte checksum, 4-byte offset from file start, 4-byte table length. |
Attack Vectors
- Malformed CFF charstring data exploiting buffer overflows in OS font parsers (CVE-2020-1020 in Windows atmfd.dll allowed remote code execution)
- Crafted GSUB/GPOS lookup tables causing heap corruption in text shaping engines like HarfBuzz and CoreText
- TrueType bytecode hinting interpreter exploits — the Duqu state-level malware (CVE-2011-3402) used a crafted TTF to achieve kernel-mode code execution
Mitigation: FileDex does not open, execute, or parse font files. This is a reference page only. Modern OS protections include font sandboxing (Windows AppContainer), renderer isolation (Chrome, Firefox), and ASLR. Users should only install fonts from trusted sources and keep OS font parsers updated.
- Specification OpenType Specification — Microsoft Typography
- Specification ISO/IEC 14496-22:2019 — Open Font Format
- Documentation Adobe CFF Specification (Technical Note #5176)
- Specification WOFF 2.0 — W3C Recommendation
- History OpenType — Wikipedia
- Registry OpenType with CFF Outlines (fdd000368) — Library of Congress Format Description