Font subset
Try it interactively →POST /api/font-subsetStrip a font to only the Unicode codepoints you need — the standard web-perf optimization for self-hosted fonts. Ranges, U+ syntax, and literal characters supported.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| font* | file | — | TTF or OTF font. |
| codepoints* | string | — | Codepoint spec — literal chars, ASCII ranges (A-Z, 0-9), and U+XXXX[-U+YYYY] ranges. Whitespace and commas are separators. |
Response
Modes: binary, json. Cache: yes (24h TTL).
Code samples
Built from the ascii-letters example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/font-info/DejaVuSansMono.ttf
FONT=$(base64 -w0 < DejaVuSansMono.ttf)
curl -X POST https://api.xtract.bot/api/font-subset \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"codepoints": "A-Z,a-z",
"font": "'"$FONT"'"
}'