r21126 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 28 11:47:53 UTC 2016


Author: fschmid
Date: Mon Mar 28 11:47:53 2016
New Revision: 21126

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21126
Log:
More fixes for text export

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
    trunk/Scribus/scribus/scribusview.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21126&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Mon Mar 28 11:47:53 2016
@@ -249,7 +249,7 @@
 		{
 			if (!StrokeColor.isEmpty())
 			{
-				m_pathBuffer += FToStr(strokeWidth() / 10.0) + " w\n[] 0 d\n0 J\n0 j\n";
+				m_pathBuffer += FToStr(strokeWidth()) + " w\n[] 0 d\n0 J\n0 j\n";
 				m_pathBuffer += StrokeColor;
 			}
 

Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21126&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp	Mon Mar 28 11:47:53 2016
@@ -1065,7 +1065,15 @@
 	for(QDomElement txtGrp = grp.firstChildElement(); !txtGrp.isNull(); txtGrp = txtGrp.nextSiblingElement() )
 	{
 		if (txtGrp.tagName() != "Glyphs")
+		{
+			if (!first)
+			{
+				glyph.setAttribute("Indices", Indices);
+				glyph.setAttribute("UnicodeString", UnicodeString);
+				first = true;
+			}
 			grp2.appendChild(txtGrp.cloneNode(true));
+		}
 		else
 		{
 			if (first)

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21126&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Mon Mar 28 11:47:53 2016
@@ -3024,7 +3024,6 @@
 
 	void drawGlyph(const GlyphLayout gl)
 	{
-
 		FPointArray outline = font().glyphOutline(gl.glyph);
 		if (outline.size() < 4)
 			return;
@@ -3035,7 +3034,7 @@
 		transform.translate(0, -(fontSize() * gl.scaleV));
 		transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
 		outline.map(transform);
-		uint z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), m_item->lineWidth(), m_item->lineColor(), m_item->fillColor());
+		uint z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), 0, fillColor().color, CommonStrings::None);
 		PageItem* item = m_view->Doc->Items->at(z);
 		m_view->undoManager->setUndoEnabled(false);
 		item->setTextFlowMode(m_item->textFlowMode());
@@ -3048,6 +3047,43 @@
 			item->setRotation(m_item->rotation());
 		item->setFillColor(fillColor().color);
 		item->setFillShade(fillColor().shade);
+		m_view->Doc->adjustItemSize(item);
+		item->ContourLine = item->PoLine.copy();
+		item->ClipEdited = true;
+		item->FrameType = 3;
+		item->OldB2 = item->width();
+		item->OldH2 = item->height();
+		m_view->Doc->setRedrawBounding(item);
+		m_view->undoManager->setUndoEnabled(true);
+		m_group.append(m_view->Doc->Items->takeAt(z));
+	}
+	void drawGlyphOutline(const GlyphLayout gl, bool fill)
+	{
+		FPointArray outline = font().glyphOutline(gl.glyph);
+		if (outline.size() < 4)
+			return;
+		QTransform transform;
+		if (m_item->isPathText())
+			transform = matrix();
+		transform.translate(x(), y());
+		transform.translate(0, -(fontSize() * gl.scaleV));
+		transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
+		outline.map(transform);
+		uint z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), strokeWidth(), fillColor().color, strokeColor().color);
+		PageItem* item = m_view->Doc->Items->at(z);
+		m_view->undoManager->setUndoEnabled(false);
+		item->setTextFlowMode(m_item->textFlowMode());
+		item->setSizeLocked(m_item->sizeLocked());
+		item->setLocked(m_item->locked());
+		item->NamedLStyle = m_item->NamedLStyle;
+		item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
+		item->PoLine = outline.copy();
+		if (!m_item->asPathText())
+			item->setRotation(m_item->rotation());
+		item->setFillColor(fillColor().color);
+		item->setFillShade(fillColor().shade);
+		item->setLineColor(strokeColor().color);
+		item->setLineShade(strokeColor().shade);
 		item->setLineWidth(strokeWidth());
 		m_view->Doc->adjustItemSize(item);
 		item->ContourLine = item->PoLine.copy();
@@ -3058,10 +3094,6 @@
 		m_view->Doc->setRedrawBounding(item);
 		m_view->undoManager->setUndoEnabled(true);
 		m_group.append(m_view->Doc->Items->takeAt(z));
-	}
-	void drawGlyphOutline(const GlyphLayout gl, bool fill)
-	{
-		drawGlyph(gl);
 	}
 	void drawLine(QPointF start, QPointF end)
 	{




More information about the scribus-commit mailing list