The basics
What is a TTF file?
A TTF file holds one font: the outline of every letter, digit and symbol it covers, how wide each one is, how far apart lines sit, which character each shape belongs to, and the font's name and licence. Operating systems, word processors, design apps and browsers use those outlines to draw text at any size, on screen or on paper.
Apple developed TrueType in the late 1980s as an alternative to Adobe's PostScript Type 1 fonts, and released it in 1991. Microsoft licensed it for Windows 3.1, and it became the standard font format on both systems. Most fonts that come with Windows and macOS are TrueType or its successor, OpenType.
Today a .ttf file is, technically, an OpenType font with TrueType outlines. The OpenType specification, which Microsoft and Adobe built on top of TrueType from 1996 onwards, describes both .ttf and .otf files. The extension tells you which kind of outlines to expect, not which standard applies.
Anatomy
What's inside a TTF file
A TTF file is a short header, a directory of tables, and the tables themselves. Below is our sample-regular.ttf. Numbers are big-endian: 00 00 04 E4 is 0x4E4, which is 1,252.
offset bytes meaning
000000 00 01 00 00 version: TrueType outlines
000004 00 0A 10 tables
000006 00 80 00 03 00 20 search helpers
table directory, 16 bytes per table:
tag checksum offset length
00000C 4F 53 2F 32 5A 99 5C 1A 00 00 01 28 00 00 00 60 OS/2
00001C 63 6D 61 70 0F A9 0E 75 00 00 03 14 00 00 01 06 cmap
00002C 67 6C 79 66 49 2B 66 13 00 00 04 E4 00 00 1E E0 glyf
00003C 68 65 61 64 30 8D 4A AA 00 00 00 AC 00 00 00 36 head
00004C 68 68 65 61 … hhea
00005C 68 6D 74 78 … hmtx
00006C 6C 6F 63 61 … loca
00007C 6D 61 78 70 … maxp
00008C 6E 61 6D 65 … name
00009C 70 6F 73 74 … post
the head table:
0000AC 00 01 00 00 00 01 00 00 4F 61 3F BC 5F 0F 3C F5 versions, checksum, magic
0000BC 00 03 03 E8 … flags, 1,000 units per em
the glyph "o", inside glyf:
0009AE 00 02 00 2D FF F6 02 24 01 FE 2 contours, bounding box
0009B8 00 0F 00 1F 00 00 25 … contour ends, no hints, points
002D44 end of file: 11,588 bytes- 1
00 01 00 00The version
Identifies a font with TrueType outlines. A font with CFF outlines starts with
OTTOinstead. This header layout is called sfnt, and it's shared by TTF, OTF and the font inside every WOFF file. - 2
00 0AThe table count
Ten tables, the minimum set for a working TrueType font without hinting or advanced layout.
- 3
00 80 00 03 00 20Search helpers
searchRange, entrySelector and rangeShift: values derived from the table count that once let software binary-search the directory. Many readers ignore them.
- 4
67 6C 79 66 49 2B 66 13 00 00 04 E4 00 00 1E E0A directory entry
The table name
glyf, a checksum of its contents, where it starts (0x4E4) and its length (7,904 bytes). Entries are sorted alphabetically by tag, with capitals first. - 5
OS/2, cmap, hhea, hmtx …The tables
cmapmaps characters to glyph numbers,hmtxgives each glyph's width,hheaandOS/2the line spacing, weight and embedding permissions,namethe family name and licence,postthe glyph names,maxpthe glyph count (99) andlocawhere each glyph starts insideglyf. - 6
00 01 00 00 00 01 00 00 4F 61 3F BC 5F 0F 3C F5The head table
Table version, font revision (1.0), a checksum adjustment that makes the whole file add up to a fixed value, and the magic number
5F 0F 3C F5, which every validheadtable contains. - 7
00 03 03 E8Units per em
The design grid: 0x3E8 is 1,000 units per em. All coordinates in the font are in these units. TrueType fonts often use 2,048, a power of two.
- 8
00 02 00 2D FF F6 02 24 01 FEA glyph
The letter o: 2 contours (outside and inside), and its bounding box from (45, -10) to (548, 510).
FF F6is -10: the o dips 10 units below the baseline so it looks as tall as flat letters. - 9
00 0F 00 1F 00 00 25 …Contours and points
The last point of each contour (15 and 31, so 32 points in all), the length of the hinting instructions (0: this font is unhinted), then a flag byte and coordinates for each point. The flag's lowest bit says whether a point is on the curve or a control point.
Under the hood
How a TrueType font works
A TTF file is a small database. The header lists tables, each identified by a four-letter tag, and each table does one job. A font needs these to work:
| Table | What it holds |
|---|---|
cmap | Which glyph to use for each Unicode character |
glyf and loca | The outlines, and where each glyph's outline starts |
head | Global settings: units per em, bounding box, version |
hhea and hmtx | Line spacing, and each glyph's advance width and left side bearing |
maxp | The number of glyphs, and limits for the hinting engine |
name | Family and style names, copyright, licence, designer |
OS/2 | Weight and width class, Windows line spacing, embedding permissions |
post | Glyph names and underline position |
GSUB, GPOS, kern | Optional: ligatures, alternates, kerning and other layout features |
cvt , fpgm, prep | Optional: data and programs for hinting |
Outlines. TrueType glyphs are drawn with straight lines and quadratic Bézier curves: each curve segment has one control point, against two in the cubic curves of PostScript and CFF fonts. A point is either on the outline or an off-curve control point, and two control points in a row imply an on-curve point halfway between them. Quadratic curves need more points for the same shape but are fast to draw.
Hinting. At small sizes on a screen, a letter is only a few pixels tall, and an outline scaled down blindly turns into a blur. TrueType fonts can carry instructions, small programs in a bytecode language, that nudge points onto the pixel grid so stems stay sharp and even. Good hinting is skilled, slow work; many modern fonts are hinted automatically or not at all, because high-resolution screens and modern rendering need it less. Our samples are unhinted.
Why an o dips below the line
Round letters are drawn slightly taller and deeper than flat ones, here by 10 units in 1,000. Without this overshoot, an o next to an x looks too small. You can see it in the glyph's bounding box in the anatomy above.
Related formats
TTF vs OTF vs WOFF2 and other font formats
| TTF | OTF (CFF) | WOFF / WOFF2 | |
|---|---|---|---|
| Outlines | Quadratic curves (glyf) | Cubic curves (CFF or CFF2) | Either: they wrap a TTF or OTF |
| First four bytes | 00 01 00 00 | 4F 54 54 4F (OTTO) | wOFF / wOF2 |
| Hinting | Instructions in the font, very precise | Hints about stems and zones; the rasteriser does the rest | Same as the font inside |
| Install on a computer | Yes | Yes | No, convert first |
| Use on a website | Works, but uncompressed | Works, but uncompressed | Made for it; WOFF2 is the smallest |
| Our regular sample | 11,588 bytes | 12,172 bytes | 6,092 / 4,428 bytes |
For installing on a computer, TTF and OTF are equally good: both support the same layout features, scripts and variable axes. Pick whichever the font maker supplies. For a website, convert to WOFF2 rather than serving the TTF: it's the same font at a fraction of the size. Two older formats you may still meet: .ttc, a TrueType collection holding several fonts that share tables, and .dfont, a TrueType font in the old Mac data-fork format.
Variants
Variable TTF fonts
Since OpenType 1.8 in 2016, a single TTF can hold a continuous range of styles. A variable font stores one set of outlines plus tables describing how each point moves along design axes such as weight (wght), width (wdth) or slant (slnt). The main extra tables are fvar (the axes and named styles), gvar (how the outlines change) and STAT (how the styles are named).
Our sample-variable.ttf has one axis, weight, from 300 to 700, with five named styles: Light, Regular, Medium, SemiBold and Bold. Apps with variable-font support show a weight slider or the named styles; on the web, font-weight: 300 700 in @font-face unlocks every weight in between.
Variable fonts often contain overlapping contours, because each piece of a letter moves on its own. That's allowed, but some older software draws thin lines or gaps where contours overlap. Tools that create static fonts from a variable one usually merge the overlaps.
How to
How to install, open and convert a TTF file
- Windows: double-click the file to preview it in Font Viewer, then click Install. Right-click offers Install for all users. Fonts live in
C:\Windows\Fonts, or in your user folder if installed only for you. - macOS: double-click to open it in Font Book and click Install. Font Book also checks fonts for problems (File, Validate File).
- Linux: copy it to
~/.local/share/fontsand refresh the font cache, as below. - On a website: convert it to WOFF2 and load it with
@font-face. Browsers accept TTF directly too, but it's bigger. - Convert: fontTools (
pyftsubset,ttx, or a few lines of Python) and FontForge convert between TTF, OTF, WOFF and WOFF2; Google'swoff2_compressturns a TTF straight into WOFF2. - Phones: iOS and Android don't install loose font files by double-tapping. On iOS, fonts come through apps or configuration profiles; on Android, through the manufacturer's theme app where available, or within individual apps.
# Linux: install a font for your user, then refresh the font cache
mkdir -p ~/.local/share/fonts
cp sample-regular.ttf ~/.local/share/fonts/
fc-cache -f
fc-list | grep "99helpers"Troubleshooting
Why won't my TTF font install or show up?
- It's installed but not in the font menu. Most apps read the font list when they start: close and reopen the app. On Linux, run
fc-cache -f. - "Not a valid font". The file is damaged, incomplete (an interrupted download), or not really a TTF: a renamed WOFF or WOFF2 file, or an HTML error page saved as
.ttf. Check the first four bytes; they should be00 01 00 00. - Boxes instead of letters. The font doesn't contain those characters. Boxes, often called tofu, are the missing-glyph shape (glyph 0,
.notdef). Oursample-digits-subset.ttfshows this for every letter. - Fuzzy at small sizes on Windows. An unhinted or lightly hinted font can look soft at body-text sizes on lower-resolution screens. Try a hinted version of the font, or a size where it renders well.
- Two versions conflict. If an old and a new version of a font have the same name, apps may pick the wrong one. Remove the old version and restart the app.
- Bold or italic looks wrong. If the family has no real bold file installed, apps fake it by thickening the letters. Install the bold font too.
Rights and risks
Font licences and safety
A font file is software, and comes with a licence. Fonts bundled with an operating system are licensed for use on that system, not for redistribution or for putting on a website. Open-source fonts, usually under the SIL Open Font License, can be used, embedded and shared freely. Commercial fonts often need separate licences for desktop, web, app and e-book use.
The font itself records some of this. The name table carries copyright and licence text, and the OS/2 table's fsType field states the embedding permission: installable, editable, preview and print, or restricted, plus flags forbidding subsetting or allowing bitmap-only embedding. Word processors and PDF tools read fsType when deciding whether to embed a font in a document.
Font files are parsed by complex code, often deep inside the operating system, and font bugs have been exploited. The Duqu malware, discovered in 2011, used a crafted TrueType font in a Word document to attack the Windows kernel. Install fonts from sources you trust, and keep your system updated.
Free downloads
Sample TTF files to download
Free sample TTF fonts for testing font installers, renderers, converters, upload filters and @font-face set-ups. They use 99helpers Sample, an original geometric typeface we drew for these pages, with Latin letters, digits, common punctuation and a few accented letters.
Aa Gg 99
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
0123456789 .,:;!?&@#()
14pxThe quick brown fox jumps over the lazy dog
20pxThe quick brown fox jumps over the lazy dog
32pxThe quick brown fox jumps over the lazy dog
48pxThe quick brown fox jumps over the lazy dog
What's inside sample-regular.ttf
The regular weight, built with fontTools. The specimen above is drawn with this exact file.
Ten tables
OS/2,cmap,glyf,head,hhea,hmtx,loca,maxp,nameandpost: the minimum for a working font, without hinting or kerning.99 glyphs
A to Z, a to z, 0 to 9, space,
.,:;!?&@#()-'"/, á à â ä é è ê ë í ï ó ô ö ú ü ñ É Ü Ñ, plus.notdefand a dotless i used for í and ï.Monoline outlines
Every letter is built from strokes of the same width, drawn as quadratic curves, with overlaps merged so each glyph is a clean set of contours.
Metrics
1,000 units per em, x-height 500, cap height 700, ascender 920 and descender -250 for line spacing; the digits share one width so numbers line up in tables.
Names and licence
Family
99helpers Sample, styleRegular, weight class 400,fsType0 (installable), and the licence with a link back to this page in thenametable.
All sample TTF files
Regular weight
sample-regular.ttf · 11.3 KB (11,588 bytes)
99helpers Sample Regular (weight 400): a static TrueType font with 99 glyphs, unhinted, installable.
- Testing font installation and rendering
- A source file for TTF to WOFF2 conversion
Bold weight
sample-bold.ttf · 11.1 KB (11,368 bytes)
The same family at weight 700, with the bold style bits set, so apps pair it with the regular file as one family.
- Testing style linking (the B button in a word processor)
- Comparing real and synthetic bold
Variable font, weight 300 to 700
sample-variable.ttf · 23.4 KB (23,920 bytes)
A variable TrueType font with one
wghtaxis from 300 to 700 and five named styles, usingfvar,gvar,HVARandSTATtables.- Testing variable-font support in apps and browsers
- Generating static instances with fontTools
Digits-only subset
sample-digits-subset.ttf · 3.2 KB (3,268 bytes)
The regular font subset to 17 glyphs: 0 to 9, space and
.,:-/. Any letter typed in it falls back to another font or shows as a missing glyph.- Testing missing-glyph and fallback behaviour
- A small valid TTF for parser and upload tests
Ways to test with them
- Installers: install
sample-regular.ttfandsample-bold.ttftogether; your apps should list one family, 99helpers Sample, with two styles. - Converters: convert
sample-regular.ttfto WOFF2 and back, then compare withttx -l; the same ten tables should come back. - Variable fonts: open
sample-variable.ttfin an app with variable-font support and move the weight slider from 300 to 700. - Missing glyphs: type a word in
sample-digits-subset.ttf; letters should fall back to another font or show as boxes. - Upload filters: check that your filter accepts
font/ttfand the00 01 00 00signature, and rejects files that only have a.ttfname.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have a TTF file? Give it a link.
Drop a TTF file on 99helpers and it gets its own address in seconds. Opening the link downloads the font, since browsers don't display font files on their own, and a page or site you host on 99helpers can load it with @font-face.
Questions
TTF files, frequently asked
What is a TTF file?
A TrueType font: a file with the outlines, spacing and names of a typeface, which computers use to draw text. Install it to use the font in your apps.
How do I install a TTF font?
On Windows, double-click it and click Install. On macOS, double-click it and click Install in Font Book. On Linux, copy it to ~/.local/share/fonts and run fc-cache -f.
What's the difference between TTF and OTF?
Mainly the outlines: TTF uses TrueType quadratic curves, OTF usually uses CFF cubic curves. Both are OpenType fonts with the same features, and both install the same way.
Can I use a TTF font on my website?
Yes, browsers accept TTF in @font-face, but convert it to WOFF2 first: it's the same font, much smaller. Check that the font's licence allows web use.
Why doesn't my font show up after installing it?
Most apps load the font list when they start, so restart the app. If it still doesn't appear, the file may be damaged or not a real TTF.
Why do I see boxes instead of letters?
The font has no glyph for those characters, so the missing-glyph shape is drawn. Use a font that covers the language, or let the app fall back to one that does.
What is the MIME type of a TTF file?
font/ttf, registered in RFC 8081 in 2017. Older servers send application/x-font-ttf or application/octet-stream.
Are TTF files safe?
Fonts can't run like programs, but bugs in font handling have been exploited in the past. Install fonts from trusted sources and keep your system updated.
Related formats
Other file types explained
Keep going
Related
Sources
- Microsoft: OpenType font file (table directory)
- Microsoft: OS/2 table (fsType, usWeightClass)
- Apple: TrueType Reference Manual
- RFC 8081: The font top-level media type
- MDN: @font-face src
Last reviewed 27 October 2026.