OpenTTD Source: src/fontcache/freetypefontcache.cpp File Reference

OpenTTD Source 14.1

Data Structures | Functions | Variables
freetypefontcache.cpp File Reference
`#include "../stdafx.h"`
`#include "../debug.h"`
`#include "../fontcache.h"`
`#include "../fontdetection.h"`
`#include "../blitter/factory.hpp"`
`#include "../core/math_func.hpp"`
`#include "../zoom_func.h"`
`#include "../fileio_func.h"`
`#include "../error_func.h"`
`#include "truetypefontcache.h"`
`#include "../table/control_codes.h"`
`#include "../safeguards.h"`
`#include <ft2build.h>`
`#include <FT_FREETYPE_H>`
`#include <FT_GLYPH_H>`
`#include <FT_TRUETYPE_TABLES_H>`

Go to the source code of this file.

## Data Structures
class | FreeTypeFontCache
| Font cache for fonts that are based on a freetype font. More...

## Functions
static FT_Error | LoadFont (FontSize fs, FT_Face face, const char *font_name, uint size)
void | LoadFreeTypeFont (FontSize fs)
| Loads the freetype font. More...
void | LoadFreeTypeFont (FontSize fs, const std::string &file_name, uint size)
| Load a TrueType font from a file. More...
void | UninitFreeType ()
| Free everything allocated w.r.t. More...

## Variables
FT_Library | _library = nullptr

## Detailed Description

FreeType font cache implementation.

Definition in file freetypefontcache.cpp.

## Function Documentation

## ◆ LoadFreeTypeFont() [1/2]

void LoadFreeTypeFont | ( | FontSize | fs | ) |

Loads the freetype font.

First type to load the fontname as if it were a path. If that fails, try to resolve the filename of the font using fontconfig, where the format is 'font family name' or 'font family name, font style'.

Parameters

  fs | The font size to load.

Definition at line 161 of file freetypefontcache.cpp.

References GetFontCacheSubSetting(), and settings.

## ◆ LoadFreeTypeFont() [2/2]

void LoadFreeTypeFont | ( | FontSize | fs,
|  | const std::string & | file_name,
|  | uint | size
| ) |  |

Load a TrueType font from a file.

Parameters

  fs | The font size to load.
  file_name | Path to the font file.
  size | Requested font size.

Definition at line 211 of file freetypefontcache.cpp.

## ◆ UninitFreeType()

void UninitFreeType | ( |  | ) |

Free everything allocated w.r.t.

freetype.

Definition at line 347 of file freetypefontcache.cpp.