.OTF OpenType Font
.otf

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 structure
Header table directory
Tables glyf · cmap
Outlines glyph paths
FontsISO/IEC 14496-221996
By FileDex
Not convertible

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

Rivals turned allies
Microsoft and Adobe teamed up against a shared enemy
In the 1990s, Apple controlled TrueType and Adobe controlled PostScript Type 1. Microsoft and Adobe — normally fierce competitors — joined forces in 1996 to create OpenType, unifying both technologies in a single container format. Adobe sealed the deal by converting its entire Type Library to OTF in 2000.
65,535 glyph ceiling
One font file can hold 65,535 distinct characters
The 16-bit glyph index limits each OTF to 65,535 glyphs. Adobe's Source Han Sans approaches this limit with over 65,000 glyphs covering Simplified Chinese, Traditional Chinese, Japanese, and Korean scripts — all in a single file. PostScript Type 1, its predecessor, was limited to 256.
One file, infinite weights
Variable fonts replaced entire font families in 2016
Before OpenType 1.8, a complete font family needed separate files for each weight and width — 18 or more files for a typical design. A single variable OTF now contains the entire design space. Google Fonts reports 44% average reduction in total transfer size when switching from static to variable fonts.
Arabic script depends on it
Arabic text is illegible without OpenType shaping
Arabic letters take four positional forms (initial, medial, final, isolated) that OpenType GSUB features select automatically. GPOS handles cursive connection between glyphs and precise diacritical mark placement. Without OpenType layout, Arabic renders as disconnected, uniform-width letter forms — unreadable to any native speaker.

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

.OTF compared to alternative formats
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 4F OTTO signature for CFF-based OpenType.
Developer
Microsoft / Adobe
Year Introduced
1996
Open Standard
Yes — View specification
000000004F54544F OTTO

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.

OffsetLengthFieldExampleDescription
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.
1996Microsoft announces OpenType, merging TrueType container with Adobe PostScript CFF outlines to end the font format fragmentation2000Adobe converts its entire Type Library (thousands of professional fonts) from PostScript Type 1 to OpenType OTF2005OpenType registered as ISO/IEC 14496-22 (Open Font Format), the only ISO-standardized font format2009WOFF 1.0 wraps OTF with zlib compression for efficient web delivery via CSS @font-face2016OpenType 1.8 introduces variable fonts with the fvar table, embedding entire design spaces in a single file2018WOFF2 becomes W3C Recommendation, adding Brotli compression for 20-30% smaller web fonts than WOFF12021COLRv1 color font specification adds gradient fills, compositing modes, and transformations to OpenType glyph layers
Convert OTF to WOFF2 for web delivery other
python3 -c "from fontTools.ttLib import TTFont; f=TTFont('font.otf'); f.flavor='woff2'; f.save('font.woff2')"

Uses Python fontTools to read the OTF file and re-save as WOFF2 with Brotli compression. The resulting file is 20-30% smaller while preserving every table and glyph. All major browsers support WOFF2.

List all tables in an OTF file other
python3 -c "from fontTools.ttLib import TTFont; f=TTFont('font.otf'); print('\n'.join(sorted(f.keys())))"

Opens the OTF and prints every table tag alphabetically (CFF, GDEF, GPOS, GSUB, cmap, head, etc.). Reveals whether the font includes layout features, color tables, or variable font axes.

Extract OpenType feature list from GSUB other
python3 -c "from fontTools.ttLib import TTFont; f=TTFont('font.otf'); gsub=f.get('GSUB'); [print(r.FeatureTag) for r in gsub.table.FeatureList.FeatureRecord] if gsub else print('No GSUB')"

Lists all GSUB feature tags available in the font (liga, smcp, dlig, calt, ss01, etc.). Useful for discovering which typographic features a font supports before using it in CSS or a layout application.

Dump OTF to human-readable XML (TTX format) other
fonttools ttx -o font.ttx font.otf

Decompiles the binary OTF into an XML representation where every table is human-readable. Enables manual inspection of cmap coverage, name strings, CFF outlines, and GSUB/GPOS lookups. Recompile with fonttools ttx font.ttx.

Subset an OTF to Latin characters only other
pyftsubset font.otf --output-file=font-latin.otf --unicodes=U+0020-007F,U+00A0-00FF --layout-features='*'

Creates a subset OTF containing only Basic Latin and Latin-1 Supplement characters while preserving all OpenType layout features. Reduces file size dramatically for fonts with large CJK or Arabic glyph sets.

MEDIUM

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.

fontTools library
Python library for inspecting, converting, subsetting, and manipulating OpenType font files. De facto standard for font engineering toolchains.
HarfBuzz library
OpenType text shaping engine used by Chrome, Firefox, Android, GNOME, LibreOffice, and XeTeX for GSUB/GPOS processing
FontForge tool
Free open-source font editor supporting OTF, TTF, WOFF, and other font formats with full OpenType layout table editing
Google Fonts service
Free open-source font library serving 1,600+ families as WOFF2. Hosts major variable fonts including Roboto Flex and Noto Sans.
Adobe Fonts service
Subscription font service with 25,000+ OpenType fonts. Adobe converted its entire Type Library to OTF in 2000, establishing the professional standard.