OpenTTD Source  20241108-master-g80f628063a
freetypefontcache.cpp File Reference

FreeType font cache implementation. More...

#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 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()

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
fsThe font size to load.

Definition at line 159 of file freetypefontcache.cpp.

References GetFontCacheFontName(), GetFontCacheSubSetting(), and settings.

◆ UninitFreeType()

void UninitFreeType ( )

Free everything allocated w.r.t.

freetype.

Definition at line 303 of file freetypefontcache.cpp.