r21160 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 4 01:56:37 UTC 2016


Author: jghali
Date: Mon Apr  4 01:56:37 2016
New Revision: 21160

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21160
Log:
#13880: Scribusboxes : another case of buggy justified alignment

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/text/textshaper.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21160&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Mon Apr  4 01:56:37 2016
@@ -2630,13 +2630,13 @@
 	
 /*	if (layout.glyph == (ScFace::CONTROL_GLYPHS + SpecialChars::NBSPACE.unicode())) {
 		uint replGlyph = font.char2CMap(QChar(' '));
-		layout.xadvance = font.glyphWidth(replGlyph, style.fontSize() / 10) * layout.scaleH;
-		layout.yadvance = font.glyphBBox(replGlyph, style.fontSize() / 10).ascent * layout.scaleV;
+		layout.xadvance = font.glyphWidth(replGlyph, style.fontSize() / 10);
+		layout.yadvance = font.glyphBBox(replGlyph, style.fontSize() / 10).ascent;
 	}
 	else if (layout.glyph == (ScFace::CONTROL_GLYPHS + SpecialChars::NBHYPHEN.unicode())) {
 		uint replGlyph = font.char2CMap(QChar('-'));
-		layout.xadvance = font.glyphWidth(replGlyph, style.fontSize() / 10) * layout.scaleH;
-		layout.yadvance = font.glyphBBox(replGlyph, style.fontSize() / 10).ascent * layout.scaleV;
+		layout.xadvance = font.glyphWidth(replGlyph, style.fontSize() / 10);
+		layout.yadvance = font.glyphBBox(replGlyph, style.fontSize() / 10).ascent;
 	}
 	else if (layout.glyph >= ScFace::CONTROL_GLYPHS) {
 		layout.xadvance = 0;
@@ -2644,8 +2644,8 @@
 	}
 	else */
 	{
-		gl.xadvance = font.glyphWidth(gl.glyph, style.fontSize() / 10) * gl.scaleH;
-		gl.yadvance = font.glyphBBox(gl.glyph, style.fontSize() / 10).ascent * gl.scaleV;
+		gl.xadvance = font.glyphWidth(gl.glyph, style.fontSize() / 10);
+		gl.yadvance = font.glyphBBox(gl.glyph, style.fontSize() / 10).ascent;
 	}
 	if (gl.xadvance > 0)
 		gl.xadvance += tracking;

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21160&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Mon Apr  4 01:56:37 2016
@@ -1003,7 +1003,7 @@
 		else if (!glyphrun.hasFlag(ScLayout_SuppressSpace))
 		{
 			GlyphLayout& glyph = glyphrun.glyphs().last();
-			glyph.xadvance += wide * spaceExtension;
+			glyph.xadvance += (wide * spaceExtension) / glyph.scaleH;
 		}
 		if (i != curr.line.firstRun && glyphrun.hasFlag(ScLayout_ImplicitSpace))
 		{
@@ -1781,7 +1781,7 @@
 					firstGlyph.scaleH *= firstGlyph.scaleV;
 					firstGlyph.xoffset -= 0.5; //drop caps are always to far from column left edge
 				}
-				firstGlyph.xadvance = wide / firstGlyph.scaleH;  // FIXME: why this division?
+				firstGlyph.xadvance = wide / firstGlyph.scaleH;
 				desc = realDesc = 0;
 			}
 			else // !DropCMode
@@ -2497,9 +2497,7 @@
 			if ((DropCmode || BulNumMode) && !outs)
 			{
 				current.xPos += style.parEffectOffset();
-				 // FIXME: why a special case for drop caps
-				lastGlyph.xadvance += DropCmode ? (style.parEffectOffset() / lastGlyph.scaleH)
-				                                :  style.parEffectOffset();
+				lastGlyph.xadvance += style.parEffectOffset() / lastGlyph.scaleH;
 				if (DropCmode)
 				{
 					DropCmode = false;

Modified: trunk/Scribus/scribus/text/textshaper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21160&path=/trunk/Scribus/scribus/text/textshaper.cpp
==============================================================================
--- trunk/Scribus/scribus/text/textshaper.cpp	(original)
+++ trunk/Scribus/scribus/text/textshaper.cpp	Mon Apr  4 01:56:37 2016
@@ -185,7 +185,7 @@
 	if (runIndex > 0)
 	{
 		GlyphLayout& last = m_runs[runIndex - 1].glyphs().last();
-		last.xadvance += runStyle.font().glyphKerning(last.glyph, gl.glyph, runStyle.fontSize() / 10) * last.scaleH;
+		last.xadvance += runStyle.font().glyphKerning(last.glyph, gl.glyph, runStyle.fontSize() / 10);
 		m_lastKernedIndex = qMax(m_lastKernedIndex, runIndex - 1);
 	}
 




More information about the scribus-commit mailing list