write_rich_text.json
The JSON file of the “Changing style in the middle of a paragraph” example. A paragraph whose style changes inside it: size, underline, colour.
This file is a request: an application sends it over the network to the server, which creates the PDF and sends it back. It makes the same page as the Rust and Python versions of this example. A request names every file it uses, never its content; the call carries the request and the files together. A font the server already holds, such as DejaVuSans, is named with nothing attached. Send the request to the address the API page gives.
What this example is for
Most text in a real document is not one style from end to end. A sentence has a bold term, a total is underlined, a footnote marker is smaller than the words around it. The usual workaround is to cut the sentence into pieces and place each one after the last — which holds until the text is translated and the pieces no longer add up to the same width.
What this example shows
- Size, colour and underline changing inside one sentence.
- A line growing as tall as the tallest word standing on it.
- Underlines placed where the font itself says they belong.