From d4fc95d254e880e2dff11a9986e74a7a6f4234b7 Mon Sep 17 00:00:00 2001 From: Fahad Al-Saidi Date: Mon, 25 Apr 2016 10:30:52 +0400 Subject: [PATCH] Fix CJK line Breaking This mimic the old stlye in line breaking though we should find a better solution for line breaking in general. --- scribus/pageitem_textframe.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scribus/pageitem_textframe.cpp b/scribus/pageitem_textframe.cpp index 6209a2fb6..0a060b010 100644 --- a/scribus/pageitem_textframe.cpp +++ b/scribus/pageitem_textframe.cpp @@ -2178,6 +2178,11 @@ void PageItem_TextFrame::layout() // remember possible break if (i + 1 < glyphRuns.count() && glyphRuns[i + 1].hasFlag(ScLayout_LineBoundry)) { + if (current.glyphs.length() > 1 + && (current.glyphs[currentIndex - 1].lastChar() != SpecialChars::CJK_NOBREAK_AFTER) + && (current.glyphs[currentIndex].firstChar() != SpecialChars::CJK_NOBREAK_BEFORE)) + current.rememberBreak(i - 1, breakPos, style.rightMargin()); + if (!current.glyphs[currentIndex].hasFlag(ScLayout_LineBoundry)) current.rememberBreak(i, breakPos, style.rightMargin()); }