A Line of Words Set Along a Path
Run one line of text round a seal, over an arch or along the edge of a map: every letter stands on the curve and leans the way it leans.
See It in a Real PDF
A seal whose legend rides its ring and a second one bowed at its foot so those words stand upright, a title bent over an arch, and the same sentence begun at three places along one straight path.
Summary
The words on a stamp, a seal or a coin go round the edge, and set as an ordinary line they would lie flat across the middle instead. Here you give the line and the shape it is to follow, and each letter is turned to stand on that shape. The letters are spaced along the curve's own length, so a bend that tightens never crowds them together, and you say where the line begins: at the start of the path, halfway along it — which keeps the words centred however long they turn out to be — or at the far end, so that the line stops where the path stops.
Technically
Asked for with
"type": "text_path"
The path is written the way a drawn path writes its own, so one shape is written one way throughout a request: move_to puts the pen down, line_to and curve_to draw, and close shuts the current subpath. A line follows those four and no others: what a line of text is set along is an outline of moves, lines, curves and closes, and a segment naming a whole shape is none of those, so one of them here is refused. It states where it starts and starts once — a line follows one run of points, not several. The run is flattened and walked by length rather than by angle, which is what keeps the spacing even where the curvature changes; a line longer than the path runs off its far end rather than being squeezed onto it.
Request Schema
Required keys: content, the line; font, the name of a declared font; font_size, in points; path, the segments, each one of move_to, line_to, curve_to and close, and no other. Optional: start, one of beginning (the default), middle and end; color, the colour the letters are drawn in, the colour in force by default; graphics_state, the name of a declared state; pages, an array of one-based integers, default empty; transform, six numbers; rotate, degrees counter-clockwise about the centre of the box the path falls in; layer, the name of a declared layer; tag with mark, or artifact. Cross refusal: transform together with rotate, and tag together with artifact.
A Whole Request That Creates a PDF
{
"standard_fonts": [{ "name": "sans", "face": "helvetica_bold" }],
"items": [
{
"type": "text_path",
"content": "CERTIFIED COPY",
"font": "sans",
"font_size": 16,
"start": "middle",
"color": [0.25, 0.35, 0.7],
"path": [
{ "move_to": { "x": 196.5, "y": 620 } },
{
"curve_to": {
"x1": 196.5, "y1": 675.78,
"x2": 241.72, "y2": 721,
"x": 297.5, "y": 721
}
},
{
"curve_to": {
"x1": 353.28, "y1": 721,
"x2": 398.5, "y2": 675.78,
"x": 398.5, "y": 620
}
}
]
}
]
}
Text
A Block of Text Placed on the Page Text in Paragraphs, with Indents and Tab Stops A Stamp Laid across the Page A Row of Glyphs Asked for by Their Number Blocks Laid One under the Other, Page After Page
Where to Go Next
Every JSON key of a request, in one page The other twenty-two things you can draw