/trunk/Scribus/scribus/pageitem_textframe.cpp |
---|
2244,18 → 2244,20 |
current.xPos = qMax(current.xPos, current.colLeft); |
} |
// remember possible break |
if (shapedText.haveMoreText(i + 1, glyphClusters)) |
if (shapedText.haveMoreText(i + 1, glyphClusters) && glyphClusters[i + 1].hasFlag(ScLayout_LineBoundary)) |
{ |
const GlyphCluster& nextCluster = glyphClusters[i + 1]; |
if (nextCluster.hasFlag(ScLayout_LineBoundary)) |
if (current.glyphs.length() > 1 |
&& (current.glyphs[currentIndex - 1].lastChar() != SpecialChars::CJK_NOBREAK_AFTER) |
&& (current.glyphs[currentIndex].firstChar() != SpecialChars::CJK_NOBREAK_BEFORE)) |
{ |
if (!current.glyphs[currentIndex].hasFlag(ScLayout_HyphenationPossible) |
&& (itemText.text(a) != '-') |
&& (itemText.text(a) != SpecialChars::SHYPHEN)) |
{ |
current.rememberBreak(i, breakPos, style.rightMargin()); |
} |
// qDebug() << "rememberBreak LineBoundry @" << i-1; |
current.rememberBreak(i - 1, breakPos, style.rightMargin()); |
} |
if (!current.glyphs[currentIndex].hasFlag(ScLayout_LineBoundary)) |
{ |
// qDebug() << "rememberBreak 2nd LineBoundry @" << i; |
current.rememberBreak(i, breakPos, style.rightMargin()); |
} |
} |
if (HasObject) |
{ |
/trunk/Scribus/scribus/text/textshaper.cpp |
---|
411,22 → 411,6 |
SpecialChars::isCJK(m_story.text(firstChar - 1).unicode())) |
run.setFlag(ScLayout_ImplicitSpace); |
int firstStat = SpecialChars::getCJKAttr(m_story.text(firstChar)); |
int currStat = (firstChar != lastChar) ? SpecialChars::getCJKAttr(m_story.text(lastChar)) : firstStat; |
if (firstStat & SpecialChars::CJK_NOBREAK_BEFORE) |
run.setFlag(ScLayout_NoBreakBefore); |
if (currStat & SpecialChars::CJK_NOBREAK_AFTER) |
run.setFlag(ScLayout_NoBreakAfter); |
if ((firstChar > 0) && (firstStat != 0) && ((firstStat & SpecialChars::CJK_NOBREAK_BEFORE) == 0)) |
{ |
int prevStat = SpecialChars::getCJKAttr(m_story.text(firstChar - 1)); |
if (prevStat != 0 && ((prevStat & SpecialChars::CJK_NOBREAK_AFTER) == 0)) |
run.setFlag(ScLayout_LineBoundary); |
} |
run.setScaleH(charStyle.scaleH() / 1000.0); |
run.setScaleV(charStyle.scaleV() / 1000.0); |
519,6 → 503,7 |
double halfEM = run.style().fontSize() / 10 / 2; |
double quarterEM = run.style().fontSize() / 10 / 4; |
int currStat = SpecialChars::getCJKAttr(m_story.text(lastChar)); |
int nextStat = SpecialChars::getCJKAttr(m_story.text(lastChar + 1)); |
// 1. add 1/4 aki (space) between a CJK letter and |
/trunk/Scribus/scribus/sctextstruct.h |
---|
54,9 → 54,7 |
ScLayout_RightToLeft = 1 << 17, // marks right-to-left glyph |
ScLayout_SmallCap = 1 << 18, // marks small caps glyph |
ScLayout_CJKFence = 1 << 19, // marks CJK fence glyph that needs spacing adjustment at start of line |
ScLayout_NoBreakAfter = 1 << 20, // marks glyphs after which a line break cannot occur |
ScLayout_NoBreakBefore = 1 << 21, // marks glyphs before which a line break cannot occur |
ScLayout_JustificationTracking = 1 << 22 // marks place of tracking in justification (e.g. for Thai) |
ScLayout_JustificationTracking = 1 << 20 // marks place of tracking in justification (e.g. for Thai) |
}; |