|
libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
|
Command for drawing text. More...
#include <commands.hpp>

Public Member Functions | |
| TextCommand (Point pos, std::string_view txt, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept | |
| Construct a text command with string content. | |
| TextCommand (Point pos, std::int32_t num, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept | |
| Construct a text command with number content. | |
| TextCommand (Point pos, double dec, std::uint8_t places, const Font *f, Color fg=Color::Black, Color bg=Color::White) noexcept | |
| Construct a text command with decimal content. | |
Public Attributes | |
| Point | position |
| Text position. | |
| std::string | text |
| Text content (or converted number) | |
| const Font * | font |
| Font to use. | |
| Color | foreground |
| Foreground (text) color. | |
| Color | background |
| Background color. | |
| TextContent | content_type |
| Content type for internal use. | |
| std::int32_t | number |
| Number value (for Number type) | |
| double | decimal |
| Decimal value (for Decimal type) | |
| std::uint8_t | decimal_places |
| Decimal places (for Decimal type) | |
Command for drawing text.
Encapsulates all parameters needed to draw text (string, number, or decimal). Constructed via TextBuilder.
Member Semantics:
position: Text baseline position (top-left of first character cell)text: String content or converted number/decimal (read-only after construction)font: Pointer to loaded font (borrowed - must outlive command)foreground: Text ink color (1 bits in font bitmap)background: Paper color (0 bits in font bitmap)content_type: Internal discriminant for TextBuilder (user ignores this)number, decimal, decimal_places: Internal storage for numeric typesFont Requirements:
Text Rendering:
Numeric Formatting:
text field during TextBuilder::build()
|
inlinenoexcept |
Construct a text command with string content.
| pos | Text position |
| txt | Text content |
| f | Font to use |
| fg | Foreground color (default: Black) |
| bg | Background color (default: White) |
|
inlinenoexcept |
Construct a text command with number content.
| pos | Text position |
| num | Number value |
| f | Font to use |
| fg | Foreground color (default: Black) |
| bg | Background color (default: White) |
|
inlinenoexcept |
Construct a text command with decimal content.
| pos | Text position |
| dec | Decimal value |
| places | Decimal places |
| f | Font to use |
| fg | Foreground color (default: Black) |
| bg | Background color (default: White) |
| Color epaper::TextCommand::background |
Background color.
| TextContent epaper::TextCommand::content_type |
Content type for internal use.
| double epaper::TextCommand::decimal |
Decimal value (for Decimal type)
| std::uint8_t epaper::TextCommand::decimal_places |
Decimal places (for Decimal type)
| Color epaper::TextCommand::foreground |
Foreground (text) color.
| std::int32_t epaper::TextCommand::number |
Number value (for Number type)
| Point epaper::TextCommand::position |
Text position.
| std::string epaper::TextCommand::text |
Text content (or converted number)