touchgfx::ConstFont class
@class ConstFont ConstFont.hpp touchgfx/ConstFont.hpp A ConstFont is a Font implementation that has its contents defined at compile-time and usually placed in read-only memory. A ConstFont is a Font implementation that has its contents defined at compile-time and usually placed in read-only memory. @see Font
class ConstFont : public Font
{
public:
ConstFont(const GlyphNode* list, uint16_t size, uint16_t height, uint8_t pixBelowBase, uint8_t bitsPerPixel, uint8_t maxLeft, uint8_t maxRight, const Unicode::UnicodeChar fallbackChar, const Unicode::UnicodeChar ellipsisChar);
using Font::getGlyph;
virtual const GlyphNode* getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const;
virtual const uint8_t* getPixelData(const GlyphNode* glyph) const = 0;
virtual int8_t getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const = 0;
protected:
const GlyphNode* find(Unicode::UnicodeChar unicode) const;
const GlyphNode* glyphList;
uint16_t listSize;
private:
ConstFont() : Font(0, 0, 0, 0, 0, 0, 0) { }
};
Methods
getGlyph() const
@fn virtual const GlyphNode* ConstFont::getGlyph(Unicode::UnicodeChar unicode, const uint8_t*& pixelData, uint8_t& bitsPerPixel) const; Gets the glyph data associated with the specified unicode. Gets the glyph data associated with the specified unicode. An implementation of Font::getGlyph. Searches the glyph list for the specified font. Complexity O(log n).
Read more...
getPixelData() const
@fn virtual const uint8_t* ConstFont::getPixelData(const GlyphNode* glyph) const = 0; Gets the pixel date associated with this glyph. Gets the pixel date associated with this glyph.
Read more...
getKerning() const
@fn virtual int8_t ConstFont::getKerning(Unicode::UnicodeChar prevChar, const GlyphNode* glyph) const = 0; Gets the kerning distance between two characters. Gets the kerning distance between two characters.
Read more...
find() const
@fn const GlyphNode* ConstFont::find(Unicode::UnicodeChar unicode) const; Finds the glyph data associated with the specified unicode. Finds the glyph data associated with the specified unicode.
Read more...
Parent classes
Child classes
touchgfx::ConstFont