Go to the documentation of this file.
10 #ifndef SPRITEFONTCACHE_H
11 #define SPRITEFONTCACHE_H
13 #include "../string_func.h"
14 #include "../fontcache.h"
33 virtual const void *
GetFontTable(uint32 tag,
size_t &length) { length = 0;
return nullptr; }
uint32 GlyphID
Glyphs are characters from a font.
virtual void InitializeUnicodeGlyphMap()
Initialize the glyph map.
char32_t WChar
Type for wide characters, i.e.
virtual uint GetGlyphWidth(GlyphID key)
Get the width of the glyph with the given key.
virtual std::string GetFontName()
Get the name of this font.
Font cache for fonts that are based on a freetype font.
virtual GlyphID MapCharToGlyph(WChar key)
Map a character into a glyph.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
virtual const void * GetFontTable(uint32 tag, size_t &length)
Read a font table from the font.
SpriteID ** glyph_to_spriteid_map
Mapping of glyphs to sprite IDs.
const FontSize fs
The size of the font.
virtual bool GetDrawGlyphShadow()
Do we need to draw a glyph shadow?
Font cache for basic fonts.
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite)
Map a SpriteID to the key.
virtual void ClearFontCache()
Clear the font cache.
~SpriteFontCache()
Free everything we allocated.
void ClearGlyphToSpriteMap()
Clear the glyph to sprite mapping.
FontSize
Available font sizes.
virtual bool IsBuiltInFont()
Is this a built-in sprite font?
virtual const Sprite * GetGlyph(GlyphID key)
Get the glyph (sprite) of the given key.
SpriteFontCache(FontSize fs)
Create a new sprite font cache.
Data structure describing a sprite.