10 #ifndef MOCK_FONTCACHE_H
11 #define MOCK_FONTCACHE_H
13 #include "../stdafx.h"
15 #include "../fontcache.h"
16 #include "../string_func.h"
23 this->
height = FontCache::GetDefaultFontHeight(this->fs);
32 GlyphID MapCharToGlyph(char32_t key, [[maybe_unused]]
bool allow_fallback =
true)
override {
return key; }
36 static void InitializeFontCaches()
Font cache for basic fonts.
int height
The height of the font.
static FontCache * caches[FS_END]
All the font caches.
FontCache(FontSize fs)
Create a new font cache.
const FontSize fs
The size of the font.
Font cache for mocking basic use of fonts.
std::string GetFontName() override
Get the name of this font.
uint GetGlyphWidth(GlyphID) override
Get the width of the glyph with the given key.
void ClearFontCache() override
Clear the font cache.
void SetUnicodeGlyph(char32_t, SpriteID) override
Map a SpriteID to the key.
bool GetDrawGlyphShadow() override
Do we need to draw a glyph shadow?
void InitializeUnicodeGlyphMap() override
Initialize the glyph map.
bool IsBuiltInFont() override
Is this a built-in sprite font?
const Sprite * GetGlyph(GlyphID) override
Get the glyph (sprite) of the given key.
uint32_t GlyphID
Glyphs are characters from a font.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
FontSize
Available font sizes.
Data structure describing a sprite.