MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / AddCustomRectFontGlyph

Method AddCustomRectFontGlyph

plugins/Cardinal/src/DearImGui/imgui_draw.cpp:2212–2229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2210}
2211
2212int ImFontAtlas::AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset)
2213{
2214#ifdef IMGUI_USE_WCHAR32
2215 IM_ASSERT(id <= IM_UNICODE_CODEPOINT_MAX);
2216#endif
2217 IM_ASSERT(font != NULL);
2218 IM_ASSERT(width > 0 && width <= 0xFFFF);
2219 IM_ASSERT(height > 0 && height <= 0xFFFF);
2220 ImFontAtlasCustomRect r;
2221 r.Width = (unsigned short)width;
2222 r.Height = (unsigned short)height;
2223 r.GlyphID = id;
2224 r.GlyphAdvanceX = advance_x;
2225 r.GlyphOffset = offset;
2226 r.Font = font;
2227 CustomRects.push_back(r);
2228 return CustomRects.Size - 1; // Return index
2229}
2230
2231void ImFontAtlas::CalcCustomRectUV(const ImFontAtlasCustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max) const
2232{

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected