Link structure
The syntax is as follows:
http://type.dt1.org/render/FONTNAME/WIDTH/HEIGHT/COLOR/BACKGROUND/TEXT.png
- FONTNAME must match an entry in our database.
- WIDTH specifies the (maximum) width of the generated PNG image in pixels. Must be an integer between 40 and 2000. If the integer value is followed by _f, the specified width will be used regardless of the text dimensions. Otherwise, the actual width might be smaller, as long as the sample text fits.
- HEIGHT specifies the (maximum) height of the generated PNG image in pixels. Must be an integer between 40 and 2000. If the integer value is followed by _f, the specified height will be used regardless of the text dimensions. Otherwise, the actual height might be smaller, as long as the sample text fits.
- COLOR specifies the text color in hexadecimal RRGGBB format. The default is 000000 for black.
- BACKGROUND specifies the background color in hexadecimal RRGGBB format. The default is ffffff for white. If the RRGGBB color value is followed by _t, the background will be transparent.
-
TEXT is your sample text (if different from the
fontname.) It can contain almost any printable Unicode character
up to U+FFFF. (The library we use unfortunately does not yet
support Unicode characters from U+10000 and above.) You may have
to encode a handful of characters that have special meanings in
URLs and on web pages, e.g.,
%3E for > and %3F
for ?. For those special charachers where this doesn’t
work, TEXT supports a few custom sequences:
- $amp for &
- $apos for '
- $hash for #
- $lt for <
- $plus for +
- $slash for /
Other TEXT variables include:
- $font will be replaced with the font name.
- $fam1 will be replaced with the first word of the font name (i.e., often the name of the font family.)
- $fam2 will be replaced with the first two (space-separated) words of the font name.
- $fam3 will be replaced with the first three (space-separated) words of the font name.
- $size will be replaced with the computed font size.
- $specimen will add a “SPECIMEN” watermark
Examples
TEXT = A font of the uni-width “$fam1” font family at size $size.
FONT = Asap
FONT = Asap Medium
FONT = Asap Bold
TEXT = A font of the uni-width “$fam1” font family at size $size.$specimen
Help
Explore