|
libepaper 2.0.0
A C++23 library for controlling Waveshare e-paper displays on Raspberry Pi, featuring transparent sleep/wake management and a fluent builder API.
|
#include <font.hpp>
Public Member Functions | |
| constexpr | Font (const std::uint8_t *table, std::uint16_t width, std::uint16_t height) |
| constexpr auto | metrics () const noexcept -> FontMetrics |
| Get font dimensions. | |
| constexpr auto | width () const noexcept -> std::uint16_t |
| Get character width in pixels. | |
| constexpr auto | height () const noexcept -> std::uint16_t |
| Get character height in pixels. | |
| auto | char_data (char c) const -> std::span< const std::uint8_t > |
| Get bitmap data for a specific character. | |
| constexpr auto | bytes_per_char () const noexcept -> std::size_t |
| Calculate storage size for a single character. | |
Static Public Member Functions | |
| static auto | font8 () -> const Font & |
| Get 8-pixel font. | |
| static auto | font12 () -> const Font & |
| Get 12-pixel font. | |
| static auto | font16 () -> const Font & |
| Get 16-pixel font. | |
| static auto | font20 () -> const Font & |
| Get 20-pixel font. | |
| static auto | font24 () -> const Font & |
| Get 24-pixel font. | |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Calculate storage size for a single character.
Computes the number of bytes needed to store one character's bitmap based on font dimensions.
Formula:
Examples:
| auto epaper::Font::char_data | ( | char | c | ) | const -> std::span<const std::uint8_t> |
Get bitmap data for a specific character.
Returns a span containing the packed bitmap bytes for the requested character. Bitmap is MSB-first, row-major encoded.
Supported Range:
Bitmap Layout:
Decoding:
| c | Character to retrieve (ASCII 0x20-0x7E) |
|
inlineconstexprnoexcept |
Get character height in pixels.
|
inlineconstexprnoexcept |
Get font dimensions.
|
inlineconstexprnoexcept |
Get character width in pixels.