From 7a30354ce9cf2e12dba5bcb9da47dd944ee6c730 Mon Sep 17 00:00:00 2001 From: Oliver James Date: Wed, 25 Jun 2025 15:02:48 +0100 Subject: [PATCH] TextLayout: Enforce character wrapping attribute --- modules/juce_graphics/fonts/juce_TextLayout.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/juce_graphics/fonts/juce_TextLayout.cpp b/modules/juce_graphics/fonts/juce_TextLayout.cpp index 573430e0fc..df605ca567 100644 --- a/modules/juce_graphics/fonts/juce_TextLayout.cpp +++ b/modules/juce_graphics/fonts/juce_TextLayout.cpp @@ -421,6 +421,9 @@ void TextLayout::createStandardLayout (const AttributedString& text) if (text.getWordWrap() != AttributedString::none) shapedTextOptions = shapedTextOptions.withWordWrapWidth (width); + if (text.getWordWrap() == AttributedString::WordWrap::byChar) + shapedTextOptions = shapedTextOptions.withAllowBreakingInsideWord (true); + ShapedText st { text.getText(), shapedTextOptions }; std::optional lastLineNumber;