MCPcopy Create free account
hub / github.com/diasurgical/devilution / LoadTtfFont

Function LoadTtfFont

SourceX/DiabloUI/fonts.cpp:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void LoadTtfFont() {
53 if (!TTF_WasInit()) {
54 if (TTF_Init() == -1) {
55 SDL_Log("TTF_Init: %s", TTF_GetError());
56 exit(1);
57 }
58 atexit(TTF_Quit);
59 }
60
61 font = TTF_OpenFont(TTF_FONT_PATH, 17);
62 if (font == NULL) {
63 SDL_Log("TTF_OpenFont: %s", TTF_GetError());
64 return;
65 }
66
67 TTF_SetFontKerning(font, false);
68 TTF_SetFontHinting(font, TTF_HINTING_MONO);
69}
70
71void UnloadTtfFont() {
72 if (font && TTF_WasInit())

Callers 3

InitFunction · 0.85
progress_LoadFunction · 0.85
CreditsRendererMethod · 0.85

Calls 1

SDL_LogFunction · 0.85

Tested by

no test coverage detected