20 static const GlyphID SPRITE_GLYPH = 1U << 30;
120 virtual const void *
GetFontTable(uint32 tag,
size_t &length) = 0;
144 return this->parent != NULL;
virtual const char * GetFontName()=0
Get the name of this font.
int height
The height of the font.
void InitFreeType(bool monospace)
(Re)initialize the freetype related things, i.e.
int descender
The descender value of the font.
Settings for a single freetype font.
Data structure describing a sprite.
FreeTypeSubSetting large
The largest font; mostly used for newspapers.
int units_per_em
The units per EM value of the font.
virtual void SetUnicodeGlyph(WChar key, SpriteID sprite)=0
Map a SpriteID to the key.
static FontCache * Get(FontSize fs)
Get the font cache of a given font size.
int GetAscender() const
Get the ascender value of the font.
Settings for the freetype fonts.
bool HasParent()
Check whether the font cache has a parent.
bool aa
Whether to do anti aliasing or not.
virtual ~FontCache()
Clean everything up.
FreeTypeSubSetting mono
The mono space font used for license/readme viewers.
FontCache(FontSize fs)
Create a new font cache.
virtual uint GetGlyphWidth(GlyphID key)=0
Get the width of the glyph with the given key.
int GetUnitsPerEM() const
Get the units per EM value of the font.
virtual int GetHeight() const
Get the height of the font.
FreeTypeSubSetting medium
The normal font size.
Functions to cache sprites in memory.
int GetDescender() const
Get the descender value of the font.
virtual GlyphID MapCharToGlyph(WChar key)=0
Map a character into a glyph.
Font cache for basic fonts.
FontCache * parent
The parent of this font cache.
uint size
The (requested) size of the font.
virtual const void * GetFontTable(uint32 tag, size_t &length)=0
Read a font table from the font.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
static FontCache * caches[FS_END]
All the font caches.
FontSize GetSize() const
Get the FontSize of the font.
FreeTypeSubSetting small
The smallest font; mostly used for zoomed out view.
virtual const Sprite * GetGlyph(GlyphID key)=0
Get the glyph (sprite) of the given key.
FontSize
Available font sizes.
virtual bool GetDrawGlyphShadow()=0
Do we need to draw a glyph shadow?
virtual void InitializeUnicodeGlyphMap()=0
Initialize the glyph map.
int ascender
The ascender value of the font.
const FontSize fs
The size of the font.
void UninitFreeType()
Free everything allocated w.r.t.
uint32 GlyphID
Glyphs are characters from a font.
virtual void ClearFontCache()=0
Clear the font cache.
uint32 WChar
Type for wide characters, i.e.
virtual SpriteID GetUnicodeGlyph(WChar key)=0
Get the SpriteID mapped to the given key.