10#ifndef MOCK_FONTCACHE_H
11#define MOCK_FONTCACHE_H
17class MockFontCache :
public FontCache {
21 this->
height = FontCache::GetDefaultFontHeight(this->fs);
28 GlyphID
MapCharToGlyph(
char32_t key, [[maybe_unused]]
bool allow_fallback =
true)
override {
return key; }
int height
The height of the font.
static void Register(std::unique_ptr< FontCache > &&fc)
Register a FontCache for its font size.
const FontSize fs
The size of the font.
static FontCache * Get(FontSize fs)
Get the font cache of a given font size.
static void InitializeFontCaches()
Initialise font caches with the base sprite font cache for all sizes.
GlyphID MapCharToGlyph(char32_t key, bool allow_fallback=true) override
Map a character into a glyph.
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.
const Sprite * GetGlyph(GlyphID) override
Get the glyph (sprite) of the given key.
bool GetDrawGlyphShadow() override
Do we need to draw a glyph shadow?
bool IsBuiltInFont() override
Is this a built-in sprite font?
Functions to read fonts from files and cache them.
FontSize
Available font sizes.
Functions related to low-level strings.
Data structure describing a sprite.