Base class for a loaded typeface, e.g. Sans 16pt bold. More...
#include <Asset.h>
Public Member Functions | |
virtual FontStyles | getStyle () const =0 |
Style of this typeface (bold, italic, etc.) More... | |
virtual uint8_t | height () const =0 |
Get height of typeface, same for all characters. More... | |
virtual uint8_t | descent () const =0 |
virtual GlyphMetrics | getMetrics (char ch) const =0 |
Get metrics for a character. More... | |
virtual std::unique_ptr< GlyphObject > | getGlyph (char ch, const GlyphOptions &options) const =0 |
Get the glyph for a character. More... | |
uint8_t | baseline () const |
Get baseline relative to top of mbox. More... | |
uint16_t | getTextWidth (const char *text, uint16_t length) const |
Compute displayed width for a text string. More... | |
void | write (MetaWriter &meta) const override |
![]() | |
virtual Type | type () const override |
Asset () | |
Asset (ID id) | |
![]() | |
Asset () | |
Asset (ID id) | |
bool | operator== (ID id) const |
ID | id () const |
virtual String | getTypeStr () const |
![]() | |
Asset * | getNext () const |
bool | insertAfter (Asset *object) |
Iterator | begin () const |
Iterator | end () const |
Iterator | cbegin () const |
Iterator | cend () const |
![]() | |
virtual | ~LinkedObject () |
virtual LinkedObject * | next () const |
bool | insertAfter (LinkedObject *object) |
bool | operator== (const LinkedObject &other) const |
bool | operator!= (const LinkedObject &other) const |
Additional Inherited Members | |
![]() | |
enum class | Type { XX } |
using | List = LinkedObjectListTemplate< Asset > |
using | OwnedList = OwnedLinkedObjectListTemplate< Asset > |
using | ID = AssetID |
![]() | |
using | Iterator = IteratorTemplate< Asset, Asset *, Asset & > |
using | ConstIterator = IteratorTemplate< const Asset, const Asset *, const Asset & > |
![]() | |
static constexpr Asset::Type | assetType |
Detailed Description
Base class for a loaded typeface, e.g. Sans 16pt bold.
Member Function Documentation
◆ baseline()
|
inline |
Get baseline relative to top of mbox.
◆ descent()
|
pure virtual |
How many pixels from bottom of em-square to baseline
Implemented in Graphics::LcdTypeFace, and Graphics::ResourceTypeface.
◆ getGlyph()
|
pure virtual |
Get the glyph for a character.
- Parameters
-
ch options Options to control how the glyph is drawn (colour, shading, etc)
- Return values
-
GlyphObject* The glyph, nullptr if no glyph exists in the typeface for this character
Caller is responsible for destroying the glyph when no longer required.
Implemented in Graphics::ResourceTypeface, and Graphics::LcdTypeFace.
◆ getMetrics()
|
pure virtual |
Get metrics for a character.
Implemented in Graphics::LcdTypeFace, and Graphics::ResourceTypeface.
◆ getStyle()
|
pure virtual |
Style of this typeface (bold, italic, etc.)
Implemented in Graphics::LcdTypeFace, and Graphics::ResourceTypeface.
◆ getTextWidth()
uint16_t Graphics::TypeFace::getTextWidth | ( | const char * | text, |
uint16_t | length | ||
) | const |
Compute displayed width for a text string.
◆ height()
|
pure virtual |
Get height of typeface, same for all characters.
Implemented in Graphics::LcdTypeFace, and Graphics::ResourceTypeface.
◆ write()
|
inlineoverridevirtual |
Reimplemented from Graphics::Asset.
The documentation for this class was generated from the following file: