r24117 by jghali - #16284: Issue with Convert to Outlines for CTL Text

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 27 11:02:44 UTC 2020


Author: jghali
Date: Tue Oct 27 11:02:44 2020
New Revision: 24117

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24117
Log:
#16284: Issue with Convert to Outlines for CTL Text

Modified:
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24117&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Tue Oct 27 11:02:44 2020
@@ -2970,8 +2970,15 @@
 
 		void drawGlyph(const GlyphCluster& gc) override
 		{
+			double current_x = 0.0;
 			for (const GlyphLayout& gl : gc.glyphs())
 			{
+				if (gl.glyph >= ScFace::CONTROL_GLYPHS)
+				{
+					current_x += gl.xadvance * gl.scaleH;
+					continue;
+				}
+
 				FPointArray outline = font().glyphOutline(gl.glyph);
 				if (outline.size() < 4)
 					return;
@@ -2988,7 +2995,7 @@
 					transform.translate(0, m_item->height());
 					transform.scale(1, -1);
 				}
-				transform.translate(x(), y());
+				transform.translate(x() + gl.xoffset + current_x , y() + gl.yoffset);
 				transform.translate(0, -(fontSize() * gl.scaleV));
 				transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
 				outline.map(transform);
@@ -3014,13 +3021,22 @@
 				m_view->m_doc->setRedrawBounding(item);
 				m_view->undoManager->setUndoEnabled(true);
 				m_group.append(m_view->m_doc->Items->takeAt(z));
+
+				current_x += gl.xadvance * gl.scaleH;
 			}
 		}
 
 		void drawGlyphOutline(const GlyphCluster& gc, bool fill) override
 		{
+			double current_x = 0.0;
 			for (const GlyphLayout& gl : gc.glyphs())
 			{
+				if (gl.glyph >= ScFace::CONTROL_GLYPHS)
+				{
+					current_x += gl.xadvance * gl.scaleH;
+					continue;
+				}
+
 				FPointArray outline = font().glyphOutline(gl.glyph);
 				if (outline.size() < 4)
 					return;
@@ -3037,7 +3053,7 @@
 					transform.translate(0, m_item->height());
 					transform.scale(1, -1);
 				}
-				transform.translate(x(), y());
+				transform.translate(x() + gl.xoffset + current_x , y() + gl.yoffset);
 				transform.translate(0, -(fontSize() * gl.scaleV));
 				transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
 				outline.map(transform);
@@ -3066,6 +3082,8 @@
 				m_view->m_doc->setRedrawBounding(item);
 				m_view->undoManager->setUndoEnabled(true);
 				m_group.append(m_view->m_doc->Items->takeAt(z));
+
+				current_x += gl.xadvance * gl.scaleH;
 			}
 		}
 




More information about the scribus-commit mailing list