Skip to content

Commit

Permalink
#13977: Move tracking handling to PageItem_TextFrame::layout()
Browse files Browse the repository at this point in the history
We need not to apply it at start of line. Better fix for
https://bugs.scribus.net/view.php?id=13977.
  • Loading branch information
khaledhosny committed Apr 25, 2016
1 parent 3b19027 commit e0e186b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions scribus/pageitem_textframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,14 @@ void PageItem_TextFrame::layout()
else
current.glyphs[currentIndex].clearFlag(ScLayout_StartOfLine);

if (!current.glyphs[currentIndex].hasFlag(ScLayout_StartOfLine))
{
double tracking = charStyle.fontSize() * charStyle.tracking() / 10000.0;
current.glyphs[currentIndex].addToXOffset(tracking);
if (current.glyphs[currentIndex].width() != 0)
current.glyphs[currentIndex].setExtraWidth(tracking);
}

// glyphs->yadvance = 0;

if (i == current.line.firstRun && current.glyphs[currentIndex].hasFlag(ScLayout_CJKFence))
Expand Down
8 changes: 0 additions & 8 deletions scribus/text/textshaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,6 @@ QList<GlyphCluster> TextShaper::shape()
if (m_story.hasObject(firstChar))
gl.xadvance = m_story.object(firstChar)->width() + m_story.object(firstChar)->lineWidth();

double tracking = 0;
if (!(flags & ScLayout_StartOfLine))
tracking = style.fontSize() * style.tracking() / 10000.0;
gl.xoffset += tracking;

if ((effects & ScStyle_Superscript) || (effects & ScStyle_Subscript))
{
double scale;
Expand Down Expand Up @@ -481,9 +476,6 @@ QList<GlyphCluster> TextShaper::shape()
run.setScaleH(1.0);
}

if (gl.xadvance > 0)
gl.xadvance += tracking;

run.append(gl);
lastGlyph = &gl;
i++;
Expand Down

0 comments on commit e0e186b

Please sign in to comment.