| 990 | } |
| 991 | |
| 992 | void loadFonts() |
| 993 | { |
| 994 | // Assume if any fonts are loaded, they all are. |
| 995 | if (s_fonts[0]) { return; } |
| 996 | |
| 997 | char fontPath[TFE_MAX_PATH]; |
| 998 | sprintf(fontPath, "%s", "Fonts/DroidSansMono.ttf"); |
| 999 | TFE_Paths::mapSystemPath(fontPath); |
| 1000 | |
| 1001 | ImGuiIO& io = ImGui::GetIO(); |
| 1002 | ImFont** fontSmall = &s_fonts[FONT_SMALL * FONT_SIZE_COUNT]; |
| 1003 | fontSmall[0] = io.Fonts->AddFontFromFileTTF(fontPath, 16 * 100 / 100); |
| 1004 | fontSmall[1] = io.Fonts->AddFontFromFileTTF(fontPath, 16 * 125 / 100); |
| 1005 | fontSmall[2] = io.Fonts->AddFontFromFileTTF(fontPath, 16 * 150 / 100); |
| 1006 | fontSmall[3] = io.Fonts->AddFontFromFileTTF(fontPath, 16 * 175 / 100); |
| 1007 | fontSmall[4] = io.Fonts->AddFontFromFileTTF(fontPath, 16 * 200 / 100); |
| 1008 | s_fontLarge = io.Fonts->AddFontFromFileTTF(fontPath, 48); |
| 1009 | TFE_Ui::invalidateFontAtlas(); |
| 1010 | } |
| 1011 | |
| 1012 | void pushFont(FontType type) |
| 1013 | { |
no test coverage detected