Represents an (optionally) multi-line block of text of a specified width and number of visible rows at a specified lineHeight
If the supplied text string is longer, only the last displayRows will be shown rendered and sent to Frame.
If the supplied text string has fewer than or equal to displayRows, only the number of actual rows will be rendered and sent to Frame
If any given line of text is shorter than width, the text Sprite will be set to the actual width required.
When sending TxTextSpriteBlock to Frame, the sendMessage() will send the header with block dimensions and line-by-line offsets
and the user then sends each line[] as a TxSprite message with the same msgCode as the Block, and the frame app will use the offsets
to place each line. By sending each line separately we can display them as they arrive, as well as reducing overall memory
requirement (each concat() call is smaller).
After calling the constructor, check isNotEmpty before calling rasterize() and sending the header or the sprites.
Sending a TextSpriteBlock with no lines is not intended usage.
text is trimmed (leading and trailing whitespace) before laying out the paragraph, but any blank lines
within the range of displayed rows will be sent as an empty (1px) TxSprite
After construction, a TextSpriteBlock should be tested that it has a non-zero number of
sprite lines to send, otherwise it should not be rasterized nor sent
After construction, a TextSpriteBlock should be tested that it has a non-zero number of
sprite lines to send, otherwise it should not be rasterized nor sent
Since the Paragraph rasterizing to the Canvas, and the getting of the Image bytes
are async functions, there needs to be an async function not just the constructor.
Plus we want the caller to decide how many lines of a long paragraph to rasterize, and when.
Text lines as TxSprites are accumulated in this object.
startLine and endLine are inclusive