# fontcache.cpp File Reference

Cache for characters from fonts. More...

`#include "stdafx.h"`
`#include "fontcache.h"`
`#include "blitter/factory.hpp"`
`#include "core/math_func.hpp"`
`#include "table/sprites.h"`
`#include "table/control_codes.h"`
`#include "table/unicode.h"`

Go to the source code of this file.

## Functions

void | ResetFontSizes ()
| Reset the font sizes to the defaults of the sprite based fonts.
static SpriteID | GetFontBase (FontSize size)
| Get the SpriteID of the first glyph for the given font size.
SpriteID | GetUnicodeGlyph (FontSize size, uint32 key)
| Get the SpriteID mapped to the given font size and key.
void | SetUnicodeGlyph (FontSize size, uint32 key, SpriteID sprite)
| Map a SpriteID to the font size and key.
void | InitializeUnicodeGlyphMap ()
| Initialize the glyph map.

## Variables

static const int | ASCII_LETTERSTART = 32
| First printable ASCII letter.
int | _font_height [FS_END]
| Semi-constant for the height of the different sizes of fonts.
static SpriteID ** | _unicode_glyph_map [FS_END]

## Detailed Description

Cache for characters from fonts.

Definition in file fontcache.cpp.

## Function Documentation

void ResetFontSizes | ( |  | ) |

Reset the font sizes to the defaults of the sprite based fonts.

Definition at line 1039 of file fontcache.cpp.

References _font_height, FS_LARGE, FS_NORMAL, and FS_SMALL.

## Variable Documentation

int _font_height[FS_END]

Semi-constant for the height of the different sizes of fonts.

Definition at line 23 of file fontcache.cpp.

Referenced by GetCharacterHeight(), and ResetFontSizes().