I need to render text to a PImage, with the following options:
- Size of the PImage must be variable, depending on the actual screen resolution
- Amount of text is variable, depending on the amount of text the user enters
- I would like to allow some formatting, for example bold and italic
The optimal solution would be that I have a snippet of HTML-formatted text, and that I'm able to render it to a box with a given size, and the font size is automatically determined to fit the box (with line-wrap).
As far as I've seen, the text()-method would allow me to render text with line-wrap, but it doesn't seem to support any option to determine the
ideal font-size, i.e., that the whole box is used. And any kind of formatting, like some words ind bold or italics, would require to split the text and to render each fragment individually.
A search through available libraries did not wield any promising options. Do you have any ideas?
Best, Marius
P.S.: I'm using Processing for some quite dynamic rendering sequences, and in between, I'd like to show some instructions; I'd like to stay within Processing, without messing everything up by introducing Swing components.