constixel
Loading...
Searching...
No Matches
constixel::shapes::text_aa< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION > Class Template Reference

Fluent API for drawing anti-aliased text. More...

#include <constixel.hpp>

Public Member Functions

constexpr text_aa (image_type &image, int32_t x_, int32_t y_, const char *str_)
 Construct an anti-aliased text shape.
 
constexpr int32_t draw (uint8_t col, size_t character_count=std::numeric_limits< size_t >::max(), size_t *character_actual=nullptr)
 Draw the text and return the width.
 
constexpr text_aacolor (uint8_t col)
 Draw the text with the specified color.
 

Detailed Description

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_aa< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >

Fluent API for drawing anti-aliased text.

Provides a chainable interface for drawing text using anti-aliased fonts.

Constructor & Destructor Documentation

◆ text_aa()

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_aa< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >::text_aa ( image_type & image,
int32_t x_,
int32_t y_,
const char * str_ )
inlineconstexpr

Construct an anti-aliased text shape.

Parameters
imageTarget image to draw on
x_X coordinate of text position
y_Y coordinate of text position
str_Text string to draw

Member Function Documentation

◆ color()

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>
text_aa & constixel::shapes::text_aa< FONT, T, W, H, GRAYSCALE, USE_SPAN, KERNING, ROTATION >::color ( uint8_t col)
inlineconstexpr

Draw the text with the specified color.

Parameters
colColor value
Returns
Reference to this text for chaining

◆ 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>
int32_t constixel::shapes::text_aa< 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
colColor value
character_countMaximum number of characters to draw
character_actualPointer to store actual characters drawn
Returns
Width of the drawn text in pixels

The documentation for this class was generated from the following file: