Font convert
Try it interactively →POST /api/font-convertDecompress a WOFF2 font into TTF/OTF. Useful when you have a WOFF2 file but need the original sfnt for tooling that does not understand the WOFF2 wrapper.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| font* | file | — | Web font (WOFF / WOFF2) or SFNT (TTF / OTF) to convert. |
Response
Modes: binary, base64-json. Cache: yes (24h TTL).
Code samples
Built from the decompress-woff2 example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/font-info/DejaVuSans.woff2
FONT=$(base64 -w0 < DejaVuSans.woff2)
curl -X POST https://api.xtract.bot/api/font-convert \
-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 '{
"font": "'"$FONT"'"
}'