Skip to content

Commit

Permalink
Fix CJK line Breaking
Browse files Browse the repository at this point in the history
This mimic the old stlye in line breaking though we should find a better solution for line breaking in general.
  • Loading branch information
Fahad-Alsaidi committed Apr 25, 2016
1 parent e0e186b commit d4fc95d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scribus/pageitem_textframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit d4fc95d

Please sign in to comment.