ESPHome  2022.12.8
Public Member Functions | Protected Attributes
esphome::display::Font Class Reference

#include <display_buffer.h>

Public Member Functions

 Font (const GlyphData *data, int data_nr, int baseline, int bottom)
 Construct the font with the given glyphs. More...
int match_next_glyph (const char *str, int *match_length)
void measure (const char *str, int *width, int *x_offset, int *baseline, int *height)
const std::vector< Glyph > & get_glyphs () const

Protected Attributes

std::vector< Glyphglyphs_
int baseline_
int bottom_

Detailed Description

Definition at line 443 of file display_buffer.h.

Constructor & Destructor Documentation

◆ Font()

esphome::display::Font::Font ( const GlyphData data,
int  data_nr,
int  baseline,
int  bottom 

Construct the font with the given glyphs.

glyphsA vector of glyphs, must be sorted lexicographically.
baselineThe y-offset from the top of the text to the baseline.
bottomThe y-offset from the top of the text to the bottom (i.e. height).

Definition at line 486 of file display_buffer.cpp.

Member Function Documentation

◆ get_glyphs()

const std::vector< Glyph > & esphome::display::Font::get_glyphs ( ) const

Definition at line 485 of file display_buffer.cpp.

◆ match_next_glyph()

int esphome::display::Font::match_next_glyph ( const char *  str,
int *  match_length 

Definition at line 437 of file display_buffer.cpp.

◆ measure()

void esphome::display::Font::measure ( const char *  str,
int *  width,
int *  x_offset,
int *  baseline,
int *  height 

Definition at line 453 of file display_buffer.cpp.

Field Documentation

◆ baseline_

int esphome::display::Font::baseline_

Definition at line 461 of file display_buffer.h.

◆ bottom_

int esphome::display::Font::bottom_

Definition at line 462 of file display_buffer.h.

◆ glyphs_

std::vector<Glyph> esphome::display::Font::glyphs_

Definition at line 460 of file display_buffer.h.

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