From f257fef7f7f590259290ba022d39ed55542c9b53 Mon Sep 17 00:00:00 2001 From: attila Date: Thu, 6 Nov 2025 16:41:59 +0100 Subject: [PATCH] TextLayout: Fix hang when shaping text containing a zero-width glyph --- modules/juce_graphics/fonts/juce_TextLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_graphics/fonts/juce_TextLayout.cpp b/modules/juce_graphics/fonts/juce_TextLayout.cpp index b67bc37754..73254cfd19 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -342,7 +342,7 @@ void TextLayout::createLayoutWithBalancedLineLengths (const AttributedString& te for (const auto& line : lines) for (const auto& run : line->runs) for (const auto& glyph : run->glyphs) - advanceWidth = jmin (*advanceWidth, glyph.width); + advanceWidth = jmin (*advanceWidth, jmax (glyph.width, 1.0f)); } maxWidth -= *advanceWidth;