template<typename FONT, template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN, bool KERNING = false, text_rotation ROTATION = DEGREE_0>
class constixel::shapes::text_mono< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >
Fluent API for drawing monospace text.
Provides a chainable interface for drawing text using monospace fonts.
template<typename FONT, template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN, bool KERNING = false, text_rotation ROTATION = DEGREE_0>
constixel::shapes::text_mono< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >::text_mono |
( |
image_type & | image, |
|
|
int32_t | x_, |
|
|
int32_t | y_, |
|
|
const char * | str_ ) |
|
inlineconstexpr |
Construct a monospace text shape.
- Parameters
-
image | Target image to draw on |
x_ | X coordinate of text position |
y_ | Y coordinate of text position |
str_ | Text string to draw |
template<typename FONT, template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN, bool KERNING = false, text_rotation ROTATION = DEGREE_0>
Draw the text with the specified color.
- Parameters
-
- Returns
- Reference to this text for chaining
template<typename FONT, template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN, bool KERNING = false, text_rotation ROTATION = DEGREE_0>
int32_t constixel::shapes::text_mono< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >::draw |
( |
uint8_t | col, |
|
|
size_t | character_count = std::numeric_limits<size_t>::max(), |
|
|
size_t * | character_actual = nullptr ) |
|
inlineconstexpr |
Draw the text and return the width.
- Parameters
-
col | Color value |
character_count | Maximum number of characters to draw |
character_actual | Pointer to store actual characters drawn |
- Returns
- Width of the drawn text in pixels