p5js provides the text()
function to display text using the currently set text font, size, style and alignment. What it can’t do is vary any of these attributes while it is rendering the text.
“Text to Image” solves this problem by creating an image of styled text from tagged-text. The tagged-text describes the text and text attributes used to render the image and has a similar format to HTML.
It is compatible with p5js V1 and V2 (I have tested with 1.11.10 & 2.0.5) and everything you need is in a single file which can be used in your own project.
In this sketch all the pages are images created using text-to-image and they describe its capabilities.