Test files › Fonts › qa-sans.ttf
Sample TTF font file
A minimal but genuinely valid TrueType font ("QA Sans") with 6 glyphs (.notdef, space, A, B, C, Q), the full required sfnt table set and correct checksums.
↓ Download qa-sans.ttf| Filename | qa-sans.ttf |
| Format | TTF |
| Size | 976 bytes (976 bytes) |
| MIME type | font/ttf |
| SHA-256 | d1f5a5853af23af5a1b61aa531f77cdc5cda94ccfe00f0473be0438bf7327284 |
What this file catchesFont upload, parsing and preview. A real sfnt (cmap, glyf, head, hhea, hmtx, loca, maxp, name, post, OS/2) with valid checksums, generated from source so it carries no licensed typeface. Loads in fontTools and renders in PIL. Catches handlers that only sniff the extension or reject non-standard fonts.
Handle it in code
Each snippet below was run against this exact file with Python 3.14.4 and Node 24.15.0 when this page was built, and the output shown is what it printed.
Python
Check the signature and the table directory before handing a font to a renderer. TrueType and OpenType list their tables in a plain directory; WOFF wraps the same tables with zlib; WOFF2 compresses them with Brotli, which the standard library cannot read.
import struct
REQUIRED = {"cmap", "head", "hhea", "hmtx", "maxp", "name", "post"}
with open("qa-sans.ttf", "rb") as f:
data = f.read()
sig = data[:4]
if sig == b"wOF2":
n = struct.unpack(">H", data[12:14])[0]
print(f"WOFF2 with {n} tables, Brotli-compressed: read further with fontTools")
elif sig in (b"wOFF", b"\x00\x01\x00\x00", b"true", b"OTTO"):
if sig == b"wOFF":
kind, n, start, step = "WOFF", struct.unpack(">H", data[12:14])[0], 44, 20
else:
kind = "OpenType (CFF)" if sig == b"OTTO" else "TrueType"
n, start, step = struct.unpack(">H", data[4:6])[0], 12, 16
tags = {data[start + i * step:start + i * step + 4].decode("latin-1") for i in range(n)}
missing = sorted(REQUIRED - tags)
print(f"{kind} with {n} tables: {', '.join(sorted(tags))}")
print("missing required tables: " + ", ".join(missing) if missing else "all required tables present")
else:
print("not a font: starts with", sig.hex())Run against this file, it prints: TrueType with 10 tables: OS/2, cmap, glyf, head, hhea, hmtx, loca, maxp, name, post
all required tables present
Related guides and tools
Download & verify
curl -fsSL -o "qa-sans.ttf" "https://files.hexaqa.com/font/qa-sans.ttf"
curl -fsSL "https://files.hexaqa.com/font/qa-sans.ttf" | sha256sum
# expect: d1f5a5853af23af5a1b61aa531f77cdc5cda94ccfe00f0473be0438bf7327284