10#ifndef MOCK_FONTCACHE_H
11#define MOCK_FONTCACHE_H
13#include "../fontcache.h"
14#include "../string_func.h"
21 this->
height = FontCache::GetDefaultFontHeight(this->fs);
32 static void InitializeFontCaches()
Font cache for basic fonts.
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.
Font cache for mocking basic use of fonts.
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?
uint32_t GlyphID
Glyphs are characters from a font.
FontSize
Available font sizes.
Data structure describing a sprite.