r15289 by jghali - #9221: underlined text's line cut in parts (in PS/PDF) when manual tracking has negative value
scribus-commit
scribus-commit at lists.scribus.net
Wed Jun 30 01:30:25 CEST 2010
Revision: 15289
Author: jghali
Date: 2010-06-29T23:29:02.480232Z
Commit message: #9221: underlined text's line cut in parts (in PS/PDF) when manual tracking has negative value
Changeset:
M /branches/Version135/Scribus/scribus/pdflib_core.cpp
M /branches/Version135/Scribus/scribus/pslib.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 15288)
+++ scribus/pdflib_core.cpp (revision 15289)
@@ -4436,7 +4436,7 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
tmp2 += putColor(style.fillColor(), style.fillShade(), false);
tmp2 += FToStr(Uwid)+" w\n";
@@ -4444,12 +4444,12 @@
{
if (style.effects() & ScStyle_Subscript)
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) +" "+FToStr(-y+Upos)+" m\n";
tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y+Upos)+" l\n";
}
else
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y+hl->glyph.yoffset+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) +" "+FToStr(-y+hl->glyph.yoffset+Upos)+" m\n";
tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y+hl->glyph.yoffset+Upos)+" l\n";
}
}
@@ -4457,12 +4457,12 @@
{
if (style.effects() & ScStyle_Subscript)
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y-hl->glyph.yoffset+Upos)+" m\n";
- tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y-hl->glyph.yoffset+Upos)+" l\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) + " " + FToStr(-y-hl->glyph.yoffset+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+ " " + FToStr(-y-hl->glyph.yoffset+Upos)+" l\n";
}
else
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) +" "+FToStr(-y+Upos)+" m\n";
tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y+Upos)+" l\n";
}
}
@@ -4716,18 +4716,18 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
tmp2 += putColor(style.fillColor(), style.fillShade(), false);
tmp2 += FToStr(Uwid)+" w\n";
if (ite->itemType() == PageItem::PathText)
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) +" "+FToStr(-y+Upos)+" m\n";
tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y+Upos)+" l\n";
}
else
{
- tmp2 += FToStr(x+hl->glyph.xoffset-kern)+" "+FToStr(-y-hl->glyph.yoffset+Upos)+" m\n";
+ tmp2 += FToStr(x+hl->glyph.xoffset) +" "+FToStr(-y-hl->glyph.yoffset+Upos)+" m\n";
tmp2 += FToStr(x+hl->glyph.xoffset+Ulen)+" "+FToStr(-y-hl->glyph.yoffset+Upos)+" l\n";
}
tmp2 += "S\n";
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp (revision 15288)
+++ scribus/pslib.cpp (revision 15289)
@@ -2847,7 +2847,7 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
{
SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
@@ -2856,12 +2856,12 @@
PS_setlinewidth(Uwid);
if (style.effects() & ScStyle_Subscript)
{
- PS_moveto(hl->glyph.xoffset-kern, Upos);
+ PS_moveto(hl->glyph.xoffset , Upos);
PS_lineto(hl->glyph.xoffset+Ulen, Upos);
}
else
{
- PS_moveto(hl->glyph.xoffset-kern, hl->glyph.yoffset+Upos);
+ PS_moveto(hl->glyph.xoffset , hl->glyph.yoffset+Upos);
PS_lineto(hl->glyph.xoffset+Ulen, hl->glyph.yoffset+Upos);
}
putColor(style.fillColor(), style.fillShade(), false);
@@ -2918,14 +2918,14 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
{
SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_setlinewidth(Uwid);
- PS_moveto(hl->glyph.xoffset-kern, Upos);
+ PS_moveto(hl->glyph.xoffset , Upos);
PS_lineto(hl->glyph.xoffset+Ulen, Upos);
putColor(style.fillColor(), style.fillShade(), false);
PS_restore();
@@ -2995,7 +2995,7 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
{
SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
@@ -3004,12 +3004,12 @@
PS_setlinewidth(Uwid);
if (style.effects() & ScStyle_Subscript)
{
- PS_moveto(hl->glyph.xoffset-kern, Upos);
+ PS_moveto(hl->glyph.xoffset , Upos);
PS_lineto(hl->glyph.xoffset+Ulen, Upos);
}
else
{
- PS_moveto(hl->glyph.xoffset-kern, hl->glyph.yoffset+Upos);
+ PS_moveto(hl->glyph.xoffset , hl->glyph.yoffset+Upos);
PS_lineto(hl->glyph.xoffset+Ulen, hl->glyph.yoffset+Upos);
}
putColor(style.fillColor(), style.fillShade(), false);
@@ -3072,7 +3072,7 @@
Uwid = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1.0);
}
if (style.baselineOffset() != 0)
- Upos += (style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0);
+ Upos += (style.fontSize() / 10.0) * hl->glyph.scaleV * (style.baselineOffset() / 1000.0);
if (style.fillColor() != CommonStrings::None)
if (style.fillColor() != CommonStrings::None)
{
@@ -3080,7 +3080,7 @@
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_setlinewidth(Uwid);
- PS_moveto(hl->glyph.xoffset-kern, Upos);
+ PS_moveto(hl->glyph.xoffset , Upos);
PS_lineto(hl->glyph.xoffset+Ulen, Upos);
putColor(style.fillColor(), style.fillShade(), false);
PS_restore();
@@ -3799,7 +3799,7 @@
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
}
if (cstyle.baselineOffset() != 0)
- Upos += (cstyle.fontSize() / 10.0) * (cstyle.baselineOffset() / 1000.0);
+ Upos += (cstyle.fontSize() / 10.0) * glyphs.scaleV * (cstyle.baselineOffset() / 1000.0);
if (cstyle.fillColor() != CommonStrings::None)
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
@@ -3810,12 +3810,12 @@
PS_setlinewidth(lw);
if (cstyle.effects() & ScStyle_Subscript)
{
- PS_moveto(x + glyphs.xoffset-kern, -y - glyphs.yoffset+Upos);
+ PS_moveto(x + glyphs.xoffset , -y - glyphs.yoffset+Upos);
PS_lineto(x + glyphs.xoffset+Ulen, -y - glyphs.yoffset+Upos);
}
else
{
- PS_moveto(x + glyphs.xoffset-kern, -y + Upos);
+ PS_moveto(x + glyphs.xoffset , -y + Upos);
PS_lineto(x + glyphs.xoffset+Ulen, -y + Upos);
}
putColor(cstyle.fillColor(), cstyle.fillShade(), false);
@@ -3932,7 +3932,7 @@
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1.0);
}
if (cstyle.baselineOffset() != 0)
- Upos += (cstyle.fontSize() / 10.0) * (cstyle.baselineOffset() / 1000.0);
+ Upos += (cstyle.fontSize() / 10.0) * glyphs.scaleV * (cstyle.baselineOffset() / 1000.0);
if (cstyle.fillColor() != CommonStrings::None)
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
@@ -3941,7 +3941,7 @@
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_setlinewidth(lw);
- PS_moveto(x + glyphs.xoffset-kern, -y-glyphs.yoffset+Upos);
+ PS_moveto(x + glyphs.xoffset , -y-glyphs.yoffset+Upos);
PS_lineto(x + glyphs.xoffset+Ulen, -y-glyphs.yoffset+Upos);
putColor(cstyle.fillColor(), cstyle.fillShade(), false);
}
More information about the scribus-commit
mailing list