r21128 by fschmid -
scribus-commit
scribus-commit at lists.scribus.net
Mon Mar 28 17:01:17 UTC 2016
Author: fschmid
Date: Mon Mar 28 17:01:17 2016
New Revision: 21128
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21128
Log:
Provide identical output on all devices for outlined text.
Modified:
trunk/Scribus/scribus/canvas.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
trunk/Scribus/scribus/pslib.cpp
trunk/Scribus/scribus/text/boxes.cpp
trunk/Scribus/scribus/text/screenpainter.cpp
Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Mon Mar 28 17:01:17 2016
@@ -804,7 +804,7 @@
*/
void Canvas::paintEvent ( QPaintEvent * p )
{
-// qDebug()<<"Canvas::paintEvent"<<p->rect()<<m_viewMode.forceRedraw<<m_viewMode.operItemSelecting;
+// qDebug()<<"Canvas::paintEvent"<<p->rect()<<m_viewMode.forceRedraw<<m_viewMode.operItemSelecting;
// printBacktrace(62);
if (m_doc->isLoading())
return;
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Mar 28 17:01:17 2016
@@ -249,7 +249,7 @@
{
if (!StrokeColor.isEmpty())
{
- m_pathBuffer += FToStr(strokeWidth()) + " w\n[] 0 d\n0 J\n0 j\n";
+ m_pathBuffer += FToStr(strokeWidth() / fontSize()) + " w\n[] 0 d\n0 J\n0 j\n";
m_pathBuffer += StrokeColor;
}
Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp Mon Mar 28 17:01:17 2016
@@ -1191,7 +1191,7 @@
if (hasFill)
fill = "fill:" + m_svg->SetColor(fillColor().color, fillColor().shade) + ";";
QString stroke ="stroke:" + m_svg->SetColor(strokeColor().color, strokeColor().shade) + ";";
- stroke += " stroke-width:" + m_svg->FToStr(strokeWidth()) + ";";
+ stroke += " stroke-width:" + m_svg->FToStr(strokeWidth() / (gl.scaleV * fontSize() / 10.0)) + ";";
glyph.setAttribute("style", fill + stroke);
m_elem.appendChild(glyph);
}
@@ -1263,6 +1263,82 @@
SvgPainter p(trans, this, ob);
Item->textLayout.renderBackground(&p);
Item->textLayout.render(&p);
+ if (Item->isTextFrame())
+ {
+ if (Item->NamedLStyle.isEmpty())
+ {
+ if ((!Item->strokePattern().isEmpty()) && (Item->patternStrokePath))
+ {
+ QDomElement ob4 = docu.createElement("g");
+ QDomElement ob2 = docu.createElement("path");
+ ob2.setAttribute("d", SetClipPath(&Item->PoLine, true));
+ ob2.setAttribute("transform", trans);
+ ob2.setAttribute("style", fill);
+ ob4.appendChild(ob2);
+ ob4.appendChild(processSymbolStroke(Item, trans));
+ ob.appendChild(ob4);
+ }
+ else
+ {
+ QDomElement ob4 = docu.createElement("path");
+ ob4.setAttribute("d", SetClipPath(&Item->PoLine, true));
+ ob4.setAttribute("style", "fill:none; "+stroke);
+ ob.appendChild(ob4);
+ }
+ }
+ else
+ {
+ multiLine ml = m_Doc->MLineStyles[Item->NamedLStyle];
+ for (int it = ml.size()-1; it > -1; it--)
+ {
+ if ((ml[it].Color != CommonStrings::None) && (ml[it].Width != 0))
+ {
+ QDomElement ob5 = docu.createElement("path");
+ ob5.setAttribute("d", SetClipPath(&Item->PoLine, true));
+ ob5.setAttribute("style", "fill:none; "+GetMultiStroke(&ml[it], Item));
+ ob.appendChild(ob5);
+ }
+ }
+ }
+ }
+ else if (Item->isPathText() && Item->PoShow)
+ {
+ if (Item->NamedLStyle.isEmpty())
+ {
+ if ((!Item->strokePattern().isEmpty()) && (Item->patternStrokePath))
+ {
+ QDomElement ob4 = docu.createElement("g");
+ QDomElement ob2 = docu.createElement("path");
+ ob2.setAttribute("d", SetClipPath(&Item->PoLine, false));
+ ob2.setAttribute("transform", trans);
+ ob2.setAttribute("style", fill);
+ ob4.appendChild(ob2);
+ ob4.appendChild(processSymbolStroke(Item, trans));
+ ob.appendChild(ob4);
+ }
+ else
+ {
+ QDomElement ob4 = docu.createElement("path");
+ ob4.setAttribute("d", SetClipPath(&Item->PoLine, false));
+ ob4.setAttribute("style", "fill:none; "+stroke);
+ ob.appendChild(ob4);
+ }
+ }
+ else
+ {
+ multiLine ml = m_Doc->MLineStyles[Item->NamedLStyle];
+ for (int it = ml.size()-1; it > -1; it--)
+ {
+ if ((ml[it].Color != CommonStrings::None) && (ml[it].Width != 0))
+ {
+ QDomElement ob5 = docu.createElement("path");
+ ob5.setAttribute("d", SetClipPath(&Item->PoLine, false));
+ ob5.setAttribute("style", "fill:none; "+GetMultiStroke(&ml[it], Item));
+ ob.appendChild(ob5);
+ }
+ }
+ }
+ }
return ob;
}
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&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 17:01:17 2016
@@ -874,6 +874,7 @@
glyph.setAttribute("StrokeThickness", m_xps->FToStr(strokeWidth() * m_xps->conversionFactor));
glyph.setAttribute("Stroke", m_xps->SetColor(strokeColor().color, strokeColor().shade, 0));
m_group.appendChild(glyph);
+ qDebug() << "StrokeWidth XPS" << strokeWidth();
}
}
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Mon Mar 28 17:01:17 2016
@@ -144,17 +144,17 @@
chma.scale((fontSize() * gl.scaleH) / 10.0, (fontSize() * gl.scaleV) / 10.0);
gly.map(chma);
m_ps->PS_translate(0, -(fontSize() - fontSize() * gl.scaleV));
+ if (gl.scaleH != 1.0 || gl.scaleV != 1.0)
+ m_ps->PS_scale(gl.scaleH, gl.scaleV);
+ if (fill)
+ m_ps->putColorNoDraw(fillColor().color, fillColor().shade);
+ m_ps->PS_showSub(gl.glyph, m_ps->FontSubsetMap[font().scName()], fontSize(), false);
m_ps->SetColor(strokeColor().color, strokeColor().shade, &h, &s, &v, &k);
m_ps->PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
m_ps->SetClipPath(&gly, true);
m_ps->PS_closepath();
m_ps->putColor(strokeColor().color, strokeColor().shade, false);
- if (gl.scaleH != 1.0 || gl.scaleV != 1.0)
- m_ps->PS_scale(gl.scaleH, gl.scaleV);
- if (fill)
- m_ps->putColorNoDraw(fillColor().color, fillColor().shade);
- m_ps->PS_showSub(gl.glyph, m_ps->FontSubsetMap[font().scName()], fontSize(), false);
}
m_ps->PS_restore();
}
Modified: trunk/Scribus/scribus/text/boxes.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/text/boxes.cpp
==============================================================================
--- trunk/Scribus/scribus/text/boxes.cpp (original)
+++ trunk/Scribus/scribus/text/boxes.cpp Mon Mar 28 17:01:17 2016
@@ -569,7 +569,7 @@
if ((charStyle.effects() & ScStyle_Outline) && hasStrokeColor && ((charStyle.fontSize() * gl.scaleV * charStyle.outlineWidth() / 10000.0) != 0))
{
- p->setStrokeWidth((charStyle.fontSize() * gl.scaleV * charStyle.outlineWidth() / 10000.0) / glySc);
+ p->setStrokeWidth((charStyle.fontSize() * gl.scaleV * charStyle.outlineWidth() / 10000.0));// / glySc);
p->drawGlyphOutline(gl, hasFillColor);
}
else if (hasFillColor)
Modified: trunk/Scribus/scribus/text/screenpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21128&path=/trunk/Scribus/scribus/text/screenpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/text/screenpainter.cpp (original)
+++ trunk/Scribus/scribus/text/screenpainter.cpp Mon Mar 28 17:01:17 2016
@@ -204,6 +204,8 @@
void ScreenPainter::drawGlyphOutline(const GlyphLayout gl, bool fill)
{
+ if (fill)
+ drawGlyph(gl);
m_painter->save();
bool fr = m_painter->fillRule();
m_painter->setFillRule(false);
@@ -212,9 +214,11 @@
m_painter->translate(0, -(fontSize() * gl.scaleV));
FPointArray outline = font().glyphOutline(gl.glyph);
- double scaleH = gl.scaleH * fontSize() / 10.0;
- double scaleV = gl.scaleV * fontSize() / 10.0;
- m_painter->scale(scaleH, scaleV);
+ double scaleHv = gl.scaleH * fontSize() / 10.0;
+ double scaleVv = gl.scaleV * fontSize() / 10.0;
+ QTransform trans;
+ trans.scale(scaleHv, scaleVv);
+ outline.map(trans);
m_painter->setupPolygon(&outline, true);
if (outline.size() > 3)
{
@@ -225,8 +229,6 @@
m_painter->setFillRule(fr);
m_painter->restore();
- if (fill)
- drawGlyph(gl);
}
void ScreenPainter::drawLine(QPointF start, QPointF end)
More information about the scribus-commit
mailing list