| 2168 | } |
| 2169 | |
| 2170 | ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) |
| 2171 | { |
| 2172 | const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_ttf_data); |
| 2173 | unsigned char* buf_decompressed_data = (unsigned char*)IM_ALLOC(buf_decompressed_size); |
| 2174 | stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size); |
| 2175 | |
| 2176 | ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); |
| 2177 | IM_ASSERT(font_cfg.FontData == NULL); |
| 2178 | font_cfg.FontDataOwnedByAtlas = true; |
| 2179 | return AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, &font_cfg, glyph_ranges); |
| 2180 | } |
| 2181 | |
| 2182 | ImFont* ImFontAtlas::AddFontFromMemoryCompressedBase85TTF(const char* compressed_ttf_data_base85, float size_pixels, const ImFontConfig* font_cfg, const ImWchar* glyph_ranges) |
| 2183 | { |
nothing calls this directly
no test coverage detected