NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
| 2210 | |
| 2211 | // NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build(). |
| 2212 | ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* ttf_data, int ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) |
| 2213 | { |
| 2214 | IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); |
| 2215 | ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig(); |
| 2216 | IM_ASSERT(font_cfg.FontData == NULL); |
| 2217 | font_cfg.FontData = ttf_data; |
| 2218 | font_cfg.FontDataSize = ttf_size; |
| 2219 | font_cfg.SizePixels = size_pixels > 0.0f ? size_pixels : font_cfg.SizePixels; |
| 2220 | if (glyph_ranges) |
| 2221 | font_cfg.GlyphRanges = glyph_ranges; |
| 2222 | return AddFont(&font_cfg); |
| 2223 | } |
| 2224 | |
| 2225 | ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges) |
| 2226 | { |
nothing calls this directly
no test coverage detected