Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 21239 → Rev 21240

/trunk/Scribus/scribus/pageitem_textframe.cpp
1448,9 → 1448,15
int regionMinY = 0, regionMaxY= 0;
double autoLeftIndent = 0.0;
 
for (int i = 0; shaper.hasRun(i); ++i)
for (int i = 0; true; ++i)
{
if (current.isEmpty)
shaper.startLine(i);
 
if (!shaper.hasRun(i))
break;
GlyphRun newRun = shaper.runAt(i);
 
if (i >= glyphRuns.count())
glyphRuns.append(newRun);
else
1465,6 → 1471,16
PageItem* currentObject = itemText.object(a);
bool HasMark = itemText.hasMark(a);
 
// set StartOfLine
if (current.isEmpty)
{
glyphRuns[i].setFlag(ScLayout_StartOfLine);
}
else
{
glyphRuns[i].clearFlag(ScLayout_StartOfLine);
}
 
const StyleFlag& effects = itemText.charStyle(a).effects();
if (effects & ScStyle_UnderlineWords)
{
1663,15 → 1679,6
else
chs = charStyle.fontSize();
}
// set StartOfLine
if (current.isEmpty)
{
glyphRuns[i].setFlag(ScLayout_StartOfLine);
}
else
{
glyphRuns[i].clearFlag(ScLayout_StartOfLine);
}
// glyphs->yadvance = 0;
 
GlyphLayout& firstGlyph = glyphRuns[i].glyphs().first();
/trunk/Scribus/scribus/text/textshaper.cpp
19,6 → 19,7
: m_startIndex(startIndex),
m_index(startIndex),
m_lastKernedIndex(-1),
m_layoutFlags(ScLayout_None),
m_item(textItem)
{
if (m_item->lastInFrame() >= m_item->firstInFrame())
169,6 → 170,19
m_lastKernedIndex = m_runs.count() - 1;
}
 
void TextShaper::startLine(int i)
{
m_layoutFlags = ScLayout_StartOfLine;
 
while (m_runs.count() > i)
{
m_index = m_runs.last().firstChar();
m_runs.removeLast();
}
 
m_lastKernedIndex = m_runs.count() - 1;
}
 
void TextShaper::initGlyphLayout(GlyphRun& run, const QString& chars, int runIndex)
{
int a = run.firstChar();
179,7 → 193,9
if (SpecialChars::isExpandingSpace(ch))
run.setFlag(ScLayout_ExpandingSpace);
 
GlyphLayout gl = m_item->layoutGlyphs(runStyle, chars, itemText.flags(a));
LayoutFlags layoutFlags = static_cast<LayoutFlags>(itemText.flags(a) | m_layoutFlags);
GlyphLayout gl = m_item->layoutGlyphs(runStyle, chars, layoutFlags);
m_layoutFlags = static_cast<LayoutFlags>(m_layoutFlags & (~ScLayout_StartOfLine));
 
if (runIndex > 0)
{
/trunk/Scribus/scribus/text/textshaper.h
30,6 → 30,11
* Retrieve glyph run at specified index
*/
GlyphRun runAt(int i);
 
/**
* Indicates that a new line is being started
*/
void startLine(int i);
protected:
 
41,6 → 46,9
 
// Last run which has been kerned
int m_lastKernedIndex;
 
// Additional flags used for glyph layout
LayoutFlags m_layoutFlags;
// The item whose text is being shaped
PageItem_TextFrame* m_item;