| 50 | } |
| 51 | |
| 52 | void 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 | |
| 71 | void UnloadTtfFont() { |
| 72 | if (font && TTF_WasInit()) |
no test coverage detected