OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
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()
uint GetGlyphWidth(GlyphID) override
Get the width of the glyph with the given key.
int height
The height of the font.
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?
uint32_t GlyphID
Glyphs are characters from a font.
bool IsBuiltInFont() override
Is this a built-in sprite font?
const FontSize fs
The size of the font.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Font cache for mocking basic use of fonts.
static FontCache * caches[FS_END]
All the font caches.
Font cache for basic fonts.
std::string GetFontName() override
Get the name of this font.
void SetUnicodeGlyph(char32_t, SpriteID) override
Map a SpriteID to the key.
FontSize
Available font sizes.
Data structure describing a sprite.
FontCache(FontSize fs)
Create a new font cache.
void InitializeUnicodeGlyphMap() override
Initialize the glyph map.