Skip to content

Commit d2ac0a5

Browse files
authored
Merge pull request #1438 from MadLadSquad/auto
Update
2 parents eae4120 + 60f4186 commit d2ac0a5

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

Framework/ThirdParty/freetype

Framework/ThirdParty/source-libraries/cimgui/cimgui.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -3554,14 +3554,14 @@ CIMGUI_API void cimgui::ImFontAtlas_ClearInputData(cimgui::ImF
35543554
reinterpret_cast<::ImFontAtlas*>(self)->ClearInputData();
35553555
}
35563556

3557-
CIMGUI_API void cimgui::ImFontAtlas_ClearTexData(cimgui::ImFontAtlas* self)
3557+
CIMGUI_API void cimgui::ImFontAtlas_ClearFonts(cimgui::ImFontAtlas* self)
35583558
{
3559-
reinterpret_cast<::ImFontAtlas*>(self)->ClearTexData();
3559+
reinterpret_cast<::ImFontAtlas*>(self)->ClearFonts();
35603560
}
35613561

3562-
CIMGUI_API void cimgui::ImFontAtlas_ClearFonts(cimgui::ImFontAtlas* self)
3562+
CIMGUI_API void cimgui::ImFontAtlas_ClearTexData(cimgui::ImFontAtlas* self)
35633563
{
3564-
reinterpret_cast<::ImFontAtlas*>(self)->ClearFonts();
3564+
reinterpret_cast<::ImFontAtlas*>(self)->ClearTexData();
35653565
}
35663566

35673567
CIMGUI_API void cimgui::ImFontAtlas_Clear(cimgui::ImFontAtlas* self)

Framework/ThirdParty/source-libraries/cimgui/cimgui.h

+19-17
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ typedef struct ImVector_ImFontPtr_t ImVector_ImFontPtr;
175175
typedef struct ImVector_ImFontAtlasCustomRect_t ImVector_ImFontAtlasCustomRect;
176176
typedef struct ImVector_ImFontConfig_t ImVector_ImFontConfig;
177177
typedef struct ImVector_float_t ImVector_float;
178+
typedef struct ImVector_ImU16_t ImVector_ImU16;
178179
typedef struct ImVector_ImFontGlyph_t ImVector_ImFontGlyph;
179180
typedef struct ImVector_ImGuiPlatformMonitor_t ImVector_ImGuiPlatformMonitor;
180181
typedef struct ImVector_ImGuiViewportPtr_t ImVector_ImGuiViewportPtr;
@@ -2327,6 +2328,7 @@ struct ImVector_ImFontPtr_t { int Size; int Capacity; ImFont** Data; }; // Inst
23272328
struct ImVector_ImFontAtlasCustomRect_t { int Size; int Capacity; ImFontAtlasCustomRect* Data; }; // Instantiation of ImVector<ImFontAtlasCustomRect>
23282329
struct ImVector_ImFontConfig_t { int Size; int Capacity; ImFontConfig* Data; }; // Instantiation of ImVector<ImFontConfig>
23292330
struct ImVector_float_t { int Size; int Capacity; float* Data; }; // Instantiation of ImVector<float>
2331+
struct ImVector_ImU16_t { int Size; int Capacity; ImU16* Data; }; // Instantiation of ImVector<ImU16>
23302332
struct ImVector_ImFontGlyph_t { int Size; int Capacity; ImFontGlyph* Data; }; // Instantiation of ImVector<ImFontGlyph>
23312333
struct ImVector_ImGuiPlatformMonitor_t { int Size; int Capacity; ImGuiPlatformMonitor* Data; }; // Instantiation of ImVector<ImGuiPlatformMonitor>
23322334
struct ImVector_ImGuiViewportPtr_t { int Size; int Capacity; ImGuiViewport** Data; }; // Instantiation of ImVector<ImGuiViewport*>
@@ -3400,8 +3402,8 @@ struct ImFontConfig_t
34003402
bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
34013403
bool PixelSnapH; // false // Align every glyph AdvanceX to pixel boundaries. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
34023404
int FontNo; // 0 // Index of font within TTF/OTF file
3403-
int OversampleH; // 2 // Rasterize at higher quality for sub-pixel positioning. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
3404-
int OversampleV; // 1 // Rasterize at higher quality for sub-pixel positioning. This is not really useful as we don't use sub-pixel positions on the Y axis.
3405+
int OversampleH; // 0 (2) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1 or 2 depending on size. Note the difference between 2 and 3 is minimal. You can reduce this to 1 for large glyphs save memory. Read https://github.com/nothings/stb/blob/master/tests/oversample/README.md for details.
3406+
int OversampleV; // 0 (1) // Rasterize at higher quality for sub-pixel positioning. 0 == auto == 1. This is not really useful as we don't use sub-pixel positions on the Y axis.
34053407
float SizePixels; // // Size in pixels for rasterizer (more or less maps to the resulting font height).
34063408
ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs when rendered: essentially add to glyph->AdvanceX. Only X axis is supported for now.
34073409
ImVec2 GlyphOffset; // 0, 0 // Offset all glyphs from this font input.
@@ -3540,8 +3542,8 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas*
35403542
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self, const void* compressed_font_data, int compressed_font_data_size, float size_pixels, const ImFontConfig* font_cfg /* = NULL */, const ImWchar* glyph_ranges /* = NULL */); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
35413543
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self, const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg /* = NULL */, const ImWchar* glyph_ranges /* = NULL */); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
35423544
CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas* self); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
3545+
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self); // Clear input+output font data (same as ClearInputData() + glyphs storage, UV coordinates).
35433546
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* self); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
3544-
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas* self); // Clear output font data (glyphs storage, UV coordinates).
35453547
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* self); // Clear all input and output.
35463548
// Build atlas, retrieve pixel data.
35473549
// User is in charge of copying the pixels into graphics memory (e.g. create a texture with your engine). Then store your texture handle with SetTexID().
@@ -3585,28 +3587,28 @@ CIMGUI_API bool ImFontAtlas_GetMouseCursorTexData(ImFontAtlas*
35853587
struct ImFont_t
35863588
{
35873589
// [Internal] Members: Hot ~20/24 bytes (for CalcTextSize)
3588-
ImVector_float IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
3590+
ImVector_float IndexAdvanceX; // 12-16 // out // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
35893591
float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX
3590-
float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading)
3592+
float FontSize; // 4 // in // Height of characters/line, set during loading (don't change after loading)
35913593

35923594
// [Internal] Members: Hot ~28/40 bytes (for RenderText loop)
3593-
ImVector_ImWchar IndexLookup; // 12-16 // out // // Sparse. Index glyphs by Unicode code-point.
3594-
ImVector_ImFontGlyph Glyphs; // 12-16 // out // // All glyphs.
3595+
ImVector_ImU16 IndexLookup; // 12-16 // out // Sparse. Index glyphs by Unicode code-point.
3596+
ImVector_ImFontGlyph Glyphs; // 12-16 // out // All glyphs.
35953597
const ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar)
35963598

35973599
// [Internal] Members: Cold ~32/40 bytes
35983600
// Conceptually ConfigData[] is the list of font sources merged to create this font.
3599-
ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into
3600-
const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData to ConfigDataCount instances
3601-
short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
3601+
ImFontAtlas* ContainerAtlas; // 4-8 // out // What we has been loaded into
3602+
const ImFontConfig* ConfigData; // 4-8 // in // Pointer within ContainerAtlas->ConfigData to ConfigDataCount instances
3603+
short ConfigDataCount; // 2 // in // Number of ImFontConfig involved in creating this font. Usually 1, or >1 when merging multiple font sources into one ImFont.
36023604
short EllipsisCharCount; // 1 // out // 1 or 3
3603-
ImWchar EllipsisChar; // 2-4 // out // = '...'/'.'// Character used for ellipsis rendering.
3604-
ImWchar FallbackChar; // 2-4 // out // = FFFD/'?' // Character used if a glyph isn't found.
3605-
float EllipsisWidth; // 4 // out // Width
3606-
float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
3607-
float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
3608-
float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
3609-
int MetricsTotalSurface; // 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
3605+
ImWchar EllipsisChar; // 2-4 // out // Character used for ellipsis rendering ('...').
3606+
ImWchar FallbackChar; // 2-4 // out // Character used if a glyph isn't found (U+FFFD, '?')
3607+
float EllipsisWidth; // 4 // out // Total ellipsis Width
3608+
float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
3609+
float Scale; // 4 // in // Base font scale (1.0f), multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
3610+
float Ascent, Descent; // 4+4 // out // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize] (unscaled)
3611+
int MetricsTotalSurface; // 4 // out // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
36103612
bool DirtyLookupTables; // 1 // out //
36113613
ImU8 Used8kPagesMap[(IM_UNICODE_CODEPOINT_MAX +1)/8192/8]; // 1 bytes if ImWchar=ImWchar16, 16 bytes if ImWchar==ImWchar32. Store 1-bit for each block of 4K codepoints that has one active glyph. This is mainly used to facilitate iterations across all used codepoints.
36123614
};

0 commit comments

Comments
 (0)