Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions | Variables
text_display.hpp File Reference

Define a text display utility. More...

Go to the source code of this file.

Classes

struct  lampda::modes::draw::text::__private::IFont
 
struct  lampda::modes::draw::text::__private::SmallFont
 
struct  lampda::modes::draw::text::__private::BigFont
 
struct  lampda::modes::draw::text::TextDisplay
 

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::modes
 Contains basic interface types to implement custom user modes.
 
namespace  lampda::modes::draw::text
 Text display utility.
 

Typedefs

using lampda::modes::draw::text::LampTy = hardware::LampTy
 

Functions

std::pair< const IFont &, float > lampda::modes::draw::text::__private::font_from_scale (const float scale)
 get a font from a [0; 1] scale
 
std::pair< bool, uint8_t > lampda::modes::draw::text::__private::display_letter (const char letter, const int16_t startXIndex, const int16_t startYIndex, const IFont &font, const float scale, const uint32_t color, LampTy &lamp)
 Display a single character.
 

Variables

static const SmallFont lampda::modes::draw::text::__private::smallFont
 
static const BigFont lampda::modes::draw::text::__private::bigFont
 

Detailed Description

Define a text display utility.

Function Documentation

◆ display_letter()

std::pair< bool, uint8_t > lampda::modes::draw::text::__private::display_letter ( const char  letter,
const int16_t  startXIndex,
const int16_t  startYIndex,
const IFont font,
const float  scale,
const uint32_t  color,
LampTy lamp 
)

Display a single character.

Parameters
[in]letter
[in]startXIndexwidth at which the text starts, in lamp coordinates
[in]startYIndexheight at which the text starts, in lamp coordinates
[in]fontThe font to use to draw this character
[in]scaleScale of the letter
[in]colorthe color to draw the character in
Returns
A bool that indictaes if the letter was drawn in a visible area, and the char font width in pixels