/branches/Version13x/Scribus/scribus/tabtypography.h |
---|
31,6 → 31,11 |
QGroupBox* groupBox3a; |
QLabel* textLabel5a; |
QSpinBox* capsScaling; |
QGroupBox* underlineGroup; |
QLabel* textLabel1; |
QSpinBox* underlinePos; |
QLabel* textLabel2; |
QSpinBox* underlineWidth; |
QGroupBox* groupBox4a; |
QLabel* textLabel8a; |
QSpinBox* autoLine; |
41,6 → 46,7 |
QGridLayout* groupBox2aLayout; |
QGridLayout* groupBox3aLayout; |
QGridLayout* groupBox4aLayout; |
QGridLayout* underlineGroupLayout; |
}; |
#endif |
/branches/Version13x/Scribus/scribus/pageitem.cpp |
---|
679,7 → 679,10 |
Zli3.Style = hl->cstyle; |
Zli3.ZFo = hl->cfont; |
Zli3.wide = Cwidth(Doc, hl->cfont, chx, hl->csize); |
Zli3.kern = hl->cextra; |
if (hl->cstyle & 1024) |
Zli3.kern = 0; |
else |
Zli3.kern = hl->cextra; |
Zli3.scale = hl->cscale; |
if (!Doc->RePos) |
{ |
1199,9 → 1202,15 |
} |
hl->yp = CurY + oldCurY; |
if (LiList.count() == 0) |
{ |
itemText.at(a)->cstyle |= 1024; |
kernVal = 0; |
} |
else |
{ |
kernVal = hl->cextra; |
itemText.at(a)->cstyle &= 1023; |
} |
if (!RTab) |
{ |
hl->xp = CurX+kernVal; |
2402,9 → 2411,25 |
} |
if (hl->Style & 8) |
{ |
double st = hl->ZFo->underline_pos * (hl->Siz / 10.0); |
double st, lw; |
if ((Doc->typographicSetttings.valueUnderlinePos != -1) || (Doc->typographicSetttings.valueUnderlineWidth != -1)) |
{ |
if (Doc->typographicSetttings.valueUnderlinePos != -1) |
st = (Doc->typographicSetttings.valueUnderlinePos / 100.0) * (hl->ZFo->numDescender * (hl->Siz / 10.0)); |
else |
st = hl->ZFo->underline_pos * (hl->Siz / 10.0); |
if (Doc->typographicSetttings.valueUnderlineWidth != -1) |
lw = (Doc->typographicSetttings.valueUnderlineWidth / 100.0) * (hl->Siz / 10.0); |
else |
lw = QMAX(hl->ZFo->strokeWidth * (hl->Siz / 10.0), 1); |
} |
else |
{ |
st = hl->ZFo->underline_pos * (hl->Siz / 10.0); |
lw = QMAX(hl->ZFo->strokeWidth * (hl->Siz / 10.0), 1); |
} |
p->setPen(p->brush()); |
p->setLineWidth(QMAX(hl->ZFo->strokeWidth * (hl->Siz / 10.0), 1)); |
p->setLineWidth(lw); |
p->drawLine(FPoint(hl->xco-hl->kern, hl->yco-st), FPoint(hl->xco+hl->wide, hl->yco-st)); |
} |
} |
/branches/Version13x/Scribus/scribus/tabtypography.cpp |
---|
20,7 → 20,6 |
groupBox1aLayout->setAlignment( Qt::AlignTop ); |
subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" ); |
subDisplacement->setMaxValue( 100 ); |
subDisplacement->setValue( prefsData->valueSubScript ); |
subDisplacement->setSuffix( tr( " %" ) ); |
groupBox1aLayout->addWidget( subDisplacement, 0, 1, Qt::AlignLeft ); |
textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" ); |
28,7 → 27,6 |
subScaling = new QSpinBox( groupBox1a, "subScaling" ); |
subScaling->setMaxValue( 100 ); |
subScaling->setMinValue( 1 ); |
subScaling->setValue( prefsData->scalingSubScript ); |
subScaling->setSuffix( tr( " %" ) ); |
groupBox1aLayout->addWidget( subScaling, 0, 3, Qt::AlignLeft ); |
textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" ); |
43,7 → 41,6 |
groupBox2aLayout->setAlignment( Qt::AlignTop ); |
superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" ); |
superDisplacement->setMaxValue( 100 ); |
superDisplacement->setValue( prefsData->valueSuperScript ); |
superDisplacement->setSuffix( tr( " %" ) ); |
groupBox2aLayout->addWidget( superDisplacement, 0, 1, Qt::AlignLeft ); |
textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" ); |
51,7 → 48,6 |
superScaling = new QSpinBox( groupBox2a, "superScaling" ); |
superScaling->setMaxValue( 100 ); |
superScaling->setMinValue( 1 ); |
superScaling->setValue( prefsData->scalingSuperScript ); |
superScaling->setSuffix( tr( " %" ) ); |
groupBox2aLayout->addWidget( superScaling, 0, 3, Qt::AlignLeft ); |
textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" ); |
67,13 → 63,43 |
capsScaling = new QSpinBox( groupBox3a, "capsScaling" ); |
capsScaling->setMaxValue( 100 ); |
capsScaling->setMinValue( 1 ); |
capsScaling->setValue( prefsData->valueSmallCaps ); |
capsScaling->setSuffix( tr( " %" ) ); |
groupBox3aLayout->addWidget( capsScaling, 0, 1, Qt::AlignLeft ); |
textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" ); |
groupBox3aLayout->addWidget( textLabel5a, 0, 0 ); |
tabTypoLayout->addWidget( groupBox3a, 2, 0 ); |
underlineGroup = new QGroupBox( this, "underlineGroup" ); |
underlineGroup->setTitle( tr( "Underline" ) ); |
underlineGroup->setColumnLayout(0, Qt::Vertical ); |
underlineGroup->layout()->setSpacing( 6 ); |
underlineGroup->layout()->setMargin( 11 ); |
underlineGroupLayout = new QGridLayout( underlineGroup->layout() ); |
underlineGroupLayout->setAlignment( Qt::AlignTop ); |
textLabel1 = new QLabel( underlineGroup, "textLabel1" ); |
textLabel1->setText( tr( "Displacement:" ) ); |
underlineGroupLayout->addWidget( textLabel1, 0, 0 ); |
underlinePos = new QSpinBox( underlineGroup, "underlinePos" ); |
underlinePos->setMaxValue( 100 ); |
underlinePos->setMinValue( -1 ); |
underlinePos->setSuffix( tr( " %" ) ); |
underlinePos->setSpecialValueText( tr( "Auto" ) ); |
underlineGroupLayout->addWidget( underlinePos, 0, 1 ); |
textLabel2 = new QLabel( underlineGroup, "textLabel2" ); |
textLabel2->setText( tr( "Line Width:" ) ); |
underlineGroupLayout->addWidget( textLabel2, 0, 2 ); |
underlineWidth = new QSpinBox( underlineGroup, "underlineWidth" ); |
underlineWidth->setMaxValue( 100 ); |
underlineWidth->setMinValue( -1 ); |
underlineWidth->setSuffix( tr( " %" ) ); |
underlineWidth->setSpecialValueText( tr( "Auto" ) ); |
underlineGroupLayout->addWidget( underlineWidth, 0, 3 ); |
tabTypoLayout->addWidget( underlineGroup, 3, 0 ); |
groupBox4a = new QGroupBox( this, "groupBox3a" ); |
groupBox4a->setColumnLayout(0, Qt::Vertical ); |
groupBox4a->layout()->setSpacing( 6 ); |
84,13 → 110,12 |
autoLine = new QSpinBox( groupBox4a, "autoLine" ); |
autoLine->setMaxValue( 100 ); |
autoLine->setMinValue( 1 ); |
autoLine->setValue( prefsData->autoLineSpacing ); |
autoLine->setSuffix( tr( " %" ) ); |
groupBox4aLayout->addWidget( autoLine, 1, 1 ); |
textLabel8a = new QLabel( autoLine, tr( "Line Spacing:" ), groupBox4a, "textLabel8a" ); |
groupBox4aLayout->addWidget( textLabel8a, 1, 0 ); |
tabTypoLayout->addWidget( groupBox4a, 3, 0 ); |
tabTypoLayout->addWidget( groupBox4a, 4, 0 ); |
restoreDefaults(prefsData); |
QToolTip::add( superDisplacement, tr( "Displacement above the baseline of the font on a line" ) ); |
QToolTip::add( superScaling, tr( "Relative size of the superscript compared to the normal font" ) ); |
QToolTip::add( subDisplacement, tr( "Displacement below the baseline of the normal font on a line" ) ); |
97,6 → 122,8 |
QToolTip::add( subScaling, tr( "Relative size of the subscript compared to the normal font" ) ); |
QToolTip::add( capsScaling, tr( "Relative size of the small caps font compared to the normal font" ) ); |
QToolTip::add( autoLine, tr( "Percentage increase over the font size for the line spacing" ) ); |
QToolTip::add( underlinePos, tr( "Displacement below the baseline of the normal font expressed as a percentage of the fonts descender" ) ); |
QToolTip::add( underlineWidth, tr( "Line width expressed as a percentage of the font size" ) ); |
} |
void TabTypograpy::restoreDefaults(struct typoPrefs *prefsData) |
106,4 → 133,6 |
superScaling->setValue( prefsData->scalingSuperScript ); |
subScaling->setValue( prefsData->scalingSubScript ); |
autoLine->setValue( prefsData->autoLineSpacing ); |
underlinePos->setValue(prefsData->valueUnderlinePos); |
underlineWidth->setValue(prefsData->valueUnderlineWidth); |
} |
/branches/Version13x/Scribus/scribus/libpostscript/pslib.cpp |
---|
1154,22 → 1154,6 |
} |
else if (ite->itemType() == PageItem::TextFrame) |
{ |
/* double savScale = view->Scale; |
view->Scale = 1.0; |
Doc->RePos = true; |
QPixmap pgPix(10, 10); |
QRect rd = QRect(0,0,9,9); |
ScPainter *painter = new ScPainter(&pgPix, pgPix.width(), pgPix.height()); |
Doc->Pages = Doc->MasterPages; |
Doc->MasterP = true; |
Doc->Items = Doc->MasterItems; |
ite->DrawObj(painter, rd); |
Doc->Pages = Doc->DocPages; |
Doc->MasterP = false; |
Doc->Items = Doc->DocItems; |
Doc->RePos = false; |
view->Scale = savScale; |
delete painter; */ |
PS_save(); |
if (ite->fillColor() != "None") |
{ |
1387,7 → 1371,27 |
if ((hl->cstyle & 8) && (chx != QChar(13))) |
{ |
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos = hl->cfont->underline_pos * (tsz / 10.0); |
double Upos, lw, kern; |
if (hl->cstyle & 1024) |
kern = 0; |
else |
kern = hl->cextra; |
if ((Doc->typographicSetttings.valueUnderlinePos != -1) || (Doc->typographicSetttings.valueUnderlineWidth != -1)) |
{ |
if (Doc->typographicSetttings.valueUnderlinePos != -1) |
Upos = (Doc->typographicSetttings.valueUnderlinePos / 100.0) * (hl->cfont->numDescender * (tsz / 10.0)); |
else |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
if (Doc->typographicSetttings.valueUnderlineWidth != -1) |
lw = (Doc->typographicSetttings.valueUnderlineWidth / 100.0) * (tsz / 10.0); |
else |
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
else |
{ |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
if (hl->ccolor != "None") |
{ |
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin); |
1395,8 → 1399,8 |
SetFarbe(Doc, hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr); |
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0); |
} |
PS_setlinewidth(hl->cfont->strokeWidth * (tsz / 10.0)); |
PS_moveto(hl->xp, -hl->yp+Upos); |
PS_setlinewidth(lw); |
PS_moveto(hl->xp-kern, -hl->yp+Upos); |
PS_lineto(hl->xp+Ulen, -hl->yp+Upos); |
PS_stroke(); |
} |
1873,7 → 1877,27 |
if ((hl->cstyle & 8) && (chx != QChar(13))) |
{ |
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos = hl->cfont->underline_pos * (tsz / 10.0); |
double Upos, lw, kern; |
if (hl->cstyle & 1024) |
kern = 0; |
else |
kern = hl->cextra; |
if ((Doc->typographicSetttings.valueUnderlinePos != -1) || (Doc->typographicSetttings.valueUnderlineWidth != -1)) |
{ |
if (Doc->typographicSetttings.valueUnderlinePos != -1) |
Upos = (Doc->typographicSetttings.valueUnderlinePos / 100.0) * (hl->cfont->numDescender * (tsz / 10.0)); |
else |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
if (Doc->typographicSetttings.valueUnderlineWidth != -1) |
lw = (Doc->typographicSetttings.valueUnderlineWidth / 100.0) * (tsz / 10.0); |
else |
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
else |
{ |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
if (hl->ccolor != "None") |
{ |
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin); |
1881,8 → 1905,8 |
SetFarbe(Doc, hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr); |
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0); |
} |
PS_setlinewidth(hl->cfont->strokeWidth * (tsz / 10.0)); |
PS_moveto(hl->xp, -hl->yp+Upos); |
PS_setlinewidth(lw); |
PS_moveto(hl->xp-kern, -hl->yp+Upos); |
PS_lineto(hl->xp+Ulen, -hl->yp+Upos); |
PS_stroke(); |
} |
/branches/Version13x/Scribus/scribus/scribus.cpp |
---|
2968,6 → 2968,8 |
doc->typographicSetttings.autoLineSpacing = dia->tabTypo->autoLine->value(); |
doc->typographicSetttings.valueBaseGrid = dia->tabGuides->baseGrid->value() / doc->unitRatio; |
doc->typographicSetttings.offsetBaseGrid = dia->tabGuides->baseOffset->value() / doc->unitRatio; |
doc->typographicSetttings.valueUnderlinePos = dia->tabTypo->underlinePos->value(); |
doc->typographicSetttings.valueUnderlineWidth = dia->tabTypo->underlineWidth->value(); |
doc->toolSettings.defFont = dia->tabTools->fontComboText->currentText(); |
doc->toolSettings.defSize = dia->tabTools->sizeComboText->currentText().left(2).toInt() * 10; |
doc->toolSettings.dStrokeText = dia->tabTools->colorComboStrokeText->currentText(); |
7771,6 → 7773,8 |
Prefs.typographicSetttings.autoLineSpacing = dia->tabTypo->autoLine->value(); |
Prefs.typographicSetttings.valueBaseGrid = dia->tabGuides->baseGrid->value() / UmReFaktor; |
Prefs.typographicSetttings.offsetBaseGrid = dia->tabGuides->baseOffset->value() / UmReFaktor; |
Prefs.typographicSetttings.valueUnderlinePos = dia->tabTypo->underlinePos->value(); |
Prefs.typographicSetttings.valueUnderlineWidth = dia->tabTypo->underlineWidth->value(); |
Prefs.toolSettings.dPen = dia->tabTools->colorComboLineShape->currentText(); |
if (Prefs.toolSettings.dPen == tr("None")) |
Prefs.toolSettings.dPen = "None"; |
/branches/Version13x/Scribus/scribus/libpdf/pdflib.cpp |
---|
2815,31 → 2815,50 |
tmp += "<"+QString(toHex(idx2))+"> Tj\n"; |
} |
} |
if ((hl->cstyle & 8) && (chx != QChar(13))) |
} |
if ((hl->cstyle & 8) && (chx != QChar(13))) |
{ |
double Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos, Uwid, kern; |
if (hl->cstyle & 1024) |
kern = 0; |
else |
kern = hl->cextra; |
if ((doc->typographicSetttings.valueUnderlinePos != -1) || (doc->typographicSetttings.valueUnderlineWidth != -1)) |
{ |
double Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos = hl->cfont->underline_pos * (tsz / 10.0); |
double Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
if (hl->ccolor != "None") |
tmp2 += putColor(hl->cstroke, hl->cshade, false); |
tmp2 += FToStr(Uwid)+" w\n"; |
tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n"; |
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n"; |
tmp2 += "S\n"; |
if (doc->typographicSetttings.valueUnderlinePos != -1) |
Upos = (doc->typographicSetttings.valueUnderlinePos / 100.0) * (hl->cfont->numDescender * (tsz / 10.0)); |
else |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
if (doc->typographicSetttings.valueUnderlineWidth != -1) |
Uwid = (doc->typographicSetttings.valueUnderlineWidth / 100.0) * (tsz / 10.0); |
else |
Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
if ((hl->cstyle & 16) && (chx != QChar(13))) |
else |
{ |
double Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos = hl->cfont->strikeout_pos * (tsz / 10.0); |
double Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
if (hl->ccolor != "None") |
tmp2 += putColor(hl->cstroke, hl->cshade, false); |
tmp2 += FToStr(Uwid)+" w\n"; |
tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n"; |
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n"; |
tmp2 += "S\n"; |
Upos = hl->cfont->underline_pos * (tsz / 10.0); |
Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
} |
if (hl->ccolor != "None") |
tmp2 += putColor(hl->cstroke, hl->cshade, false); |
tmp2 += FToStr(Uwid)+" w\n"; |
tmp2 += FToStr(hl->xp-kern)+" "+FToStr(-hl->yp+Upos)+" m\n"; |
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n"; |
tmp2 += "S\n"; |
} |
if ((hl->cstyle & 16) && (chx != QChar(13))) |
{ |
double Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0); |
double Upos = hl->cfont->strikeout_pos * (tsz / 10.0); |
double Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1); |
if (hl->ccolor != "None") |
tmp2 += putColor(hl->cstroke, hl->cshade, false); |
tmp2 += FToStr(Uwid)+" w\n"; |
tmp2 += FToStr(hl->xp)+" "+FToStr(-hl->yp+Upos)+" m\n"; |
tmp2 += FToStr(hl->xp+Ulen)+" "+FToStr(-hl->yp+Upos)+" l\n"; |
tmp2 += "S\n"; |
} |
if (ite->itemType() == PageItem::PathText) |
{ |
tmp += "ET\nQ\n"+tmp2; |