Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ImFontAtlas Struct Reference

#include <src/imgui/imgui.h>

+ Collaboration diagram for ImFontAtlas:

Public Types

typedef ImFontAtlasCustomRect CustomRect
 
typedef ImFontGlyphRangesBuilder GlyphRangesBuilder
 

Public Member Functions

IMGUI_API ImFontAtlas ()
 
IMGUI_API ~ImFontAtlas ()
 
IMGUI_API ImFontAddFont (const ImFontConfig *font_cfg)
 
IMGUI_API ImFontAddFontDefault (const ImFontConfig *font_cfg=NULL)
 
IMGUI_API ImFontAddFontFromFileTTF (const char *filename, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
 
IMGUI_API ImFontAddFontFromMemoryTTF (void *font_data, int font_size, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
 
IMGUI_API ImFontAddFontFromMemoryCompressedTTF (const void *compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
 
IMGUI_API ImFontAddFontFromMemoryCompressedBase85TTF (const char *compressed_font_data_base85, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
 
IMGUI_API void ClearInputData ()
 
IMGUI_API void ClearTexData ()
 
IMGUI_API void ClearFonts ()
 
IMGUI_API void Clear ()
 
IMGUI_API bool Build ()
 
IMGUI_API void GetTexDataAsAlpha8 (unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
 
IMGUI_API void GetTexDataAsRGBA32 (unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
 
bool IsBuilt () const
 
void SetTexID (ImTextureID id)
 
IMGUI_API const ImWcharGetGlyphRangesDefault ()
 
IMGUI_API const ImWcharGetGlyphRangesKorean ()
 
IMGUI_API const ImWcharGetGlyphRangesJapanese ()
 
IMGUI_API const ImWcharGetGlyphRangesChineseFull ()
 
IMGUI_API const ImWcharGetGlyphRangesChineseSimplifiedCommon ()
 
IMGUI_API const ImWcharGetGlyphRangesCyrillic ()
 
IMGUI_API const ImWcharGetGlyphRangesThai ()
 
IMGUI_API const ImWcharGetGlyphRangesVietnamese ()
 
IMGUI_API int AddCustomRectRegular (int width, int height)
 
IMGUI_API int AddCustomRectFontGlyph (ImFont *font, ImWchar id, int width, int height, float advance_x, const ImVec2 &offset=ImVec2(0, 0))
 
ImFontAtlasCustomRectGetCustomRectByIndex (int index)
 
IMGUI_API void CalcCustomRectUV (const ImFontAtlasCustomRect *rect, ImVec2 *out_uv_min, ImVec2 *out_uv_max) const
 
IMGUI_API bool GetMouseCursorTexData (ImGuiMouseCursor cursor, ImVec2 *out_offset, ImVec2 *out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])
 

Public Attributes

ImFontAtlasFlags Flags
 
ImTextureID TexID
 
int TexDesiredWidth
 
int TexGlyphPadding
 
bool Locked
 
bool TexPixelsUseColors
 
unsigned char * TexPixelsAlpha8
 
unsigned int * TexPixelsRGBA32
 
int TexWidth
 
int TexHeight
 
ImVec2 TexUvScale
 
ImVec2 TexUvWhitePixel
 
ImVector< ImFont * > Fonts
 
ImVector< ImFontAtlasCustomRectCustomRects
 
ImVector< ImFontConfigConfigData
 
ImVec4 TexUvLines [IM_DRAWLIST_TEX_LINES_WIDTH_MAX+1]
 
const ImFontBuilderIOFontBuilderIO
 
unsigned int FontBuilderFlags
 
int PackIdMouseCursors
 
int PackIdLines
 

Detailed Description

Member Typedef Documentation

◆ CustomRect

◆ GlyphRangesBuilder

Constructor & Destructor Documentation

◆ ImFontAtlas()

ImFontAtlas::ImFontAtlas ( )
1962{
1963 memset(this, 0, sizeof(*this));
1964 TexGlyphPadding = 1;
1966}
int PackIdLines
Definition imgui.h:2679
int TexGlyphPadding
Definition imgui.h:2656
int PackIdMouseCursors
Definition imgui.h:2678

References PackIdLines, PackIdMouseCursors, and TexGlyphPadding.

◆ ~ImFontAtlas()

ImFontAtlas::~ImFontAtlas ( )
1969{
1970 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
1971 Clear();
1972}
#define IM_ASSERT(_EXPR)
Definition imgui.h:81
bool Locked
Definition imgui.h:2657
IMGUI_API void Clear()
Definition imgui_draw.cpp:2016

References Clear(), IM_ASSERT, and Locked.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddCustomRectFontGlyph()

int ImFontAtlas::AddCustomRectFontGlyph ( ImFont font,
ImWchar  id,
int  width,
int  height,
float  advance_x,
const ImVec2 offset = ImVec2(0, 0) 
)
2201{
2202#ifdef IMGUI_USE_WCHAR32
2204#endif
2205 IM_ASSERT(font != NULL);
2206 IM_ASSERT(width > 0 && width <= 0xFFFF);
2207 IM_ASSERT(height > 0 && height <= 0xFFFF);
2209 r.Width = (unsigned short)width;
2210 r.Height = (unsigned short)height;
2211 r.GlyphID = id;
2212 r.GlyphAdvanceX = advance_x;
2213 r.GlyphOffset = offset;
2214 r.Font = font;
2216 return CustomRects.Size - 1; // Return index
2217}
#define IM_UNICODE_CODEPOINT_MAX
Definition imgui.h:2010
void offset(Slic3r::ExPolygon &sh, coord_t distance, const PolygonTag &)
Definition geometries.hpp:132
Definition imgui.h:2551
ImVec2 GlyphOffset
Definition imgui.h:2556
float GlyphAdvanceX
Definition imgui.h:2555
unsigned int GlyphID
Definition imgui.h:2554
unsigned short Height
Definition imgui.h:2552
unsigned short Width
Definition imgui.h:2552
ImFont * Font
Definition imgui.h:2557
ImVector< ImFontAtlasCustomRect > CustomRects
Definition imgui.h:2669
void push_back(const T &v)
Definition imgui.h:1696
int Size
Definition imgui.h:1655

References CustomRects, ImFontAtlasCustomRect::Font, ImFontAtlasCustomRect::GlyphAdvanceX, ImFontAtlasCustomRect::GlyphID, ImFontAtlasCustomRect::GlyphOffset, ImFontAtlasCustomRect::Height, IM_ASSERT, IM_UNICODE_CODEPOINT_MAX, ImVector< T >::push_back(), ImVector< T >::Size, and ImFontAtlasCustomRect::Width.

Referenced by Slic3r::GUI::ImGuiWrapper::init_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddCustomRectRegular()

int ImFontAtlas::AddCustomRectRegular ( int  width,
int  height 
)
2190{
2191 IM_ASSERT(width > 0 && width <= 0xFFFF);
2192 IM_ASSERT(height > 0 && height <= 0xFFFF);
2194 r.Width = (unsigned short)width;
2195 r.Height = (unsigned short)height;
2197 return CustomRects.Size - 1; // Return index
2198}

References CustomRects, ImFontAtlasCustomRect::Height, IM_ASSERT, ImVector< T >::push_back(), ImVector< T >::Size, and ImFontAtlasCustomRect::Width.

Referenced by ImFontAtlasBuildInit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFont()

ImFont * ImFontAtlas::AddFont ( const ImFontConfig font_cfg)
2064{
2065 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
2066 IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0);
2067 IM_ASSERT(font_cfg->SizePixels > 0.0f);
2068
2069 // Create new font
2070 if (!font_cfg->MergeMode)
2072 else
2073 IM_ASSERT(!Fonts.empty() && "Cannot use MergeMode for the first font"); // When using MergeMode make sure that a font has already been added before. You can use ImGui::GetIO().Fonts->AddFontDefault() to add the default imgui font.
2074
2075 ConfigData.push_back(*font_cfg);
2076 ImFontConfig& new_font_cfg = ConfigData.back();
2077 if (new_font_cfg.DstFont == NULL)
2078 new_font_cfg.DstFont = Fonts.back();
2079 if (!new_font_cfg.FontDataOwnedByAtlas)
2080 {
2081 new_font_cfg.FontData = IM_ALLOC(new_font_cfg.FontDataSize);
2082 new_font_cfg.FontDataOwnedByAtlas = true;
2083 memcpy(new_font_cfg.FontData, font_cfg->FontData, (size_t)new_font_cfg.FontDataSize);
2084 }
2085
2086 if (new_font_cfg.DstFont->EllipsisChar == (ImWchar)-1)
2087 new_font_cfg.DstFont->EllipsisChar = font_cfg->EllipsisChar;
2088
2089 // Invalidate texture
2090 ClearTexData();
2091 return new_font_cfg.DstFont;
2092}
ImWchar16 ImWchar
Definition imgui.h:220
#define IM_ALLOC(_SIZE)
Definition imgui.h:1634
#define IM_NEW(_TYPE)
Definition imgui.h:1637
ImVector< ImFont * > Fonts
Definition imgui.h:2668
IMGUI_API void ClearTexData()
Definition imgui_draw.cpp:1996
ImVector< ImFontConfig > ConfigData
Definition imgui.h:2670
Definition imgui.h:2495
void * FontData
Definition imgui.h:2496
float SizePixels
Definition imgui.h:2500
int FontDataSize
Definition imgui.h:2497
ImFont * DstFont
Definition imgui.h:2516
bool FontDataOwnedByAtlas
Definition imgui.h:2498
bool MergeMode
Definition imgui.h:2509
ImWchar EllipsisChar
Definition imgui.h:2512
Definition imgui.h:2690
ImWchar EllipsisChar
Definition imgui.h:2706
T & back()
Definition imgui.h:1685
bool empty() const
Definition imgui.h:1670

References ImVector< T >::back(), ClearTexData(), ConfigData, ImFontConfig::DstFont, ImFontConfig::EllipsisChar, ImFont::EllipsisChar, ImVector< T >::empty(), ImFontConfig::FontData, ImFontConfig::FontDataOwnedByAtlas, ImFontConfig::FontDataSize, Fonts, IM_ALLOC, IM_ASSERT, IM_NEW, Locked, ImFontConfig::MergeMode, ImVector< T >::push_back(), and ImFontConfig::SizePixels.

Referenced by AddFontFromMemoryTTF().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFontDefault()

ImFont * ImFontAtlas::AddFontDefault ( const ImFontConfig font_cfg = NULL)
2112{
2113 ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
2114 if (!font_cfg_template)
2115 {
2116 font_cfg.OversampleH = font_cfg.OversampleV = 1;
2117 font_cfg.PixelSnapH = true;
2118 }
2119 if (font_cfg.SizePixels <= 0.0f)
2120 font_cfg.SizePixels = 13.0f * 1.0f;
2121 if (font_cfg.Name[0] == '\0')
2122 ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "ProggyClean.ttf, %dpx", (int)font_cfg.SizePixels);
2123 font_cfg.EllipsisChar = (ImWchar)0x0085;
2124 font_cfg.GlyphOffset.y = 1.0f * IM_FLOOR(font_cfg.SizePixels / 13.0f); // Add +1 offset per 13 units
2125
2126 const char* ttf_compressed_base85 = GetDefaultCompressedFontDataTTFBase85();
2127 const ImWchar* glyph_ranges = font_cfg.GlyphRanges != NULL ? font_cfg.GlyphRanges : GetGlyphRangesDefault();
2128 ImFont* font = AddFontFromMemoryCompressedBase85TTF(ttf_compressed_base85, font_cfg.SizePixels, &font_cfg, glyph_ranges);
2129 return font;
2130}
int ImFormatString(char *buf, size_t buf_size, const char *fmt,...)
Definition imgui.cpp:1435
#define IM_ARRAYSIZE(_ARR)
Definition imgui.h:83
static const char * GetDefaultCompressedFontDataTTFBase85()
Definition imgui_draw.cpp:4168
#define IM_FLOOR(_VAL)
Definition imgui_internal.h:232
IMGUI_API ImFont * AddFontFromMemoryCompressedBase85TTF(const char *compressed_font_data_base85, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
Definition imgui_draw.cpp:2179
IMGUI_API const ImWchar * GetGlyphRangesDefault()
Definition imgui_draw.cpp:2810
char Name[40]
Definition imgui.h:2515
ImVec2 GlyphOffset
Definition imgui.h:2505
bool PixelSnapH
Definition imgui.h:2503
int OversampleV
Definition imgui.h:2502
const ImWchar * GlyphRanges
Definition imgui.h:2506
int OversampleH
Definition imgui.h:2501
float y
Definition imgui.h:246

References AddFontFromMemoryCompressedBase85TTF(), ImFontConfig::EllipsisChar, GetDefaultCompressedFontDataTTFBase85(), GetGlyphRangesDefault(), ImFontConfig::GlyphOffset, ImFontConfig::GlyphRanges, IM_ARRAYSIZE, IM_FLOOR, ImFormatString(), ImFontConfig::Name, ImFontConfig::OversampleH, ImFontConfig::OversampleV, ImFontConfig::PixelSnapH, ImFontConfig::SizePixels, and ImVec2::y.

Referenced by GetTexDataAsAlpha8(), and Slic3r::GUI::ImGuiWrapper::init_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFontFromFileTTF()

ImFont * ImFontAtlas::AddFontFromFileTTF ( const char *  filename,
float  size_pixels,
const ImFontConfig font_cfg = NULL,
const ImWchar glyph_ranges = NULL 
)
2133{
2134 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
2135 size_t data_size = 0;
2136 void* data = ImFileLoadToMemory(filename, "rb", &data_size, 0);
2137 if (!data)
2138 {
2139 IM_ASSERT_USER_ERROR(0, "Could not load font file!");
2140 return NULL;
2141 }
2142 ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
2143 if (font_cfg.Name[0] == '\0')
2144 {
2145 // Store a short copy of filename into into the font name for convenience
2146 const char* p;
2147 for (p = filename + strlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
2148 ImFormatString(font_cfg.Name, IM_ARRAYSIZE(font_cfg.Name), "%s, %.0fpx", p, size_pixels);
2149 }
2150 return AddFontFromMemoryTTF(data, (int)data_size, size_pixels, &font_cfg, glyph_ranges);
2151}
void * ImFileLoadToMemory(const char *filename, const char *mode, size_t *out_file_size, int padding_bytes)
Definition imgui.cpp:1573
#define IM_ASSERT_USER_ERROR(_EXP, _MSG)
Definition imgui_internal.h:218
constexpr auto data(C &c) -> decltype(c.data())
Definition span.hpp:195
IMGUI_API ImFont * AddFontFromMemoryTTF(void *font_data, int font_size, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
Definition imgui_draw.cpp:2154

References AddFontFromMemoryTTF(), IM_ARRAYSIZE, IM_ASSERT, IM_ASSERT_USER_ERROR, ImFileLoadToMemory(), ImFormatString(), Locked, and ImFontConfig::Name.

Referenced by Slic3r::GUI::ImGuiWrapper::init_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFontFromMemoryCompressedBase85TTF()

ImFont * ImFontAtlas::AddFontFromMemoryCompressedBase85TTF ( const char *  compressed_font_data_base85,
float  size_pixels,
const ImFontConfig font_cfg = NULL,
const ImWchar glyph_ranges = NULL 
)
2180{
2181 int compressed_ttf_size = (((int)strlen(compressed_ttf_data_base85) + 4) / 5) * 4;
2182 void* compressed_ttf = IM_ALLOC((size_t)compressed_ttf_size);
2183 Decode85((const unsigned char*)compressed_ttf_data_base85, (unsigned char*)compressed_ttf);
2184 ImFont* font = AddFontFromMemoryCompressedTTF(compressed_ttf, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges);
2185 IM_FREE(compressed_ttf);
2186 return font;
2187}
#define IM_FREE(_PTR)
Definition imgui.h:1635
static void Decode85(const unsigned char *src, unsigned char *dst)
Definition imgui_draw.cpp:2099
IMGUI_API ImFont * AddFontFromMemoryCompressedTTF(const void *compressed_font_data, int compressed_font_size, float size_pixels, const ImFontConfig *font_cfg=NULL, const ImWchar *glyph_ranges=NULL)
Definition imgui_draw.cpp:2167

References AddFontFromMemoryCompressedTTF(), Decode85(), IM_ALLOC, and IM_FREE.

Referenced by AddFontDefault().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFontFromMemoryCompressedTTF()

ImFont * ImFontAtlas::AddFontFromMemoryCompressedTTF ( const void compressed_font_data,
int  compressed_font_size,
float  size_pixels,
const ImFontConfig font_cfg = NULL,
const ImWchar glyph_ranges = NULL 
)
2168{
2169 const unsigned int buf_decompressed_size = stb_decompress_length((const unsigned char*)compressed_ttf_data);
2170 unsigned char* buf_decompressed_data = (unsigned char*)IM_ALLOC(buf_decompressed_size);
2171 stb_decompress(buf_decompressed_data, (const unsigned char*)compressed_ttf_data, (unsigned int)compressed_ttf_size);
2172
2173 ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
2174 IM_ASSERT(font_cfg.FontData == NULL);
2175 font_cfg.FontDataOwnedByAtlas = true;
2176 return AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, size_pixels, &font_cfg, glyph_ranges);
2177}
static unsigned int stb_decompress(unsigned char *output, const unsigned char *input, unsigned int length)
Definition imgui_draw.cpp:4036
static unsigned int stb_decompress_length(const unsigned char *input)
Definition imgui_draw.cpp:3958

References AddFontFromMemoryTTF(), ImFontConfig::FontData, ImFontConfig::FontDataOwnedByAtlas, IM_ALLOC, IM_ASSERT, stb_decompress(), and stb_decompress_length().

Referenced by AddFontFromMemoryCompressedBase85TTF(), and igl::opengl::glfw::imgui::ImGuiMenu::reload_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFontFromMemoryTTF()

ImFont * ImFontAtlas::AddFontFromMemoryTTF ( void font_data,
int  font_size,
float  size_pixels,
const ImFontConfig font_cfg = NULL,
const ImWchar glyph_ranges = NULL 
)
2155{
2156 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
2157 ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
2158 IM_ASSERT(font_cfg.FontData == NULL);
2159 font_cfg.FontData = ttf_data;
2160 font_cfg.FontDataSize = ttf_size;
2161 font_cfg.SizePixels = size_pixels;
2162 if (glyph_ranges)
2163 font_cfg.GlyphRanges = glyph_ranges;
2164 return AddFont(&font_cfg);
2165}
IMGUI_API ImFont * AddFont(const ImFontConfig *font_cfg)
Definition imgui_draw.cpp:2063

References AddFont(), ImFontConfig::FontData, ImFontConfig::FontDataSize, ImFontConfig::GlyphRanges, IM_ASSERT, Locked, and ImFontConfig::SizePixels.

Referenced by AddFontFromFileTTF(), AddFontFromMemoryCompressedTTF(), and Slic3r::GUI::Emboss::StyleManager::create_imgui_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Build()

bool ImFontAtlas::Build ( )
2249{
2250 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
2251
2252 // Select builder
2253 // - Note that we do not reassign to atlas->FontBuilderIO, since it is likely to point to static data which
2254 // may mess with some hot-reloading schemes. If you need to assign to this (for dynamic selection) AND are
2255 // using a hot-reloading scheme that messes up static data, store your own instance of ImFontBuilderIO somewhere
2256 // and point to it instead of pointing directly to return value of the GetBuilderXXX functions.
2257 const ImFontBuilderIO* builder_io = FontBuilderIO;
2258 if (builder_io == NULL)
2259 {
2260#ifdef IMGUI_ENABLE_FREETYPE
2261 builder_io = ImGuiFreeType::GetBuilderForFreeType();
2262#elif defined(IMGUI_ENABLE_STB_TRUETYPE)
2264#else
2265 IM_ASSERT(0); // Invalid Build function
2266#endif
2267 }
2268
2269 // Build
2270 return builder_io->FontBuilder_Build(this);
2271}
const ImFontBuilderIO * ImFontAtlasGetBuilderForStbTruetype()
Definition imgui_draw.cpp:2581
const ImFontBuilderIO * FontBuilderIO
Definition imgui.h:2674
Definition imgui_internal.h:2638
bool(* FontBuilder_Build)(ImFontAtlas *atlas)
Definition imgui_internal.h:2639

References ImFontBuilderIO::FontBuilder_Build, FontBuilderIO, IM_ASSERT, ImFontAtlasGetBuilderForStbTruetype(), and Locked.

Referenced by GetTexDataAsAlpha8().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcCustomRectUV()

void ImFontAtlas::CalcCustomRectUV ( const ImFontAtlasCustomRect rect,
ImVec2 out_uv_min,
ImVec2 out_uv_max 
) const
2220{
2221 IM_ASSERT(TexWidth > 0 && TexHeight > 0); // Font atlas needs to be built before we can calculate UV coordinates
2222 IM_ASSERT(rect->IsPacked()); // Make sure the rectangle has been packed
2223 *out_uv_min = ImVec2((float)rect->X * TexUvScale.x, (float)rect->Y * TexUvScale.y);
2224 *out_uv_max = ImVec2((float)(rect->X + rect->Width) * TexUvScale.x, (float)(rect->Y + rect->Height) * TexUvScale.y);
2225}
unsigned short X
Definition imgui.h:2553
bool IsPacked() const
Definition imgui.h:2559
unsigned short Y
Definition imgui.h:2553
int TexWidth
Definition imgui.h:2664
int TexHeight
Definition imgui.h:2665
ImVec2 TexUvScale
Definition imgui.h:2666
Definition imgui.h:245
float x
Definition imgui.h:246

References ImFontAtlasCustomRect::Height, IM_ASSERT, ImFontAtlasCustomRect::IsPacked(), TexHeight, TexUvScale, TexWidth, ImFontAtlasCustomRect::Width, ImVec2::x, ImFontAtlasCustomRect::X, ImVec2::y, and ImFontAtlasCustomRect::Y.

Referenced by ImFontAtlasBuildFinish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear()

void ImFontAtlas::Clear ( )
2017{
2019 ClearTexData();
2020 ClearFonts();
2021}
IMGUI_API void ClearInputData()
Definition imgui_draw.cpp:1974
IMGUI_API void ClearFonts()
Definition imgui_draw.cpp:2008

References ClearFonts(), ClearInputData(), and ClearTexData().

Referenced by ~ImFontAtlas(), Slic3r::GUI::Emboss::StyleManager::clear_imgui_font(), Slic3r::GUI::ImGuiWrapper::init_font(), and igl::opengl::glfw::imgui::ImGuiMenu::reload_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearFonts()

void ImFontAtlas::ClearFonts ( )
2009{
2010 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
2011 for (int i = 0; i < Fonts.Size; i++)
2012 IM_DELETE(Fonts[i]);
2013 Fonts.clear();
2014}
void IM_DELETE(T *p)
Definition imgui.h:1638
void clear()
Definition imgui.h:1678

References ImVector< T >::clear(), Fonts, IM_ASSERT, IM_DELETE(), Locked, and ImVector< T >::Size.

Referenced by Clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearInputData()

void ImFontAtlas::ClearInputData ( )
1975{
1976 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
1977 for (int i = 0; i < ConfigData.Size; i++)
1978 if (ConfigData[i].FontData && ConfigData[i].FontDataOwnedByAtlas)
1979 {
1980 IM_FREE(ConfigData[i].FontData);
1981 ConfigData[i].FontData = NULL;
1982 }
1983
1984 // When clearing this we lose access to the font name and other information used to build the font.
1985 for (int i = 0; i < Fonts.Size; i++)
1986 if (Fonts[i]->ConfigData >= ConfigData.Data && Fonts[i]->ConfigData < ConfigData.Data + ConfigData.Size)
1987 {
1988 Fonts[i]->ConfigData = NULL;
1989 Fonts[i]->ConfigDataCount = 0;
1990 }
1991 ConfigData.clear();
1994}
T * Data
Definition imgui.h:1657

References ImVector< T >::clear(), ConfigData, CustomRects, ImVector< T >::Data, Fonts, IM_ASSERT, IM_FREE, Locked, PackIdLines, PackIdMouseCursors, and ImVector< T >::Size.

Referenced by Clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearTexData()

void ImFontAtlas::ClearTexData ( )
1997{
1998 IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
1999 if (TexPixelsAlpha8)
2001 if (TexPixelsRGBA32)
2003 TexPixelsAlpha8 = NULL;
2004 TexPixelsRGBA32 = NULL;
2005 TexPixelsUseColors = false;
2006}
unsigned int * TexPixelsRGBA32
Definition imgui.h:2663
unsigned char * TexPixelsAlpha8
Definition imgui.h:2662
bool TexPixelsUseColors
Definition imgui.h:2661

References IM_ASSERT, IM_FREE, Locked, TexPixelsAlpha8, TexPixelsRGBA32, and TexPixelsUseColors.

Referenced by AddFont(), Clear(), and ImFontAtlasBuildWithStbTruetype().

+ Here is the caller graph for this function:

◆ GetCustomRectByIndex()

ImFontAtlasCustomRect * ImFontAtlas::GetCustomRectByIndex ( int  index)
inline
2643{ IM_ASSERT(index >= 0); return &CustomRects[index]; }

References IM_ASSERT.

Referenced by GetMouseCursorTexData(), Slic3r::GUI::ImGuiWrapper::GetTextureCustomRect(), ImFontAtlasBuildRenderDefaultTexData(), ImFontAtlasBuildRenderLinesTexData(), and Slic3r::GUI::ImGuiWrapper::init_font().

+ Here is the caller graph for this function:

◆ GetGlyphRangesChineseFull()

const ImWchar * ImFontAtlas::GetGlyphRangesChineseFull ( )
2833{
2834 static const ImWchar ranges[] =
2835 {
2836 0x0020, 0x00FF, // Basic Latin + Latin Supplement
2837 0x2000, 0x206F, // General Punctuation
2838 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
2839 0x31F0, 0x31FF, // Katakana Phonetic Extensions
2840 0xFF00, 0xFFEF, // Half-width characters
2841 0x4e00, 0x9FAF, // CJK Ideograms
2842 0,
2843 };
2844 return &ranges[0];
2845}

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the caller graph for this function:

◆ GetGlyphRangesChineseSimplifiedCommon()

const ImWchar * ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon ( )
2862{
2863 // Store 2500 regularly used characters for Simplified Chinese.
2864 // Sourced from https://zh.wiktionary.org/wiki/%E9%99%84%E5%BD%95:%E7%8E%B0%E4%BB%A3%E6%B1%89%E8%AF%AD%E5%B8%B8%E7%94%A8%E5%AD%97%E8%A1%A8
2865 // This table covers 97.97% of all characters used during the month in July, 1987.
2866 // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
2867 // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.)
2868 static const short accumulative_offsets_from_0x4E00[] =
2869 {
2870 0,1,2,4,1,1,1,1,2,1,3,2,1,2,2,1,1,1,1,1,5,2,1,2,3,3,3,2,2,4,1,1,1,2,1,5,2,3,1,2,1,2,1,1,2,1,1,2,2,1,4,1,1,1,1,5,10,1,2,19,2,1,2,1,2,1,2,1,2,
2871 1,5,1,6,3,2,1,2,2,1,1,1,4,8,5,1,1,4,1,1,3,1,2,1,5,1,2,1,1,1,10,1,1,5,2,4,6,1,4,2,2,2,12,2,1,1,6,1,1,1,4,1,1,4,6,5,1,4,2,2,4,10,7,1,1,4,2,4,
2872 2,1,4,3,6,10,12,5,7,2,14,2,9,1,1,6,7,10,4,7,13,1,5,4,8,4,1,1,2,28,5,6,1,1,5,2,5,20,2,2,9,8,11,2,9,17,1,8,6,8,27,4,6,9,20,11,27,6,68,2,2,1,1,
2873 1,2,1,2,2,7,6,11,3,3,1,1,3,1,2,1,1,1,1,1,3,1,1,8,3,4,1,5,7,2,1,4,4,8,4,2,1,2,1,1,4,5,6,3,6,2,12,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20,7,16,8,5,72,34,6,4,22,12,12,28,45,36,9,7,39,9,191,1,1,1,4,11,8,4,9,2,3,22,1,1,1,1,4,17,1,7,7,1,11,31,10,2,4,8,2,3,2,1,4,2,16,4,32,2,
2890 3,19,13,4,9,1,5,2,14,8,1,1,3,6,19,6,5,1,16,6,2,10,8,5,1,2,3,1,5,5,1,11,6,6,1,3,3,2,6,3,8,1,1,4,10,7,5,7,7,5,8,9,2,1,3,4,1,1,3,1,3,3,2,6,16,
2891 1,4,6,3,1,10,6,1,3,15,2,9,2,10,25,13,9,16,6,2,2,10,11,4,3,9,1,2,6,6,5,4,30,40,1,10,7,12,14,33,6,3,6,7,3,1,3,1,11,14,4,9,5,12,11,49,18,51,31,
2892 140,31,2,2,1,5,1,8,1,10,1,4,4,3,24,1,10,1,3,6,6,16,3,4,5,2,1,4,2,57,10,6,22,2,22,3,7,22,6,10,11,36,18,16,33,36,2,5,5,1,1,1,4,10,1,4,13,2,7,
2893 5,2,9,3,4,1,7,43,3,7,3,9,14,7,9,1,11,1,1,3,7,4,18,13,1,14,1,3,6,10,73,2,2,30,6,1,11,18,19,13,22,3,46,42,37,89,7,3,16,34,2,2,3,9,1,7,1,1,1,2,
2894 2,4,10,7,3,10,3,9,5,28,9,2,6,13,7,3,1,3,10,2,7,2,11,3,6,21,54,85,2,1,4,2,2,1,39,3,21,2,2,5,1,1,1,4,1,1,3,4,15,1,3,2,4,4,2,3,8,2,20,1,8,7,13,
2895 4,1,26,6,2,9,34,4,21,52,10,4,4,1,5,12,2,11,1,7,2,30,12,44,2,30,1,1,3,6,16,9,17,39,82,2,2,24,7,1,7,3,16,9,14,44,2,1,2,1,2,3,5,2,4,1,6,7,5,3,
2896 2,6,1,11,5,11,2,1,18,19,8,1,3,24,29,2,1,3,5,2,2,1,13,6,5,1,46,11,3,5,1,1,5,8,2,10,6,12,6,3,7,11,2,4,16,13,2,5,1,1,2,2,5,2,28,5,2,23,10,8,4,
2897 4,22,39,95,38,8,14,9,5,1,13,5,4,3,13,12,11,1,9,1,27,37,2,5,4,4,63,211,95,2,2,2,1,3,5,2,1,1,2,2,1,1,1,3,2,4,1,2,1,1,5,2,2,1,1,2,3,1,3,1,1,1,
2898 3,1,4,2,1,3,6,1,1,3,7,15,5,3,2,5,3,9,11,4,2,22,1,6,3,8,7,1,4,28,4,16,3,3,25,4,4,27,27,1,4,1,2,2,7,1,3,5,2,28,8,2,14,1,8,6,16,25,3,3,3,14,3,
2899 3,1,1,2,1,4,6,3,8,4,1,1,1,2,3,6,10,6,2,3,18,3,2,5,5,4,3,1,5,2,5,4,23,7,6,12,6,4,17,11,9,5,1,1,10,5,12,1,1,11,26,33,7,3,6,1,17,7,1,5,12,1,11,
2900 2,4,1,8,14,17,23,1,2,1,7,8,16,11,9,6,5,2,6,4,16,2,8,14,1,11,8,9,1,1,1,9,25,4,11,19,7,2,15,2,12,8,52,7,5,19,2,16,4,36,8,1,16,8,24,26,4,6,2,9,
2901 5,4,36,3,28,12,25,15,37,27,17,12,59,38,5,32,127,1,2,9,17,14,4,1,2,1,1,8,11,50,4,14,2,19,16,4,17,5,4,5,26,12,45,2,23,45,104,30,12,8,3,10,2,2,
2902 3,3,1,4,20,7,2,9,6,15,2,20,1,3,16,4,11,15,6,134,2,5,59,1,2,2,2,1,9,17,3,26,137,10,211,59,1,2,4,1,4,1,1,1,2,6,2,3,1,1,2,3,2,3,1,3,4,4,2,3,3,
2903 1,4,3,1,7,2,2,3,1,2,1,3,3,3,2,2,3,2,1,3,14,6,1,3,2,9,6,15,27,9,34,145,1,1,2,1,1,1,1,2,1,1,1,1,2,2,2,3,1,2,1,1,1,2,3,5,8,3,5,2,4,1,3,2,2,2,12,
2904 4,1,1,1,10,4,5,1,20,4,16,1,15,9,5,12,2,9,2,5,4,2,26,19,7,1,26,4,30,12,15,42,1,6,8,172,1,1,4,2,1,1,11,2,2,4,2,1,2,1,10,8,1,2,1,4,5,1,2,5,1,8,
2905 4,1,3,4,2,1,6,2,1,3,4,1,2,1,1,1,1,12,5,7,2,4,3,1,1,1,3,3,6,1,2,2,3,3,3,2,1,2,12,14,11,6,6,4,12,2,8,1,7,10,1,35,7,4,13,15,4,3,23,21,28,52,5,
2906 26,5,6,1,7,10,2,7,53,3,2,1,1,1,2,163,532,1,10,11,1,3,3,4,8,2,8,6,2,2,23,22,4,2,2,4,2,1,3,1,3,3,5,9,8,2,1,2,8,1,10,2,12,21,20,15,105,2,3,1,1,
2907 3,2,3,1,1,2,5,1,4,15,11,19,1,1,1,1,5,4,5,1,1,2,5,3,5,12,1,2,5,1,11,1,1,15,9,1,4,5,3,26,8,2,1,3,1,1,15,19,2,12,1,2,5,2,7,2,19,2,20,6,26,7,5,
2908 2,2,7,34,21,13,70,2,128,1,1,2,1,1,2,1,1,3,2,2,2,15,1,4,1,3,4,42,10,6,1,49,85,8,1,2,1,1,4,4,2,3,6,1,5,7,4,3,211,4,1,2,1,2,5,1,2,4,2,2,6,5,6,
2909 10,3,4,48,100,6,2,16,296,5,27,387,2,2,3,7,16,8,5,38,15,39,21,9,10,3,7,59,13,27,21,47,5,21,6
2910 };
2911 static ImWchar base_ranges[] = // not zero-terminated
2912 {
2913 0x0020, 0x00FF, // Basic Latin + Latin Supplement
2914 0x2000, 0x206F, // General Punctuation
2915 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
2916 0x31F0, 0x31FF, // Katakana Phonetic Extensions
2917 0xFF00, 0xFFEF // Half-width characters
2918 };
2919 static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00) * 2 + 1] = { 0 };
2920 if (!full_ranges[0])
2921 {
2922 memcpy(full_ranges, base_ranges, sizeof(base_ranges));
2923 UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges));
2924 }
2925 return &full_ranges[0];
2926}
static void UnpackAccumulativeOffsetsIntoRanges(int base_codepoint, const short *accumulative_offsets, int accumulative_offsets_count, ImWchar *out_ranges)
Definition imgui_draw.cpp:2847

References IM_ARRAYSIZE, and UnpackAccumulativeOffsetsIntoRanges().

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGlyphRangesCyrillic()

const ImWchar * ImFontAtlas::GetGlyphRangesCyrillic ( )
3018{
3019 static const ImWchar ranges[] =
3020 {
3021 0x0020, 0x00FF, // Basic Latin + Latin Supplement
3022 0x0400, 0x052F, // Cyrillic + Cyrillic Supplement
3023 0x2DE0, 0x2DFF, // Cyrillic Extended-A
3024 0xA640, 0xA69F, // Cyrillic Extended-B
3025 0,
3026 };
3027 return &ranges[0];
3028}

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the caller graph for this function:

◆ GetGlyphRangesDefault()

const ImWchar * ImFontAtlas::GetGlyphRangesDefault ( )
2811{
2812 static const ImWchar ranges[] =
2813 {
2814 0x0020, 0x00FF, // Basic Latin + Latin Supplement
2815 0,
2816 };
2817 return &ranges[0];
2818}

Referenced by AddFontDefault(), ImFontAtlasBuildWithStbTruetype(), and Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the caller graph for this function:

◆ GetGlyphRangesJapanese()

const ImWchar * ImFontAtlas::GetGlyphRangesJapanese ( )
2929{
2930 // 2999 ideograms code points for Japanese
2931 // - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points
2932 // - 863 Jinmeiyo (meaning "for personal name") Kanji code points
2933 // - Sourced from the character information database of the Information-technology Promotion Agency, Japan
2934 // - https://mojikiban.ipa.go.jp/mji/
2935 // - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP).
2936 // - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en
2937 // - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode
2938 // - You can generate this code by the script at:
2939 // - https://github.com/vaiorabbit/everyday_use_kanji
2940 // - References:
2941 // - List of Joyo Kanji
2942 // - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html
2943 // - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji
2944 // - List of Jinmeiyo Kanji
2945 // - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html
2946 // - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji
2947 // - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details.
2948 // You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
2949 // (Stored as accumulative offsets from the initial unicode codepoint 0x4E00. This encoding is designed to helps us compact the source code size.)
2950 static const short accumulative_offsets_from_0x4E00[] =
2951 {
2952 0,1,2,4,1,1,1,1,2,1,3,3,2,2,1,5,3,5,7,5,6,1,2,1,7,2,6,3,1,8,1,1,4,1,1,18,2,11,2,6,2,1,2,1,5,1,2,1,3,1,2,1,2,3,3,1,1,2,3,1,1,1,12,7,9,1,4,5,1,
2953 1,2,1,10,1,1,9,2,2,4,5,6,9,3,1,1,1,1,9,3,18,5,2,2,2,2,1,6,3,7,1,1,1,1,2,2,4,2,1,23,2,10,4,3,5,2,4,10,2,4,13,1,6,1,9,3,1,1,6,6,7,6,3,1,2,11,3,
2954 2,2,3,2,15,2,2,5,4,3,6,4,1,2,5,2,12,16,6,13,9,13,2,1,1,7,16,4,7,1,19,1,5,1,2,2,7,7,8,2,6,5,4,9,18,7,4,5,9,13,11,8,15,2,1,1,1,2,1,2,2,1,2,2,8,
2955 2,9,3,3,1,1,4,4,1,1,1,4,9,1,4,3,5,5,2,7,5,3,4,8,2,1,13,2,3,3,1,14,1,1,4,5,1,3,6,1,5,2,1,1,3,3,3,3,1,1,2,7,6,6,7,1,4,7,6,1,1,1,1,1,12,3,3,9,5,
2956 2,6,1,5,6,1,2,3,18,2,4,14,4,1,3,6,1,1,6,3,5,5,3,2,2,2,2,12,3,1,4,2,3,2,3,11,1,7,4,1,2,1,3,17,1,9,1,24,1,1,4,2,2,4,1,2,7,1,1,1,3,1,2,2,4,15,1,
2957 1,2,1,1,2,1,5,2,5,20,2,5,9,1,10,8,7,6,1,1,1,1,1,1,6,2,1,2,8,1,1,1,1,5,1,1,3,1,1,1,1,3,1,1,12,4,1,3,1,1,1,1,1,10,3,1,7,5,13,1,2,3,4,6,1,1,30,
2958 2,9,9,1,15,38,11,3,1,8,24,7,1,9,8,10,2,1,9,31,2,13,6,2,9,4,49,5,2,15,2,1,10,2,1,1,1,2,2,6,15,30,35,3,14,18,8,1,16,10,28,12,19,45,38,1,3,2,3,
2959 13,2,1,7,3,6,5,3,4,3,1,5,7,8,1,5,3,18,5,3,6,1,21,4,24,9,24,40,3,14,3,21,3,2,1,2,4,2,3,1,15,15,6,5,1,1,3,1,5,6,1,9,7,3,3,2,1,4,3,8,21,5,16,4,
2960 5,2,10,11,11,3,6,3,2,9,3,6,13,1,2,1,1,1,1,11,12,6,6,1,4,2,6,5,2,1,1,3,3,6,13,3,1,1,5,1,2,3,3,14,2,1,2,2,2,5,1,9,5,1,1,6,12,3,12,3,4,13,2,14,
2961 2,8,1,17,5,1,16,4,2,2,21,8,9,6,23,20,12,25,19,9,38,8,3,21,40,25,33,13,4,3,1,4,1,2,4,1,2,5,26,2,1,1,2,1,3,6,2,1,1,1,1,1,1,2,3,1,1,1,9,2,3,1,1,
2962 1,3,6,3,2,1,1,6,6,1,8,2,2,2,1,4,1,2,3,2,7,3,2,4,1,2,1,2,2,1,1,1,1,1,3,1,2,5,4,10,9,4,9,1,1,1,1,1,1,5,3,2,1,6,4,9,6,1,10,2,31,17,8,3,7,5,40,1,
2963 7,7,1,6,5,2,10,7,8,4,15,39,25,6,28,47,18,10,7,1,3,1,1,2,1,1,1,3,3,3,1,1,1,3,4,2,1,4,1,3,6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,8,9,5,2,3,2,1,3,2,13,7,14,6,5,1,1,2,1,4,2,23,2,1,1,6,3,1,4,1,15,3,1,7,3,9,14,1,3,1,4,1,1,5,8,1,3,8,3,8,15,11,4,14,4,4,2,5,5,
2972 1,7,1,6,14,7,7,8,5,15,4,8,6,5,6,2,1,13,1,20,15,11,9,2,5,6,2,11,2,6,2,5,1,5,8,4,13,19,25,4,1,1,11,1,34,2,5,9,14,6,2,2,6,1,1,14,1,3,14,13,1,6,
2973 12,21,14,14,6,32,17,8,32,9,28,1,2,4,11,8,3,1,14,2,5,15,1,1,1,1,3,6,4,1,3,4,11,3,1,1,11,30,1,5,1,4,1,5,8,1,1,3,2,4,3,17,35,2,6,12,17,3,1,6,2,
2974 1,1,12,2,7,3,3,2,1,16,2,8,3,6,5,4,7,3,3,8,1,9,8,5,1,2,1,3,2,8,1,2,9,12,1,1,2,3,8,3,24,12,4,3,7,5,8,3,3,3,3,3,3,1,23,10,3,1,2,2,6,3,1,16,1,16,
2975 22,3,10,4,11,6,9,7,7,3,6,2,2,2,4,10,2,1,1,2,8,7,1,6,4,1,3,3,3,5,10,12,12,2,3,12,8,15,1,1,16,6,6,1,5,9,11,4,11,4,2,6,12,1,17,5,13,1,4,9,5,1,11,
2976 2,1,8,1,5,7,28,8,3,5,10,2,17,3,38,22,1,2,18,12,10,4,38,18,1,4,44,19,4,1,8,4,1,12,1,4,31,12,1,14,7,75,7,5,10,6,6,13,3,2,11,11,3,2,5,28,15,6,18,
2977 18,5,6,4,3,16,1,7,18,7,36,3,5,3,1,7,1,9,1,10,7,2,4,2,6,2,9,7,4,3,32,12,3,7,10,2,23,16,3,1,12,3,31,4,11,1,3,8,9,5,1,30,15,6,12,3,2,2,11,19,9,
2978 14,2,6,2,3,19,13,17,5,3,3,25,3,14,1,1,1,36,1,3,2,19,3,13,36,9,13,31,6,4,16,34,2,5,4,2,3,3,5,1,1,1,4,3,1,17,3,2,3,5,3,1,3,2,3,5,6,3,12,11,1,3,
2979 1,2,26,7,12,7,2,14,3,3,7,7,11,25,25,28,16,4,36,1,2,1,6,2,1,9,3,27,17,4,3,4,13,4,1,3,2,2,1,10,4,2,4,6,3,8,2,1,18,1,1,24,2,2,4,33,2,3,63,7,1,6,
2980 40,7,3,4,4,2,4,15,18,1,16,1,1,11,2,41,14,1,3,18,13,3,2,4,16,2,17,7,15,24,7,18,13,44,2,2,3,6,1,1,7,5,1,7,1,4,3,3,5,10,8,2,3,1,8,1,1,27,4,2,1,
2981 12,1,2,1,10,6,1,6,7,5,2,3,7,11,5,11,3,6,6,2,3,15,4,9,1,1,2,1,2,11,2,8,12,8,5,4,2,3,1,5,2,2,1,14,1,12,11,4,1,11,17,17,4,3,2,5,5,7,3,1,5,9,9,8,
2982 2,5,6,6,13,13,2,1,2,6,1,2,2,49,4,9,1,2,10,16,7,8,4,3,2,23,4,58,3,29,1,14,19,19,11,11,2,7,5,1,3,4,6,2,18,5,12,12,17,17,3,3,2,4,1,6,2,3,4,3,1,
2983 1,1,1,5,1,1,9,1,3,1,3,6,1,8,1,1,2,6,4,14,3,1,4,11,4,1,3,32,1,2,4,13,4,1,2,4,2,1,3,1,11,1,4,2,1,4,4,6,3,5,1,6,5,7,6,3,23,3,5,3,5,3,3,13,3,9,10,
2984 1,12,10,2,3,18,13,7,160,52,4,2,2,3,2,14,5,4,12,4,6,4,1,20,4,11,6,2,12,27,1,4,1,2,2,7,4,5,2,28,3,7,25,8,3,19,3,6,10,2,2,1,10,2,5,4,1,3,4,1,5,
2985 3,2,6,9,3,6,2,16,3,3,16,4,5,5,3,2,1,2,16,15,8,2,6,21,2,4,1,22,5,8,1,1,21,11,2,1,11,11,19,13,12,4,2,3,2,3,6,1,8,11,1,4,2,9,5,2,1,11,2,9,1,1,2,
2986 14,31,9,3,4,21,14,4,8,1,7,2,2,2,5,1,4,20,3,3,4,10,1,11,9,8,2,1,4,5,14,12,14,2,17,9,6,31,4,14,1,20,13,26,5,2,7,3,6,13,2,4,2,19,6,2,2,18,9,3,5,
2987 12,12,14,4,6,2,3,6,9,5,22,4,5,25,6,4,8,5,2,6,27,2,35,2,16,3,7,8,8,6,6,5,9,17,2,20,6,19,2,13,3,1,1,1,4,17,12,2,14,7,1,4,18,12,38,33,2,10,1,1,
2988 2,13,14,17,11,50,6,33,20,26,74,16,23,45,50,13,38,33,6,6,7,4,4,2,1,3,2,5,8,7,8,9,3,11,21,9,13,1,3,10,6,7,1,2,2,18,5,5,1,9,9,2,68,9,19,13,2,5,
2989 1,4,4,7,4,13,3,9,10,21,17,3,26,2,1,5,2,4,5,4,1,7,4,7,3,4,2,1,6,1,1,20,4,1,9,2,2,1,3,3,2,3,2,1,1,1,20,2,3,1,6,2,3,6,2,4,8,1,3,2,10,3,5,3,4,4,
2990 3,4,16,1,6,1,10,2,4,2,1,1,2,10,11,2,2,3,1,24,31,4,10,10,2,5,12,16,164,15,4,16,7,9,15,19,17,1,2,1,1,5,1,1,1,1,1,3,1,4,3,1,3,1,3,1,2,1,1,3,3,7,
2991 2,8,1,2,2,2,1,3,4,3,7,8,12,92,2,10,3,1,3,14,5,25,16,42,4,7,7,4,2,21,5,27,26,27,21,25,30,31,2,1,5,13,3,22,5,6,6,11,9,12,1,5,9,7,5,5,22,60,3,5,
2992 13,1,1,8,1,1,3,3,2,1,9,3,3,18,4,1,2,3,7,6,3,1,2,3,9,1,3,1,3,2,1,3,1,1,1,2,1,11,3,1,6,9,1,3,2,3,1,2,1,5,1,1,4,3,4,1,2,2,4,4,1,7,2,1,2,2,3,5,13,
2993 18,3,4,14,9,9,4,16,3,7,5,8,2,6,48,28,3,1,1,4,2,14,8,2,9,2,1,15,2,4,3,2,10,16,12,8,7,1,1,3,1,1,1,2,7,4,1,6,4,38,39,16,23,7,15,15,3,2,12,7,21,
2994 37,27,6,5,4,8,2,10,8,8,6,5,1,2,1,3,24,1,16,17,9,23,10,17,6,1,51,55,44,13,294,9,3,6,2,4,2,2,15,1,1,1,13,21,17,68,14,8,9,4,1,4,9,3,11,7,1,1,1,
2995 5,6,3,2,1,1,1,2,3,8,1,2,2,4,1,5,5,2,1,4,3,7,13,4,1,4,1,3,1,1,1,5,5,10,1,6,1,5,2,1,5,2,4,1,4,5,7,3,18,2,9,11,32,4,3,3,2,4,7,11,16,9,11,8,13,38,
2996 32,8,4,2,1,1,2,1,2,4,4,1,1,1,4,1,21,3,11,1,16,1,1,6,1,3,2,4,9,8,57,7,44,1,3,3,13,3,10,1,1,7,5,2,7,21,47,63,3,15,4,7,1,16,1,1,2,8,2,3,42,15,4,
2997 1,29,7,22,10,3,78,16,12,20,18,4,67,11,5,1,3,15,6,21,31,32,27,18,13,71,35,5,142,4,10,1,2,50,19,33,16,35,37,16,19,27,7,1,133,19,1,4,8,7,20,1,4,
2998 4,1,10,3,1,6,1,2,51,5,40,15,24,43,22928,11,1,13,154,70,3,1,1,7,4,10,1,2,1,1,2,1,2,1,2,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,
2999 3,2,1,1,1,1,2,1,1,
3000 };
3001 static ImWchar base_ranges[] = // not zero-terminated
3002 {
3003 0x0020, 0x00FF, // Basic Latin + Latin Supplement
3004 0x3000, 0x30FF, // CJK Symbols and Punctuations, Hiragana, Katakana
3005 0x31F0, 0x31FF, // Katakana Phonetic Extensions
3006 0xFF00, 0xFFEF // Half-width characters
3007 };
3008 static ImWchar full_ranges[IM_ARRAYSIZE(base_ranges) + IM_ARRAYSIZE(accumulative_offsets_from_0x4E00)*2 + 1] = { 0 };
3009 if (!full_ranges[0])
3010 {
3011 memcpy(full_ranges, base_ranges, sizeof(base_ranges));
3012 UnpackAccumulativeOffsetsIntoRanges(0x4E00, accumulative_offsets_from_0x4E00, IM_ARRAYSIZE(accumulative_offsets_from_0x4E00), full_ranges + IM_ARRAYSIZE(base_ranges));
3013 }
3014 return &full_ranges[0];
3015}

References IM_ARRAYSIZE, and UnpackAccumulativeOffsetsIntoRanges().

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGlyphRangesKorean()

const ImWchar * ImFontAtlas::GetGlyphRangesKorean ( )
2821{
2822 static const ImWchar ranges[] =
2823 {
2824 0x0020, 0x00FF, // Basic Latin + Latin Supplement
2825 0x3131, 0x3163, // Korean alphabets
2826 0xAC00, 0xD7A3, // Korean characters
2827 0,
2828 };
2829 return &ranges[0];
2830}

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the caller graph for this function:

◆ GetGlyphRangesThai()

const ImWchar * ImFontAtlas::GetGlyphRangesThai ( )
3031{
3032 static const ImWchar ranges[] =
3033 {
3034 0x0020, 0x00FF, // Basic Latin
3035 0x2010, 0x205E, // Punctuations
3036 0x0E00, 0x0E7F, // Thai
3037 0,
3038 };
3039 return &ranges[0];
3040}

Referenced by Slic3r::GUI::ImGuiWrapper::set_language().

+ Here is the caller graph for this function:

◆ GetGlyphRangesVietnamese()

const ImWchar * ImFontAtlas::GetGlyphRangesVietnamese ( )
3043{
3044 static const ImWchar ranges[] =
3045 {
3046 0x0020, 0x00FF, // Basic Latin
3047 0x0102, 0x0103,
3048 0x0110, 0x0111,
3049 0x0128, 0x0129,
3050 0x0168, 0x0169,
3051 0x01A0, 0x01A1,
3052 0x01AF, 0x01B0,
3053 0x1EA0, 0x1EF9,
3054 0,
3055 };
3056 return &ranges[0];
3057}

◆ GetMouseCursorTexData()

bool ImFontAtlas::GetMouseCursorTexData ( ImGuiMouseCursor  cursor,
ImVec2 out_offset,
ImVec2 out_size,
ImVec2  out_uv_border[2],
ImVec2  out_uv_fill[2] 
)
2228{
2229 if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT)
2230 return false;
2232 return false;
2233
2236 ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r->X, (float)r->Y);
2238 *out_size = size;
2239 *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2];
2240 out_uv_border[0] = (pos) * TexUvScale;
2241 out_uv_border[1] = (pos + size) * TexUvScale;
2243 out_uv_fill[0] = (pos) * TexUvScale;
2244 out_uv_fill[1] = (pos + size) * TexUvScale;
2245 return true;
2246}
@ ImGuiMouseCursor_COUNT
Definition imgui.h:1606
@ ImFontAtlasFlags_NoMouseCursors
Definition imgui.h:2567
static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3]
Definition imgui_draw.cpp:1948
const int FONT_ATLAS_DEFAULT_TEX_DATA_W
Definition imgui_draw.cpp:1915
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:14
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
ImFontAtlasCustomRect * GetCustomRectByIndex(int index)
Definition imgui.h:2643
ImFontAtlasFlags Flags
Definition imgui.h:2653

References Flags, FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA, FONT_ATLAS_DEFAULT_TEX_DATA_W, GetCustomRectByIndex(), IM_ASSERT, ImFontAtlasFlags_NoMouseCursors, ImGuiMouseCursor_COUNT, PackIdMouseCursors, TexUvScale, ImFontAtlasCustomRect::X, and ImFontAtlasCustomRect::Y.

Referenced by ImGui::RenderMouseCursor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTexDataAsAlpha8()

void ImFontAtlas::GetTexDataAsAlpha8 ( unsigned char **  out_pixels,
int *  out_width,
int *  out_height,
int *  out_bytes_per_pixel = NULL 
)
2024{
2025 // Build atlas on demand
2026 if (TexPixelsAlpha8 == NULL)
2027 {
2028 if (ConfigData.empty())
2030 Build();
2031 }
2032
2033 *out_pixels = TexPixelsAlpha8;
2034 if (out_width) *out_width = TexWidth;
2035 if (out_height) *out_height = TexHeight;
2036 if (out_bytes_per_pixel) *out_bytes_per_pixel = 1;
2037}
IMGUI_API bool Build()
Definition imgui_draw.cpp:2248
IMGUI_API ImFont * AddFontDefault(const ImFontConfig *font_cfg=NULL)
Definition imgui_draw.cpp:2111

References AddFontDefault(), Build(), ConfigData, ImVector< T >::empty(), TexHeight, TexPixelsAlpha8, and TexWidth.

Referenced by GetTexDataAsRGBA32().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTexDataAsRGBA32()

void ImFontAtlas::GetTexDataAsRGBA32 ( unsigned char **  out_pixels,
int *  out_width,
int *  out_height,
int *  out_bytes_per_pixel = NULL 
)
2040{
2041 // Convert to RGBA32 format on demand
2042 // Although it is likely to be the most commonly used format, our font rendering is 1 channel / 8 bpp
2043 if (!TexPixelsRGBA32)
2044 {
2045 unsigned char* pixels = NULL;
2046 GetTexDataAsAlpha8(&pixels, NULL, NULL);
2047 if (pixels)
2048 {
2049 TexPixelsRGBA32 = (unsigned int*)IM_ALLOC((size_t)TexWidth * (size_t)TexHeight * 4);
2050 const unsigned char* src = pixels;
2051 unsigned int* dst = TexPixelsRGBA32;
2052 for (int n = TexWidth * TexHeight; n > 0; n--)
2053 *dst++ = IM_COL32(255, 255, 255, (unsigned int)(*src++));
2054 }
2055 }
2056
2057 *out_pixels = (unsigned char*)TexPixelsRGBA32;
2058 if (out_width) *out_width = TexWidth;
2059 if (out_height) *out_height = TexHeight;
2060 if (out_bytes_per_pixel) *out_bytes_per_pixel = 4;
2061}
#define IM_COL32(R, G, B, A)
Definition imgui.h:2177
IMGUI_API void GetTexDataAsAlpha8(unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel=NULL)
Definition imgui_draw.cpp:2023

References GetTexDataAsAlpha8(), IM_ALLOC, IM_COL32, TexHeight, TexPixelsRGBA32, and TexWidth.

Referenced by Slic3r::GUI::Emboss::StyleManager::create_imgui_font(), and Slic3r::GUI::ImGuiWrapper::init_font().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsBuilt()

bool ImFontAtlas::IsBuilt ( ) const
inline
2611{ return Fonts.Size > 0 && (TexPixelsAlpha8 != NULL || TexPixelsRGBA32 != NULL); }

◆ SetTexID()

void ImFontAtlas::SetTexID ( ImTextureID  id)
inline
2612{ TexID = id; }
ImTextureID TexID
Definition imgui.h:2654

Member Data Documentation

◆ ConfigData

◆ CustomRects

◆ Flags

◆ FontBuilderFlags

unsigned int ImFontAtlas::FontBuilderFlags

◆ FontBuilderIO

const ImFontBuilderIO* ImFontAtlas::FontBuilderIO

Referenced by Build().

◆ Fonts

◆ Locked

◆ PackIdLines

◆ PackIdMouseCursors

◆ TexDesiredWidth

int ImFontAtlas::TexDesiredWidth

◆ TexGlyphPadding

int ImFontAtlas::TexGlyphPadding

◆ TexHeight

◆ TexID

◆ TexPixelsAlpha8

◆ TexPixelsRGBA32

◆ TexPixelsUseColors

bool ImFontAtlas::TexPixelsUseColors

Referenced by ClearTexData().

◆ TexUvLines

◆ TexUvScale

◆ TexUvWhitePixel

◆ TexWidth


The documentation for this struct was generated from the following files: