You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMGUI_API voidBuildRanges(ImVector<ImWchar>* out_ranges); // Output new ranges
3607
3607
};
3608
3608
3609
+
// An identifier to a rectangle in the atlas. -1 when invalid.
3610
+
// The rectangle may move and UV may be invalidated, use GetCustomRect() to retrieve it.
3611
+
typedefint ImFontAtlasRectId;
3612
+
#defineImFontAtlasRectId_Invalid -1
3613
+
3609
3614
// Output of ImFontAtlas::GetCustomRect() when using custom rectangles.
3610
3615
// Those values may not be cached/stored as they are only valid for the current value of atlas->TexRef
3616
+
// (this is in theory derived from ImTextureRect but we use separate structures for reasons)
3611
3617
structImFontAtlasRect
3612
3618
{
3613
3619
unsignedshort x, y; // Position (in current texture)
@@ -3724,8 +3730,8 @@ struct ImFontAtlas
3724
3730
// - AddCustomRectRegular() --> Renamed to AddCustomRect()
3725
3731
// - AddCustomRectFontGlyph() --> Prefer using custom ImFontLoader inside ImFontConfig
3726
3732
// - ImFontAtlasCustomRect --> Renamed to ImFontAtlasRect
3727
-
IMGUI_API intAddCustomRect(int width, int height);// Register a rectangle. Return -1 on error.
3728
-
IMGUI_API boolGetCustomRect(int id, ImFontAtlasRect* out_r) const;// Get rectangle coordinates for current texture. Valid immediately, never store this (read above)!
3733
+
IMGUI_API ImFontAtlasRectId AddCustomRect(intwidth, int height);// Register a rectangle. Return -1 (ImFontAtlasRectId_Invalid) on error.
3734
+
IMGUI_API boolGetCustomRect(ImFontAtlasRectId id, ImFontAtlasRect* out_r) const; // Get rectangle coordinates for current texture. Valid immediately, never store this (read above)!
3729
3735
3730
3736
//-------------------------------------------
3731
3737
// Members
@@ -3776,11 +3782,11 @@ struct ImFontAtlas
3776
3782
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3777
3783
// Legacy: You can request your rectangles to be mapped as font glyph (given a font + Unicode point), so you can render e.g. custom colorful icons and use them as regular glyphs. --> Prefer using a custom ImFontLoader.
3778
3784
ImFontAtlasRect TempRect; // For old GetCustomRectByIndex() API
3779
-
inlineintAddCustomRectRegular(int w, int h) { returnAddCustomRect(w, h); } // RENAMED in 1.92.X
IMGUI_API intAddCustomRectFontGlyph(ImFont* font, ImWchar codepoint, int w, int h, float advance_x, const ImVec2& offset = ImVec2(0, 0)); // OBSOLETED in 1.92.X: Use custom ImFontLoader in ImFontConfig
3783
-
IMGUI_API intAddCustomRectFontGlyphForSize(ImFont* font, float font_size, ImWchar codepoint, int w, int h, float advance_x, const ImVec2& offset = ImVec2(0, 0)); // ADDED AND OBSOLETED in 1.92.X
3788
+
IMGUI_API ImFontAtlasRectIdAddCustomRectFontGlyph(ImFont* font, ImWchar codepoint, int w, int h, float advance_x, const ImVec2& offset = ImVec2(0, 0)); // OBSOLETED in 1.92.X: Use custom ImFontLoader in ImFontConfig
3789
+
IMGUI_API ImFontAtlasRectIdAddCustomRectFontGlyphForSize(ImFont* font, float font_size, ImWchar codepoint, int w, int h, float advance_x, const ImVec2& offset = ImVec2(0, 0)); // ADDED AND OBSOLETED in 1.92.X
3784
3790
#endif
3785
3791
//int TexDesiredWidth; // OBSOLETED in 1.92.X (force texture width before calling Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height)
3786
3792
//typedef ImFontAtlasRect ImFontAtlasCustomRect; // OBSOLETED in 1.92.X
0 commit comments