Load embedded ProggyClean.ttf at size 13, disable oversampling
| 2107 | |
| 2108 | // Load embedded ProggyClean.ttf at size 13, disable oversampling |
| 2109 | ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) |
| 2110 | { |
| 2111 | ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); |
| 2112 | if (!font_cfg_template) |
| 2113 | { |
| 2114 | font_cfg.OversampleH = font_cfg.OversampleV = 1; |
| 2115 | font_cfg.PixelSnapH = true; |
| 2116 | } |
| 2117 | if (font_cfg.SizePixels <= 0.0f) |
| 2118 | font_cfg.SizePixels = 13.0f * 1.0f; |
| 2119 | if (font_cfg.Name[0] == '\0') |
| 2120 | ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels); |
| 2121 | font_cfg.EllipsisChar = (ImWchar)0x0085; |
| 2122 | font_cfg.GlyphOffset.y = 1.0f * IM_FLOOR(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units |
| 2123 | |
| 2124 | const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85(); |
| 2125 | const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault(); |
| 2126 | ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, glyph_ranges); |
| 2127 | return font; |
| 2128 | } |
| 2129 | |
| 2130 | ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) |
| 2131 | { |
nothing calls this directly
no test coverage detected