This should expand to a UInt8Array where each byte provides the pixels wide of that Letter in the corresponding Letters. Drawing should then take this into account by only advancing by the width of the letter. The letter width can be longer than the width of the sprite, which can be used to create space between letters, etc. Letters should be left-aligned.
Characters with zero width may be used to draw over the character which follows them. Characters with negative width are drawn over the previous character by the amount specified, but the final cursor position remains where it was before drawing the character. This is done by:
Increasing the cursor position by the (negative) width
Drawing the character
Increasing the cursor position by -width (now positive).
Thus, negative widths actually function more as offsets for drawing.
Implementing this requires adding attribute support and base64 decoding to the engine, a width attribute (distinct from sprite_width) to Letter(), drawing support to LetterString(), and the assignment of widths to Letters().
This should expand to a
UInt8Array
where each byte provides the pixels wide of thatLetter
in the correspondingLetters
. Drawing should then take this into account by only advancing by the width of the letter. The letter width can be longer than the width of the sprite, which can be used to create space between letters, etc. Letters should be left-aligned.Characters with zero width may be used to draw over the character which follows them. Characters with negative width are drawn over the previous character by the amount specified, but the final cursor position remains where it was before drawing the character. This is done by:
-width
(now positive).Thus, negative widths actually function more as offsets for drawing.
Implementing this requires adding attribute support and base64 decoding to the engine, a width attribute (distinct from
sprite_width
) toLetter()
, drawing support toLetterString()
, and the assignment of widths toLetters()
.