TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IFont< RGB_T > Class Template Referenceabstract

Font rendering interface for TinyGPU-compatible framebuffers. More...

#include <IFont.h>

Inheritance diagram for IFont< RGB_T >:
Inheritance graph
[legend]

Public Member Functions

virtual ~IFont ()=default
 Destroys the font interface.
 
virtual void drawText (ISurface< RGB_T > &target, int16_t x, int16_t y, const char *text, RGB_T foreground, RGB_T background, bool opaque=false, uint8_t scale=1, uint8_t spacing=1, uint8_t lineSpacing=1) const =0
 Draws a text string onto a framebuffer target.
 
virtual size_t measureTextWidth (const char *text, uint8_t scale=1, uint8_t spacing=1) const =0
 Returns the width of the longest text line in pixels.
 
virtual size_t measureTextHeight (const char *text, uint8_t scale=1, uint8_t lineSpacing=1) const =0
 Returns the total text height in pixels.
 
virtual size_t getHeight (uint8_t scale) const =0
 Returns the scaled glyph height in pixels.
 

Detailed Description

template<typename RGB_T = RGB565>
class tinygpu::IFont< RGB_T >

Font rendering interface for TinyGPU-compatible framebuffers.

Template Parameters
RGB_TThe pixel color type. Can be RGB565, RGB666, RGB888, etc.

Implementations render text onto an ISurface target using their own glyph storage, layout, and scaling behavior.

Constructor & Destructor Documentation

◆ ~IFont()

virtual ~IFont ( )
virtualdefault

Destroys the font interface.

Member Function Documentation

◆ drawText()

virtual void drawText ( ISurface< RGB_T > &  target,
int16_t  x,
int16_t  y,
const char *  text,
RGB_T  foreground,
RGB_T  background,
bool  opaque = false,
uint8_t  scale = 1,
uint8_t  spacing = 1,
uint8_t  lineSpacing = 1 
) const
pure virtual

Draws a text string onto a framebuffer target.

Implemented in BitmapFont< RGB_T >.

◆ getHeight()

virtual size_t getHeight ( uint8_t  scale) const
pure virtual

Returns the scaled glyph height in pixels.

Implemented in BitmapFont< RGB_T >.

◆ measureTextHeight()

virtual size_t measureTextHeight ( const char *  text,
uint8_t  scale = 1,
uint8_t  lineSpacing = 1 
) const
pure virtual

Returns the total text height in pixels.

Implemented in BitmapFont< RGB_T >.

◆ measureTextWidth()

virtual size_t measureTextWidth ( const char *  text,
uint8_t  scale = 1,
uint8_t  spacing = 1 
) const
pure virtual

Returns the width of the longest text line in pixels.

Implemented in BitmapFont< RGB_T >.


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