|
idfxx 1.0.0
Modern C++23 components for ESP-IDF
|
Fixed-cell bitmap font model and text metrics. More...
Modules | |
| Spleen Fonts | |
| The Spleen 5x8 and 8x16 fixed-cell bitmap fonts. | |
Namespaces | |
| namespace | idfxx |
| namespace | idfxx::font |
| Bitmap font types, text metrics, and bundled fonts. | |
Classes | |
| struct | idfxx::font::mono_font |
| A fixed-cell monochrome bitmap font. More... | |
Functions | |
| constexpr size_t | idfxx::font::text_width (const mono_font &font, std::string_view text, unsigned scale=1) noexcept |
Returns the width in pixels of text rendered in font. | |
Fixed-cell bitmap font model and text metrics.
Provides a compact fixed-cell font representation and text measurement. Rendering lives in the Graphics Component component; bundled fonts are published as separate data packages (e.g. idfxx_font_spleen), each font in its own translation unit so fonts an application never references are dropped at link time. A BDF-to-C converter script for adding more fonts is included under scripts/.
|
constexprnoexcept |
Returns the width in pixels of text rendered in font.
Sums the advance of every character in text; characters outside the font's glyph range advance like any other (rendered blank).
| font | The font. |
| text | The text to measure. |
| scale | Integer magnification factor (>= 1; 0 is treated as 1). |
Definition at line 104 of file font.hpp.
References idfxx::font::mono_font::advance().