r18279 by jghali - #11520: Convert Text to Outlines disrupts text position if modified

scribus-commit scribus-commit at lists.scribus.net
Sun May 5 13:51:50 UTC 2013


Author: jghali
Date: Sun May  5 13:51:50 2013
New Revision: 18279

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18279
Log:
#11520: Convert Text to Outlines disrupts text position if modified

Modified:
    branches/Version14x/Scribus/scribus/scribusview.cpp

Modified: branches/Version14x/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18279&path=/branches/Version14x/Scribus/scribus/scribusview.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusview.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusview.cpp Sun May  5 13:51:50 2013
@@ -4366,8 +4366,8 @@
 						QMatrix chma, chma2, chma3, chma4, chma6;
 						uint gl = hl->font().char2CMap(chr);
 						FPoint origin = hl->font().glyphOrigin(gl);
-						x = origin.x() * csi;
-						y = origin.y() * csi;
+						x = origin.x() * csi * hl->glyph.scaleH;
+						y = origin.y() * csi * hl->glyph.scaleV;
 						if ((charStyle.effects() & ScStyle_Underline)
 											   || ((charStyle.effects() & ScStyle_UnderlineWords)
 											   // Qt4 added toInt() ???
@@ -4421,7 +4421,7 @@
 							else
 								wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 							if (currItem->imageFlippedH())
-								textX = currItem->width() - textX - wide;
+								textX = currItem->width() - textX - bb->width() - x;
 							if (currItem->imageFlippedV())
 								textY = currItem->height() - textY + y - (bb->height() - y);
 							FPoint npo(textX, textY, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -4474,11 +4474,7 @@
 								double textX = CurX + hl->glyph.xoffset;
 								double textY = ls.y;  // + hl->glyph.yoffset;
 								if (charStyle.effects() & (ScStyle_Subscript | ScStyle_Superscript))
-								{
 									textY += hl->glyph.yoffset;
-									x *= hl->glyph.scaleH;
-									y *= hl->glyph.scaleV;
-								}
 								chma6 = QMatrix();
 								if (charStyle.baselineOffset() != 0)
 									textY -= (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -4487,7 +4483,7 @@
 								else
 									wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 								if (currItem->imageFlippedH())
-									textX = currItem->width() - textX - wide;
+									textX = currItem->width() - textX - bb->width() - x;
 								if (currItem->imageFlippedV())
 									textY = currItem->height() - textY + y - (bb->height() - y);
 								FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -4531,11 +4527,7 @@
 							double textX = CurX + hl->glyph.xoffset;
 							double textY = ls.y;  // + hl->glyph.yoffset;
 							if (charStyle.effects() & (ScStyle_Subscript | ScStyle_Superscript))
-							{
 								textY += hl->glyph.yoffset;
-								x *= hl->glyph.scaleH;
-								y *= hl->glyph.scaleV;
-							}
 							chma6 = QMatrix();
 							if (charStyle.baselineOffset() != 0)
 								textY -= (charStyle.fontSize() / 10.0) * (charStyle.baselineOffset() / 1000.0);
@@ -4544,7 +4536,7 @@
 							else
 								wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 							if (currItem->imageFlippedH())
-								textX = currItem->width() - textX - wide;
+								textX = currItem->width() - textX - bb->width() - x;
 							if (currItem->imageFlippedV())
 								textY = currItem->height() - textY + y - (bb->height() - y);
 							FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
@@ -4603,7 +4595,7 @@
 							else
 								wide = hl->font().charWidth(chstr[0], charStyle.fontSize());
 							if (currItem->imageFlippedH())
-								textX = currItem->width() - textX - wide;
+								textX = currItem->width() - textX - bb->width() - x;
 							if (currItem->imageFlippedV())
 								textY = currItem->height() - textY + y - (bb->height() - y);
 							FPoint npo(textX, textY, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);




More information about the scribus-commit mailing list