40
41
#include "commonstrings.h"
41
42
#include "scconfig.h"
42
43
#include "pluginapi.h"
44
#include "multiprogressdialog.h"
45
#include "pageitem_latexframe.h"
43
46
#include "prefsmanager.h"
47
#include "scclocale.h"
48
#include "sccolorengine.h"
50
#include "scribusapp.h"
44
51
#include "scribusdoc.h"
45
52
#include "scribus.h"
46
53
#include "scribuscore.h"
48
54
#include "selection.h"
55
#include "scpattern.h"
56
#include "scstreamfilter_ascii85.h"
57
#include "scstreamfilter_flate.h"
51
60
#include "util_formats.h"
52
61
#include "util_math.h"
53
#include "multiprogressdialog.h"
54
#include "pageitem_latexframe.h"
55
#include "scribusapp.h"
56
#include "scpattern.h"
57
#include "sccolorengine.h"
58
#include "scstreamfilter_ascii85.h"
59
#include "scstreamfilter_flate.h"
61
63
#include "text/nlsconfig.h"
95
97
CMYKColor cmykValues;
96
98
ColorList::Iterator itf;
99
102
colorsToUse = DocColors;
102
105
for (itf = DocColors.begin(); itf != DocColors.end(); ++itf)
104
if (((DocColors[itf.key()].isSpotColor()) || (DocColors[itf.key()].isRegistrationColor())) && (useSpotColors))
107
if (((itf->isSpotColor()) || (itf->isRegistrationColor())) && (useSpotColors))
106
ScColorEngine::getCMYKValues(DocColors[itf.key()], DocColors.document(), cmykValues);
109
ScColorEngine::getCMYKValues(*itf, DocColors.document(), cmykValues);
107
110
cmykValues.getValues(c, m, y, k);
108
colorDesc += "/Spot"+PSEncode(itf.key())+" { [ /Separation (";
111
colorDesc += "/Spot"+QString::number(spotCount)+" { [ /Separation (";
109
112
if (DocColors[itf.key()].isRegistrationColor())
110
113
colorDesc += "All";
115
118
colorDesc += ToStr(static_cast<double>(m) / 255)+"\nmul exch dup ";
116
119
colorDesc += ToStr(static_cast<double>(y) / 255)+"\nmul exch ";
117
120
colorDesc += ToStr(static_cast<double>(k) / 255)+" mul }] setcolorspace setcolor} bind def\n";
118
spotMap.insert(itf.key(), "Spot"+PSEncode(itf.key()));
121
spotMap.insert(itf.key(), "Spot"+QString::number(spotCount));
120
124
if ((itf.key() != "Cyan") && (itf.key() != "Magenta") && (itf.key() != "Yellow") && (itf.key() != "Black") && DocColors[itf.key()].isSpotColor())
139
QMap<QString, QString> psNameMap;
135
140
QMap<QString, QMap<uint, FPointArray> >::Iterator it;
137
142
for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
139
/* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
140
ScFace::FontType type = AllFonts[it.key()].type();
144
// Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed
145
// Subset also font whose postscript name conflicts with an already used font
146
ScFace &face (AllFonts[it.key()]);
147
ScFace::FontType type = face.type();
148
QString encodedName = face.psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" );
142
if ((type == ScFace::TTF) || (AllFonts[it.key()].isOTF()) || (AllFonts[it.key()].subset()))
150
if ((type == ScFace::TTF) || (face.isOTF()) || (face.subset()) || psNameMap.contains(encodedName))
144
152
QMap<uint, FPointArray>& RealGlyphs(it.value());
145
FontDesc += "/"+AllFonts[it.key()].psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+
146
" "+IToStr(RealGlyphs.count()+1)+" dict def\n";
147
FontDesc += AllFonts[it.key()].psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+" begin\n";
153
// Handle possible PostScript name conflict in oft/ttf fonts
155
QString initialName = encodedName;
156
while (psNameMap.contains(encodedName))
158
encodedName = QString("%1-%2").arg(initialName).arg(psNameIndex);
161
FontDesc += "/" + encodedName + " " + IToStr(RealGlyphs.count()+1) + " dict def\n";
162
FontDesc += encodedName + " begin\n";
148
163
QMap<uint,FPointArray>::Iterator ig;
149
164
for (ig = RealGlyphs.begin(); ig != RealGlyphs.end(); ++ig)
178
193
FontDesc += "cl\n} bind def\n";
180
195
FontDesc += "end\n";
196
FontSubsetMap.insert(face.scName(), encodedName);
184
200
UsedFonts.insert(it.key(), "/Fo"+IToStr(a));
185
Fonts += "/Fo"+IToStr(a)+" /"+AllFonts[it.key()].psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+" findfont definefont pop\n";
201
Fonts += "/Fo" + IToStr(a) + " /" + encodedName + " findfont definefont pop\n";
186
202
if (AllFonts[it.key()].embedPs())
189
if(AllFonts[it.key()].EmbedFont(tmp))
205
if(face.EmbedFont(tmp))
191
FontDesc += "%%BeginFont: " + AllFonts[it.key()].psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ) + "\n";
207
FontDesc += "%%BeginFont: " + encodedName + "\n";
192
208
FontDesc += tmp + "\n%%EndFont\n";
196
AllFonts[it.key()].glyphNames(gl);
197
213
GlyphsOfFont.insert(it.key(), gl);
216
psNameMap.insert(encodedName, face.scName());
201
218
Prolog = "%%BeginProlog\n";
202
219
Prolog += "/Scribusdict 100 dict def\n";
252
269
void PSLib::PutStream(const QString& c)
254
spoolStream.writeRawData(c.toUtf8().data(), c.length());
271
QByteArray utf8Array = c.toUtf8();
272
spoolStream.writeRawData(utf8Array.data(), utf8Array.length());
257
275
void PSLib::PutStream(const QByteArray& array, bool hexEnc)
452
PutStream("/Pattern"+patterns[c]+" 8 dict def\n");
453
PutStream("Pattern"+patterns[c]+" begin\n");
472
uint patHash = qHash(patterns[c]);
473
PutStream("/Pattern"+QString::number(patHash)+" 8 dict def\n");
474
PutStream("Pattern"+QString::number(patHash)+" begin\n");
454
475
PutStream("/PatternType 1 def\n");
455
476
PutStream("/PaintType 1 def\n");
456
477
PutStream("/TilingType 1 def\n");
588
610
double markOffs = 0.0;
589
611
if ((Options.cropMarks) || (Options.bleedMarks) || (Options.registrationMarks) || (Options.colorMarks))
590
612
markOffs = 20.0 + Options.markOffset;
591
if (m_Doc->pageSets[m_Doc->currentPageLayout].Columns == 1)
593
bleedRight = Options.bleeds.Right;
594
bleedLeft = Options.bleeds.Left;
598
if (m_Doc->locationOfPage(pg->pageNr()) == LeftPage)
600
bleedRight = Options.bleeds.Right;
601
bleedLeft = Options.bleeds.Left;
603
else if (m_Doc->locationOfPage(pg->pageNr()) == RightPage)
605
bleedRight = Options.bleeds.Left;
606
bleedLeft = Options.bleeds.Right;
610
bleedRight = Options.bleeds.Left;
611
bleedLeft = Options.bleeds.Left;
613
GetBleeds(pg, bleedLeft, bleedRight);
614
614
double maxBoxX = pg->width()+bleedLeft+bleedRight+markOffs*2.0;
615
615
double maxBoxY = pg->height()+Options.bleeds.Bottom+Options.bleeds.Top+markOffs*2.0;
634
634
PutStream("%%PageBoundingBox: 0 0 "+IToStr(qRound(maxBoxX))+" "+IToStr(qRound(maxBoxY))+"\n");
635
635
PutStream("%%PageCropBox: "+ToStr(bleedLeft+markOffs)+" "+ToStr(Options.bleeds.Bottom+markOffs)+" "+ToStr(maxBoxX-bleedRight-markOffs*2.0)+" "+ToStr(maxBoxY-Options.bleeds.Top-markOffs*2.0)+"\n");
636
636
PutStream("Scribusdict begin\n");
638
PutStream("/DeviceCMYK setcolorspace\n");
639
637
if ((Art) && (Options.setDevParam))
641
639
PutStream("<< /PageSize [ "+ToStr(maxBoxX)+" "+ToStr(maxBoxY)+" ]\n");
642
640
PutStream(">> setpagedevice\n");
643
PutStream("/DeviceCMYK setcolorspace\n");
644
644
PutStream(ToStr(bleedLeft+markOffs)+" "+ToStr(Options.bleeds.Bottom+markOffs)+" tr\n");
659
659
double markOffs = 0.0;
660
660
if ((Options.cropMarks) || (Options.bleedMarks) || (Options.registrationMarks) || (Options.colorMarks))
661
661
markOffs = 20.0 + Options.markOffset;
664
if (m_Doc->pageSets[m_Doc->currentPageLayout].Columns == 1)
666
bleedRight = Options.bleeds.Right;
667
bleedLeft = Options.bleeds.Left;
671
if (m_Doc->locationOfPage(ActPage->pageNr()) == LeftPage)
673
bleedRight = Options.bleeds.Right;
674
bleedLeft = Options.bleeds.Left;
676
else if (m_Doc->locationOfPage(ActPage->pageNr()) == RightPage)
678
bleedRight = Options.bleeds.Left;
679
bleedLeft = Options.bleeds.Right;
683
bleedRight = Options.bleeds.Left;
684
bleedLeft = Options.bleeds.Left;
662
double bleedRight, bleedLeft;
663
GetBleeds(ActPage, bleedLeft, bleedRight);
687
664
double maxBoxX = ActPage->width()+bleedLeft+bleedRight+markOffs*2.0;
688
665
double maxBoxY = ActPage->height()+Options.bleeds.Bottom+Options.bleeds.Top+markOffs*2.0;
689
666
if ((Options.cropMarks) || (Options.bleedMarks) || (Options.registrationMarks) || (Options.colorMarks))
1154
1131
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
1155
1132
QStringList cols1 = Colors[c+1].split(" ", QString::SkipEmptyParts);
1156
1133
QStringList cols2 = Colors[c].split(" ", QString::SkipEmptyParts);
1157
PutStream("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
1158
PutStream("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
1134
PutStream("/C1 ["+ToStr(1 - ScCLocale::toDoubleC(cols1[pla]))+"]\n");
1135
PutStream("/C0 ["+ToStr(1 - ScCLocale::toDoubleC(cols2[pla]))+"]\n");
1336
1313
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
1337
1314
QStringList cols1 = Colors[c].split(" ", QString::SkipEmptyParts);
1338
1315
QStringList cols2 = Colors[c+1].split(" ", QString::SkipEmptyParts);
1339
PutStream("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
1340
PutStream("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
1316
PutStream("/C1 ["+ToStr(1 - ScCLocale::toDoubleC(cols1[pla]))+"]\n");
1317
PutStream("/C0 ["+ToStr(1 - ScCLocale::toDoubleC(cols2[pla]))+"]\n");
1822
1799
if ((Doc->HasCMS) && (ScCore->haveCMS()) && (applyICC))
1823
solidTransform = cmsCreateTransform(Doc->DocInputCMYKProf, TYPE_CMYK_16, Doc->DocPrinterProf, TYPE_CMYK_16, Doc->IntentColors, 0);
1800
solidTransform = scCmsCreateTransform(Doc->DocInputCMYKProf, TYPE_CMYK_16, Doc->DocPrinterProf, TYPE_CMYK_16, Doc->IntentColors, 0);
1825
1802
applyICC = false;
1934
1911
ScQApp->processEvents();
1935
1912
if ((it->LayerNr != ll.LNr) || (!it->printEnabled()))
1937
/* int x = static_cast<int>(Doc->MasterPages.at(ap)->xOffset());
1938
int y = static_cast<int>(Doc->MasterPages.at(ap)->yOffset());
1939
int w = static_cast<int>(Doc->MasterPages.at(ap)->width());
1940
int h = static_cast<int>(Doc->MasterPages.at(ap)->height());
1941
double ilw=it->lineWidth();
1942
int x2 = static_cast<int>(it->BoundingX - ilw / 2.0);
1943
int y2 = static_cast<int>(it->BoundingY - ilw / 2.0);
1944
int w2 = static_cast<int>(it->BoundingW + ilw);
1945
int h2 = static_cast<int>(it->BoundingH + ilw);
1946
if (!QRect(x, y, w, h).intersects(QRect(x2, y2, w2, h2)))
1948
double x = Doc->MasterPages.at(ap)->xOffset();
1949
double y = Doc->MasterPages.at(ap)->yOffset();
1950
double w = Doc->MasterPages.at(ap)->width();
1951
double h1 = Doc->MasterPages.at(ap)->height();
1914
double bLeft, bRight, bBottom, bTop;
1915
GetBleeds(Doc->MasterPages.at(ap), bLeft, bRight, bBottom, bTop);
1916
double x = Doc->MasterPages.at(ap)->xOffset() - bLeft;
1917
double y = Doc->MasterPages.at(ap)->yOffset() - bTop;
1918
double w = Doc->MasterPages.at(ap)->width() + bLeft + bRight;
1919
double h1 = Doc->MasterPages.at(ap)->height()+ bBottom + bTop;
1952
1920
double ilw = it->lineWidth();
1953
1921
double x2 = it->BoundingX - ilw / 2.0;
1954
1922
double y2 = it->BoundingY - ilw / 2.0;
1963
1931
errorOccured = !PS_ImageData(it, it->Pfile, it->itemName(), it->IProfile, it->UseEmbedded, Ic);
1964
1932
if (errorOccured) break;
1966
PS_TemplateStart(Doc->MasterPages.at(ap)->pageName() + tmps.setNum(it->ItemNr));
1934
PS_TemplateStart(QString("mp_obj_%1_%2").arg(ap).arg(it->ItemNr));
1967
1935
ProcessItem(Doc, Doc->MasterPages.at(ap), it, ap+1, sep, farb, Ic, gcr, true);
1968
1936
PS_TemplateEnd();
2477
2448
if (c->startArrowIndex() != 0)
2479
2450
QMatrix arrowTrans;
2480
FPointArray arrow = Doc->arrowStyles.at(c->startArrowIndex()-1).points.copy();
2481
arrowTrans.translate(0, 0);
2482
if (c->lineWidth() != 0.0)
2483
arrowTrans.scale(c->lineWidth(), c->lineWidth());
2484
2451
arrowTrans.scale(-1,1);
2485
arrow.map(arrowTrans);
2486
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k, gcr);
2487
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2489
SetClipPath(&arrow);
2491
putColor(c->lineColor(), c->lineShade(), true);
2452
drawArrow(c, arrowTrans, c->startArrowIndex(), gcr);
2493
2454
if (c->endArrowIndex() != 0)
2495
2456
QMatrix arrowTrans;
2496
FPointArray arrow = Doc->arrowStyles.at(c->endArrowIndex()-1).points.copy();
2497
2457
arrowTrans.translate(c->width(), 0);
2498
if (c->lineWidth() != 0.0)
2499
arrowTrans.scale(c->lineWidth(), c->lineWidth());
2500
arrow.map(arrowTrans);
2501
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k, gcr);
2502
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2504
SetClipPath(&arrow);
2506
putColor(c->lineColor(), c->lineShade(), true);
2458
drawArrow(c, arrowTrans, c->endArrowIndex(), gcr);
2509
2461
/* OBSOLETE CR 2005-02-06
2604
2556
double r = atan2(Start.y()-Vector.y(),Start.x()-Vector.x())*(180.0/M_PI);
2605
2557
QMatrix arrowTrans;
2606
FPointArray arrow = Doc->arrowStyles.at(c->startArrowIndex()-1).points.copy();
2607
2558
arrowTrans.translate(Start.x(), Start.y());
2608
2559
arrowTrans.rotate(r);
2609
if (c->lineWidth() != 0.0)
2610
arrowTrans.scale(c->lineWidth(), c->lineWidth());
2611
arrow.map(arrowTrans);
2612
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k, gcr);
2613
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2615
SetClipPath(&arrow);
2617
putColor(c->lineColor(), c->lineShade(), true);
2560
drawArrow(c, arrowTrans, c->startArrowIndex(), gcr);
2630
2573
double r = atan2(End.y()-Vector.y(),End.x()-Vector.x())*(180.0/M_PI);
2631
2574
QMatrix arrowTrans;
2632
FPointArray arrow = Doc->arrowStyles.at(c->endArrowIndex()-1).points.copy();
2633
2575
arrowTrans.translate(End.x(), End.y());
2634
2576
arrowTrans.rotate(r);
2635
if (c->lineWidth() != 0.0)
2636
arrowTrans.scale(c->lineWidth(), c->lineWidth());
2637
arrow.map(arrowTrans);
2638
SetColor(c->lineColor(), c->lineShade(), &h, &s, &v, &k, gcr);
2639
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
2641
SetClipPath(&arrow);
2643
putColor(c->lineColor(), c->lineShade(), true);
2577
drawArrow(c, arrowTrans, c->endArrowIndex(), gcr);
2901
2834
PutStream(ToStr(style.strokeShade() / 100.0)+" "+spotMap[style.strokeColor()]);
2903
2836
PutStream(FillColor + " cmyk");
2904
PS_showSub(chr, style.font().psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
2837
PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, false);
2907
2840
SetColor(style.fillColor(), style.fillShade(), &h, &s, &v, &k, gcr);
2910
2843
PutStream(ToStr(style.fillShade() / 100.0)+" "+spotMap[style.fillColor()]);
2912
2845
PutStream(FillColor + " cmyk");
2913
PS_showSub(chr, style.font().psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
2846
PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, false);
2914
2847
if ((style.effects() & ScStyle_Outline))
2916
2849
if ((style.strokeColor() != CommonStrings::None) && ((tsz * style.outlineWidth() / 10000.0) != 0))
2923
2856
PutStream(ToStr(style.strokeShade() / 100.0)+" "+spotMap[style.strokeColor()]);
2925
2858
PutStream(StrokeColor + " cmyk");
2926
PS_showSub(chr, style.font().psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, true);
2859
PS_showSub(chr, FontSubsetMap[style.font().scName()], tsz / 10.0, true);
3184
3117
//if ((!Art) && (view->SelItem.count() != 0) && (!c->Select))
3185
3118
if ((!Art) && (!c->isSelected()) && (Doc->m_Selection->count() != 0))
3187
double x = a->xOffset();
3188
double y = a->yOffset();
3189
double w = a->width();
3190
double h1 = a->height();
3120
double bLeft, bRight, bBottom, bTop;
3121
GetBleeds(a, bLeft, bRight, bBottom, bTop);
3122
double x = a->xOffset() - bLeft;
3123
double y = a->yOffset() - bTop;
3124
double w = a->width() + bLeft + bRight;
3125
double h1 = a->height() + bBottom + bTop;
3191
3126
double ilw = c->lineWidth();
3192
3127
double x2 = c->BoundingX - ilw / 2.0;
3193
3128
double y2 = c->BoundingY - ilw / 2.0;
3238
3173
if ((!a->pageName().isEmpty()) && (c->asImageFrame()) && ((sep) || (!farb)))
3240
double x = a->xOffset();
3241
double y = a->yOffset();
3242
double w = a->width();
3243
double h1 = a->height();
3175
double bLeft, bRight, bBottom, bTop;
3176
GetBleeds(a, bLeft, bRight, bBottom, bTop);
3177
double x = a->xOffset() - bLeft;
3178
double y = a->yOffset() - bTop;
3179
double w = a->width() + bLeft + bRight;
3180
double h1 = a->height() + bBottom + bTop;
3244
3181
double ilw=c->lineWidth();
3245
3182
double x2 = c->BoundingX - ilw / 2.0;
3246
3183
double y2 = c->BoundingY - ilw / 2.0;
3373
3310
pat = &m_Doc->docPatterns[c->pattern()];
3311
uint patHash = qHash(c->pattern());
3374
3312
c->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
3375
3313
patternMatrix.translate(patternOffsetX, -patternOffsetY);
3376
3314
patternMatrix.rotate(-patternRotation);
3377
3315
patternMatrix.scale(pat->scaleX, pat->scaleY);
3378
3316
patternMatrix.scale(patternScaleX / 100.0 , patternScaleY / 100.0);
3379
PutStream("Pattern"+c->pattern()+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
3317
PutStream("Pattern"+QString::number(patHash)+" ["+ToStr(patternMatrix.m11())+" "+ToStr(patternMatrix.m12())+" "+ToStr(patternMatrix.m21())+" "+ToStr(patternMatrix.m22())+" "+ToStr(patternMatrix.dx())+" "+ToStr(patternMatrix.dy())+"] makepattern setpattern\n");
3381
3319
PutStream("eofill\n");
3386
void PSLib::drawArrow(PageItem *ite, QMatrix &arrowTrans, int arrowIndex, bool gcr)
3389
QVector<double> dum;
3390
FPointArray arrow = m_Doc->arrowStyles.at(arrowIndex-1).points.copy();
3391
if (ite->NamedLStyle.isEmpty())
3393
if (ite->lineWidth() != 0.0)
3394
arrowTrans.scale(ite->lineWidth(), ite->lineWidth());
3398
multiLine ml = m_Doc->MLineStyles[ite->NamedLStyle];
3399
if (ml[ml.size()-1].Width != 0.0)
3400
arrowTrans.scale(ml[ml.size()-1].Width, ml[ml.size()-1].Width);
3402
arrow.map(arrowTrans);
3403
if (ite->NamedLStyle.isEmpty())
3405
if (ite->lineColor() != CommonStrings::None)
3407
SetColor(ite->lineColor(), ite->lineShade(), &h, &s, &v, &k, gcr);
3408
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
3410
SetClipPath(&arrow);
3412
putColor(ite->lineColor(), ite->lineShade(), true);
3417
multiLine ml = m_Doc->MLineStyles[ite->NamedLStyle];
3418
if (ml[0].Color != CommonStrings::None)
3420
SetColor(ml[0].Color, ml[0].Shade, &h, &s, &v, &k, gcr);
3421
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
3423
SetClipPath(&arrow);
3425
putColor(ite->lineColor(), ite->lineShade(), true);
3427
for (int it = ml.size()-1; it > 0; it--)
3429
if (ml[it].Color != CommonStrings::None)
3431
SetColor(ml[it].Color, ml[it].Shade, &h, &s, &v, &k, gcr);
3432
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
3433
PS_setlinewidth(ml[it].Width);
3434
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
3435
PS_setdash(Qt::SolidLine, 0, dum);
3436
SetClipPath(&arrow);
3438
putColor(ml[it].Color, ml[it].Shade, false);
3448
3444
void PSLib::SetColor(const QString& farb, double shade, int *h, int *s, int *v, int *k, bool gcr)
3450
3446
ScColor& col = m_Doc->PageColors[farb];
3528
3525
if ((hl->ch == SpecialChars::TAB) && (tTabValues.count() != 0))
3530
3527
QChar tabFillChar;
3531
double tCurX = CurX - colLeft + 1;
3532
for (int yg = static_cast<int>(tTabValues.count()-1); yg > -1; yg--)
3534
if (tCurX < tTabValues[yg].tabPosition)
3535
tabFillChar = tTabValues[yg].tabFillChar;
3528
const TabLayout* tabLayout = dynamic_cast<const TabLayout*>(hl->glyph.more);
3530
tabFillChar = tabLayout->fillChar;
3537
3531
if (!tabFillChar.isNull())
3761
3755
PutStream(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
3763
3757
PutStream(FillColor + " cmyk");
3764
PS_showSub(chr, hl->font().psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
3758
PS_showSub(chr, FontSubsetMap[hl->font().scName()], tsz / 10.0, false);
4155
4149
putColor(cstyle.fillColor(), cstyle.fillShade(), false);
4157
4151
/* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
4158
ScFace::FontType ftype = cstyle.font().type();
4159
if ((ftype == ScFace::TTF) || (cstyle.font().isOTF()) || (cstyle.font().subset()))
4152
if (FontSubsetMap.contains(cstyle.font().scName()))
4161
4154
if (glyph != 0 && glyph != cstyle.font().char2CMap(QChar(' ')) && (!SpecialChars::isBreak(chstr)))
4186
4179
PutStream(ToStr(cstyle.fillShade() / 100.0)+" "+spotMap[cstyle.fillColor()]);
4188
4181
PutStream(FillColor + " cmyk");
4189
PS_showSub(glyph, cstyle.font().psName().simplified().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
4182
PS_showSub(glyph, FontSubsetMap[cstyle.font().scName()], tsz / 10.0, false);
4384
void PSLib::GetBleeds(Page* page, double& left, double& right)
4386
MarginStruct values;
4387
m_Doc->getBleeds(page, Options.bleeds, values);
4389
right = values.Right;
4392
void PSLib::GetBleeds(Page* page, double& left, double& right, double& bottom, double& top)
4394
MarginStruct values;
4395
m_Doc->getBleeds(page, Options.bleeds, values);
4397
right = values.Right;
4398
bottom = values.Bottom;
4391
4402
void PSLib::SetClipPath(FPointArray *c, bool poly)
4393
4404
FPoint np, np1, np2, np3;