|
roo_display
API Documentation for roo_display
|
Smooth font v2 with split cmap and glyph metrics format. More...
#include <smooth_font_v2.h>
Data Structures | |
| class | GlyphMetadataReader |
| class | GlyphPairIterator |
Public Member Functions | |
| template<typename U = uint8_t, typename std::enable_if<!std::is_same< U, roo::byte >::value, int >::type = 0> | |
| SmoothFontV2 (const U *font_data PROGMEM) | |
Legacy constructor for fonts using uint8_t byte data. | |
| SmoothFontV2 (const roo::byte *font_data PROGMEM) | |
| Construct from PROGMEM font data. | |
| void | drawHorizontalString (const Surface &s, const char *utf8_data, uint32_t size, Color color) const override |
| Draw a UTF-8 string horizontally. | |
| void | drawGlyph (const Surface &s, char32_t code, FontLayout layout, Color color) const override |
| Draw a single glyph. | |
| bool | getGlyphMetrics (char32_t code, FontLayout layout, GlyphMetrics *result) const override |
| Retrieve glyph metrics for a code point and layout. | |
| int16_t | getKerning (char32_t left, char32_t right) const override |
| Return kerning adjustment for a pair of code points. | |
| GlyphMetrics | getHorizontalStringMetrics (const char *utf8_data, uint32_t size) const override |
| Return metrics of the specified UTF-8 string as if it were a single glyph. | |
| uint32_t | getHorizontalStringGlyphMetrics (const char *utf8_data, uint32_t size, GlyphMetrics *result, uint32_t offset, uint32_t max_count) const override |
| Return metrics for consecutive glyphs in the UTF-8 string. | |
Public Member Functions inherited from roo_display::Font | |
| const FontMetrics & | metrics () const |
| Return font metrics. | |
| const FontProperties & | properties () const |
| Return font properties. | |
| void | drawHorizontalString (const Surface &s, roo::string_view text, Color color) const |
| Draw a UTF-8 string horizontally using a string view. | |
| GlyphMetrics | getHorizontalStringMetrics (roo::string_view text) const |
| Return metrics of the specified UTF-8 string as if it were a single glyph. | |
| uint32_t | getHorizontalStringGlyphMetrics (roo::string_view text, GlyphMetrics *result, uint32_t offset, uint32_t max_count) const |
| Return metrics for consecutive glyphs in the UTF-8 string. | |
| virtual | ~Font () |
Additional Inherited Members | |
Protected Member Functions inherited from roo_display::Font | |
| void | init (FontMetrics metrics, FontProperties properties) |
Smooth font v2 with split cmap and glyph metrics format.
Definition at line 14 of file smooth_font_v2.h.
|
inline |
Legacy constructor for fonts using uint8_t byte data.
Definition at line 20 of file smooth_font_v2.h.
References PROGMEM.
Construct from PROGMEM font data.
Definition at line 172 of file smooth_font_v2.cpp.
References roo_display::ascent, CHECK, roo_display::descent, roo_display::Font::init(), roo_display::FontProperties::kAscii, roo_display::FontProperties::kGrayscale, roo_display::FontProperties::kMonospace, roo_display::FontProperties::kNone, roo_display::FontProperties::kPairs, roo_display::FontProperties::kProportional, roo_display::FontProperties::kUnicodeBmp, roo_display::linegap, PROGMEM, roo_display::readByte(), roo_display::readTriWord(), and roo_display::readUWord().
|
overridevirtual |
Draw a single glyph.
The default implementation supports horizontal layout and delegates to drawHorizontalString. Font implementations can override this for a faster path that avoids UTF-8 encoding.
Reimplemented from roo_display::Font.
Definition at line 703 of file smooth_font_v2.cpp.
References color, roo_display::DisplayOutput::fillRect(), roo_display::Box::Intersect(), roo_display::is_space(), roo_display::kExtents, roo_display::kHorizontal, roo_display::kVisible, and roo_display::Font::metrics().
|
overridevirtual |
Draw a UTF-8 string horizontally.
Implements roo_display::Font.
Definition at line 618 of file smooth_font_v2.cpp.
References roo_display::advance, color, roo_display::Box::Intersect(), roo_display::kVisible, and roo_display::Font::metrics().
|
overridevirtual |
Retrieve glyph metrics for a code point and layout.
Implements roo_display::Font.
Definition at line 758 of file smooth_font_v2.cpp.
References roo_display::is_space(), roo_display::kHorizontal, roo_display::FontMetrics::linegap(), and roo_display::Font::metrics().
|
overridevirtual |
Return metrics for consecutive glyphs in the UTF-8 string.
Implements roo_display::Font.
Definition at line 577 of file smooth_font_v2.cpp.
References roo_display::advance.
|
overridevirtual |
Return metrics of the specified UTF-8 string as if it were a single glyph.
Implements roo_display::Font.
Definition at line 532 of file smooth_font_v2.cpp.
References roo_display::advance, roo_display::FontMetrics::glyphYMax(), roo_display::FontMetrics::glyphYMin(), and roo_display::Font::metrics().
|
overridevirtual |
Return kerning adjustment for a pair of code points.
The returned value is in pixels and should be added to the base advance of the left glyph. Fonts without kerning can keep the default implementation.
Reimplemented from roo_display::Font.
Definition at line 778 of file smooth_font_v2.cpp.
References roo_display::is_space().