r15290 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:47 CEST 2010
Revision: 15290
Author: jghali
Date: 2010-06-29T23:29:52.310753Z
Commit message: #9221: underlined text's line cut in parts (in PS/PDF) when manual tracking has negative value
Changeset:
M /trunk/Scribus/scribus/pdflib_core.cpp
M /trunk/Scribus/scribus/pslib.cpp
Diffs:
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp (revision 15289)
+++ scribus/pdflib_core.cpp (revision 15290)
@@ -5300,7 +5300,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";
@@ -5308,12 +5308,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";
}
}
@@ -5321,12 +5321,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) +" "+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";
}
}
@@ -5595,18 +5595,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 15289)
+++ scribus/pslib.cpp (revision 15290)
@@ -2399,7 +2399,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);
@@ -2408,12 +2408,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);
@@ -2470,14 +2470,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();
@@ -2547,7 +2547,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);
@@ -2556,12 +2556,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);
@@ -2624,7 +2624,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)
{
@@ -2632,7 +2632,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();
@@ -4528,7 +4528,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);
@@ -4539,12 +4539,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);
@@ -4661,7 +4661,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);
@@ -4670,7 +4670,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