MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / AddFontFromMemoryTTF

Method AddFontFromMemoryTTF

KBotExt/imgui/imgui_draw.cpp:2212–2223  ·  view source on GitHub ↗

NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().

Source from the content-addressed store, hash-verified

2210
2211// NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
2212ImFont* 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
2225ImFont* ImFontAtlas::AddFontFromMemoryCompressedTTF(const void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
2226{

Callers

nothing calls this directly

Calls 1

ImFontConfigClass · 0.85

Tested by

no test coverage detected