OpenTTD Source
20241120-master-g6d3adc6169
|
Functions related to font handling on Win32. More...
#include "../../stdafx.h"
#include "../../debug.h"
#include "../../blitter/factory.hpp"
#include "../../core/math_func.hpp"
#include "../../core/mem_func.hpp"
#include "../../error_func.h"
#include "../../fileio_func.h"
#include "../../fontcache.h"
#include "../../fontcache/truetypefontcache.h"
#include "../../fontdetection.h"
#include "../../library_loader.h"
#include "../../string_func.h"
#include "../../strings_func.h"
#include "../../zoom_func.h"
#include "font_win32.h"
#include "../../table/control_codes.h"
#include <windows.h>
#include <shlobj.h>
#include "os/windows/win32.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | EFCParam |
Functions | |
static int CALLBACK | EnumFontCallback (const ENUMLOGFONTEX *logfont, const NEWTEXTMETRICEX *metric, DWORD type, LPARAM lParam) |
bool | SetFallbackFont (FontCacheSettings *settings, const std::string &, int winlangid, MissingGlyphSearcher *callback) |
We would like to have a fallback font as the current one doesn't contain all characters we need. More... | |
static bool | TryLoadFontFromFile (const std::string &font_name, LOGFONT &logfont) |
static void | LoadWin32Font (FontSize fs, const LOGFONT &logfont, uint size, const char *font_name) |
void | LoadWin32Font (FontSize fs) |
Loads the GDI font. More... | |
Functions related to font handling on Win32.
Definition in file font_win32.cpp.
void LoadWin32Font | ( | FontSize | fs | ) |
Loads the GDI font.
If a GDI font description is present, e.g. from the automatic font fallback search, use it. Otherwise, try to resolve it by font name.
fs | The font size to load. |
Definition at line 352 of file font_win32.cpp.
References FS_MONO, GetFontCacheFontName(), GetFontCacheSubSetting(), MemSetT(), and settings.
bool SetFallbackFont | ( | struct FontCacheSettings * | settings, |
const std::string & | 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.
This function must set all fonts of settings.
settings | the settings to overwrite the fontname of. |
language_isocode | the language, e.g. en_GB. |
winlangid | the language ID windows style. |
callback | The function to call to check for missing glyphs. |
Definition at line 78 of file font_win32.cpp.