Load embedded ProggyClean.ttf at size 13, disable oversampling
| 2121 | |
| 2122 | // Load embedded ProggyClean.ttf at size 13, disable oversampling |
| 2123 | ImFont* ImFontAtlas::AddFontDefault(const ImFontConfig* font_cfg_template) |
| 2124 | { |
| 2125 | ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); |
| 2126 | if (!font_cfg_template) |
| 2127 | { |
| 2128 | font_cfg.OversampleH = font_cfg.OversampleV = 1; |
| 2129 | font_cfg.PixelSnapH = true; |
| 2130 | } |
| 2131 | if (font_cfg.SizePixels <= 0.0f) |
| 2132 | font_cfg.SizePixels = 13.0f * 1.0f; |
| 2133 | if (font_cfg.Name[0] == '\0') |
| 2134 | ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels); |
| 2135 | font_cfg.EllipsisChar = (ImWchar)0x0085; |
| 2136 | font_cfg.GlyphOffset.y = 1.0f * IM_FLOOR(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units |
| 2137 | |
| 2138 | const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85(); |
| 2139 | const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault(); |
| 2140 | ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, glyph_ranges); |
| 2141 | return font; |
| 2142 | } |
| 2143 | |
| 2144 | ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) |
| 2145 | { |
nothing calls this directly
no test coverage detected