Skip to content

Commit f257fef

Browse files
committed
TextLayout: Fix hang when shaping text containing a zero-width glyph
1 parent 7905375 commit f257fef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/juce_graphics/fonts/juce_TextLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void TextLayout::createLayoutWithBalancedLineLengths (const AttributedString& te
342342
for (const auto& line : lines)
343343
for (const auto& run : line->runs)
344344
for (const auto& glyph : run->glyphs)
345-
advanceWidth = jmin (*advanceWidth, glyph.width);
345+
advanceWidth = jmin (*advanceWidth, jmax (glyph.width, 1.0f));
346346
}
347347

348348
maxWidth -= *advanceWidth;

0 commit comments

Comments
 (0)