From e31fb368b64e4767e876d8df804ea24602946232 Mon Sep 17 00:00:00 2001 From: attila Date: Wed, 11 Dec 2024 17:00:49 +0100 Subject: [PATCH] Unicode TR14: Always return a hard break for line breaking code points Prior to this commit a soft break would be returned at the end of text, even if the text was terminated by a newline. --- modules/juce_graphics/unicode/juce_UnicodeLine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/juce_graphics/unicode/juce_UnicodeLine.cpp b/modules/juce_graphics/unicode/juce_UnicodeLine.cpp index f5188dc6e3..a5c984bd8a 100644 --- a/modules/juce_graphics/unicode/juce_UnicodeLine.cpp +++ b/modules/juce_graphics/unicode/juce_UnicodeLine.cpp @@ -70,7 +70,11 @@ public: // LB3 if (isEOT) { - emit (TextBreakType::soft); + if (contains ({ LineBreakType::cr, LineBreakType::lf, LineBreakType::nl }, prev)) + emit (TextBreakType::hard); + else + emit (TextBreakType::soft); + break; }