From faa84fd46442c4530843b93b7705786f63c47dd8 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 22 Mar 2025 12:38:18 -0500 Subject: [PATCH] set the max font tex height to 16384 fixes a crash on macOS --- extern/imgui_patched/imgui_draw.cpp | 2 +- extern/imgui_patched/misc/freetype/imgui_freetype.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/imgui_patched/imgui_draw.cpp b/extern/imgui_patched/imgui_draw.cpp index e361c31a5..912a0b4de 100644 --- a/extern/imgui_patched/imgui_draw.cpp +++ b/extern/imgui_patched/imgui_draw.cpp @@ -2654,7 +2654,7 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas) // 5. Start packing // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values). - const int TEX_HEIGHT_MAX = 1024 * 32; + const int TEX_HEIGHT_MAX = 1024 * 16; stbtt_pack_context spc = {}; stbtt_PackBegin(&spc, NULL, atlas->TexWidth, TEX_HEIGHT_MAX, 0, atlas->TexGlyphPadding, NULL); ImFontAtlasBuildPackCustomRects(atlas, spc.pack_info); diff --git a/extern/imgui_patched/misc/freetype/imgui_freetype.cpp b/extern/imgui_patched/misc/freetype/imgui_freetype.cpp index 038aded8e..c508066f8 100644 --- a/extern/imgui_patched/misc/freetype/imgui_freetype.cpp +++ b/extern/imgui_patched/misc/freetype/imgui_freetype.cpp @@ -617,7 +617,7 @@ bool ImFontAtlasBuildWithFreeTypeEx(FT_Library ft_library, ImFontAtlas* atlas, u // 5. Start packing // Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values). - const int TEX_HEIGHT_MAX = 1024 * 32; + const int TEX_HEIGHT_MAX = 1024 * 16; const int num_nodes_for_packing_algorithm = atlas->TexWidth - atlas->TexGlyphPadding; ImVector pack_nodes; pack_nodes.resize(num_nodes_for_packing_algorithm);