12#ifndef MAXMATRIX_SRC_TEXT_TEXT_H_
13#define MAXMATRIX_SRC_TEXT_TEXT_H_
47 static constexpr uint16_t kShiftIdle{0};
48 static constexpr uint16_t kShiftStart{1};
60 uint16_t sprite_shift_counter_{kShiftIdle};
77 return space_between_chars_;
82 return font_.
size() != 0 ? font_ : DefaultFont();
The font of the MaxMatrix library.
The attributes of a later standard, as macros, where the compiler has them.
#define MAXMATRIX_NODISCARD
Marks a function whose result must not be dropped: the compiler warns where it is.
Definition MaxMatrixAttributes.h:37
Configuration of the MaxMatrix library.
#define MAXMATRIX_SPACE_BETWEEN_CHARS_INIT_VALUE
The empty columns between two chars of a text, until Matrix::SetSpaceBetweenChars().
Definition MaxMatrixConfig.h:47
The matrix as the viewer sees it.
What a function that can fail returns when it has no value to return.
Definition MaxMatrixError.h:73
The matrix as the viewer sees it: columns, rows and dots in the viewer's coordinates.
Definition Panel.h:94
MAXMATRIX_NODISCARD Status SetCharWithShift(char c)
Starts shifting a char in from the right, until it stands at the right edge.
MAXMATRIX_NODISCARD uint8_t GetSpaceBetweenChars() const
Returns the empty columns between two chars of a text.
Definition Text.h:76
MAXMATRIX_NODISCARD Status SetTextWithShift(span< char const > text, bool repeat)
Starts shifting a text in from the right, until its last char stands at the right edge,...
MAXMATRIX_NODISCARD Status SetChar(Panel &panel, int16_t x, int16_t y, char c) const
Draws a char with its top left corner at x, y.
MAXMATRIX_NODISCARD Status SetText(Panel &panel, span< char const > text) const
Draws a text from the left edge, as far as it fits.
static void SetSprite(Panel &panel, int16_t x, int16_t y, Sprite const &sprite)
Draws a sprite with its top left corner at x, y.
MAXMATRIX_NODISCARD span< uint8_t const > GetFont() const
Returns the font every char is drawn in.
Definition Text.h:81
Text()
Makes a text with nothing to shift.
MAXMATRIX_NODISCARD Status SetFont(span< uint8_t const > font)
Sets the font every char is drawn in from now on.
bool CharShiftTask(Panel &panel)
Shifts the char one column further.
void SetSpaceBetweenChars(uint8_t space_between_chars)
Sets the empty columns between two chars of a text.
static void SetGlyph(Panel &panel, int16_t x, int16_t y, Glyph const &glyph)
Draws a glyph of a font with its top left corner at x, y.
bool StringShiftTask(Panel &panel)
Shifts the text one column further.
A view of size() elements that another owns: a font, a bitmap, a text or a buffer.
Definition span.h:64
MAXMATRIX_NODISCARD constexpr size_type size() const
Returns the number of elements.
Definition span.h:126
Elements that lie elsewhere, reached by index within their size, as std::span.
A char of a font, as it lies in flash: where its columns are, and how many.
Definition Font.h:48
A sprite of your own: its width, its height and up to five columns.
Definition Font.h:38