Go to the documentation of this file.
26 static const int _default_font_ascender[FS_END] = { 8, 5, 15, 8};
35 ascender(_default_font_ascender[fs]), descender(_default_font_ascender[fs] -
_default_font_height[fs]),
51 int FontCache::GetDefaultFontHeight(
FontSize fs)
73 bool GetFontAAState(
FontSize size,
bool check_blitter)
81 void SetFont(
FontSize fontsize,
const std::string& font, uint size,
bool aa)
86 if (setting->
font != font) {
91 if (setting->
size != size) {
96 if (setting->
aa != aa) {
101 if (!changed)
return;
107 if (fs == fontsize)
continue;
112 _fcsettings = backup;
131 if (monospace != (fs ==
FS_MONO))
continue;
139 #elif defined(_WIN32)
142 #elif defined(WITH_COCOA)
172 if (!
FontCache::Get(fs)->IsBuiltInFont() && GetFontAAState(fs,
false))
return true;
178 #if !defined(_WIN32) && !defined(__APPLE__) && !defined(WITH_FONTCONFIG) && !defined(WITH_COCOA)
void LoadStringWidthTable(bool monospace)
Initialize _stringwidth_table cache.
static const int _default_font_height[FS_END]
Default heights for the different sizes of fonts.
A searcher for missing glyphs.
Settings for a single font.
int GetHeight() const
Get the height of the font.
void SaveToConfig()
Save the values to the configuration file.
bool aa
Whether to do anti aliasing or not.
@ FS_LARGE
Index of the large font in the font tables.
static void ResetFontCache(FontSize size)
Reset cached font information.
Font cache for fonts that are based on a freetype font.
uint size
The (requested) size of the font.
void LoadFreeTypeFont(FontSize fs)
Loads the freetype font.
void UninitFontCache()
Free everything allocated w.r.t.
void UninitFreeType()
Free everything allocated w.r.t.
Settings for the four different fonts.
bool HasParent()
Check whether the font cache has a parent.
@ FS_NORMAL
Index of the normal font in the font tables.
void LoadWin32Font(FontSize fs)
Loads the GDI font.
void ReInitAllWindows(bool zoom_changed)
Re-initialize all windows.
std::string font
The name of the font, or path to the font.
@ FS_SMALL
Index of the small font in the font tables.
bool HasAntialiasedFonts()
Should any of the active fonts be anti-aliased?
void InitFontCache(bool monospace)
(Re)initialize the font cache related things, i.e.
static Blitter * GetCurrentBlitter()
Get the current active blitter (always set by calling SelectBlitter).
static FontCacheSubSetting * GetFontCacheSubSetting(FontSize fs)
Get the settings of a given font size.
virtual ~FontCache()
Clean everything up.
fluid_settings_t * settings
FluidSynth settings handle.
const FontSize fs
The size of the font.
static FontCache * caches[FS_END]
All the font caches.
virtual std::string GetFontName()=0
Get the name of this font.
Font cache for basic fonts.
bool SetFallbackFont(struct FontCacheSettings *settings, const char *language_isocode, int winlangid, class MissingGlyphSearcher *callback)
We would like to have a fallback font as the current one doesn't contain all characters we need.
void UpdateAllVirtCoords()
Update the viewport coordinates of all signs.
FontCache * parent
The parent of this font cache.
void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
Check whether the currently loaded language pack uses characters that the currently loaded font does ...
int GetCharacterHeight(FontSize size)
Get height of a character for a given font size.
@ FS_MONO
Index of the monospaced font in the font tables.
FontSize
Available font sizes.
void LoadCoreTextFont(FontSize fs)
Loads the TrueType font.
FontCache(FontSize fs)
Create a new font cache.
static FontCache * Get(FontSize fs)
Get the font cache of a given font size.