Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 2175 → Rev 2176

/branches/Version13x/Scribus/scribus/tabtypography.h
36,6 → 36,11
QSpinBox* underlinePos;
QLabel* textLabel2;
QSpinBox* underlineWidth;
QGroupBox* strikethruGroup;
QLabel* textLabel1_2;
QSpinBox* strikethruPos;
QLabel* textLabel2_2;
QSpinBox* strikethruWidth;
QGroupBox* groupBox4a;
QLabel* textLabel8a;
QSpinBox* autoLine;
47,6 → 52,7
QGridLayout* groupBox3aLayout;
QGridLayout* groupBox4aLayout;
QGridLayout* underlineGroupLayout;
QGridLayout* strikethruGroupLayout;
};
 
#endif
/branches/Version13x/Scribus/scribus/pageitem.cpp
2404,9 → 2404,25
}
if (hl->Style & 16)
{
double st, lw;
if ((Doc->typographicSetttings.valueStrikeThruPos != -1) || (Doc->typographicSetttings.valueStrikeThruWidth != -1))
{
if (Doc->typographicSetttings.valueStrikeThruPos != -1)
st = (Doc->typographicSetttings.valueStrikeThruPos / 100.0) * (hl->ZFo->numAscent * (hl->Siz / 10.0));
else
st = hl->ZFo->strikeout_pos * (hl->Siz / 10.0);
if (Doc->typographicSetttings.valueStrikeThruWidth != -1)
lw = (Doc->typographicSetttings.valueStrikeThruWidth / 100.0) * (hl->Siz / 10.0);
else
lw = QMAX(hl->ZFo->strokeWidth * (hl->Siz / 10.0), 1);
}
else
{
st = hl->ZFo->strikeout_pos * (hl->Siz / 10.0);
lw = QMAX(hl->ZFo->strokeWidth * (hl->Siz / 10.0), 1);
}
p->setPen(p->brush());
double st = hl->ZFo->strikeout_pos * (hl->Siz / 10.0);
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));
}
if (hl->Style & 8)
/branches/Version13x/Scribus/scribus/tabtypography.cpp
76,30 → 76,57
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->setWrapping(true);
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->setWrapping(true);
underlineWidth->setSpecialValueText( tr( "Auto" ) );
underlineGroupLayout->addWidget( underlineWidth, 0, 3 );
tabTypoLayout->addWidget( underlineGroup, 3, 0 );
 
strikethruGroup = new QGroupBox( this, "strikethruGroup" );
strikethruGroup->setTitle( tr( "Strikethru" ) );
strikethruGroup->setColumnLayout(0, Qt::Vertical );
strikethruGroup->layout()->setSpacing( 6 );
strikethruGroup->layout()->setMargin( 11 );
strikethruGroupLayout = new QGridLayout( strikethruGroup->layout() );
strikethruGroupLayout->setAlignment( Qt::AlignTop );
textLabel1_2 = new QLabel( strikethruGroup, "textLabel1" );
textLabel1_2->setText( tr( "Displacement:" ) );
strikethruGroupLayout->addWidget( textLabel1_2, 0, 0 );
strikethruPos = new QSpinBox( strikethruGroup, "strikethruPos" );
strikethruPos->setMaxValue( 100 );
strikethruPos->setMinValue( -1 );
strikethruPos->setSuffix( tr( " %" ) );
strikethruPos->setSpecialValueText( tr( "Auto" ) );
strikethruPos->setWrapping(true);
strikethruGroupLayout->addWidget( strikethruPos, 0, 1 );
textLabel2_2 = new QLabel( strikethruGroup, "textLabel2" );
textLabel2_2->setText( tr( "Line Width:" ) );
strikethruGroupLayout->addWidget( textLabel2_2, 0, 2 );
strikethruWidth = new QSpinBox( strikethruGroup, "strikethruWidth" );
strikethruWidth->setMaxValue( 100 );
strikethruWidth->setMinValue( -1 );
strikethruWidth->setWrapping(true);
strikethruWidth->setSuffix( tr( " %" ) );
strikethruWidth->setSpecialValueText( tr( "Auto" ) );
strikethruGroupLayout->addWidget( strikethruWidth, 0, 3 );
tabTypoLayout->addWidget( strikethruGroup, 4, 0 );
 
groupBox4a = new QGroupBox( this, "groupBox3a" );
groupBox4a->setColumnLayout(0, Qt::Vertical );
groupBox4a->layout()->setSpacing( 6 );
114,7 → 141,7
groupBox4aLayout->addWidget( autoLine, 1, 1 );
textLabel8a = new QLabel( autoLine, tr( "Line Spacing:" ), groupBox4a, "textLabel8a" );
groupBox4aLayout->addWidget( textLabel8a, 1, 0 );
tabTypoLayout->addWidget( groupBox4a, 4, 0 );
tabTypoLayout->addWidget( groupBox4a, 5, 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" ) );
124,6 → 151,8
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" ) );
QToolTip::add( strikethruPos, tr( "Displacement above the baseline of the normal font expressed as a percentage of the fonts ascender" ) );
QToolTip::add( strikethruWidth, tr( "Line width expressed as a percentage of the font size" ) );
}
 
void TabTypograpy::restoreDefaults(struct typoPrefs *prefsData)
135,4 → 164,6
autoLine->setValue( prefsData->autoLineSpacing );
underlinePos->setValue(prefsData->valueUnderlinePos);
underlineWidth->setValue(prefsData->valueUnderlineWidth);
strikethruPos->setValue(prefsData->valueStrikeThruPos);
strikethruWidth->setValue(prefsData->valueStrikeThruWidth);
}
/branches/Version13x/Scribus/scribus/libpostscript/pslib.cpp
1355,7 → 1355,27
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 Upos, lw, kern;
if (hl->cstyle & 1024)
kern = 0;
else
kern = hl->cextra;
if ((Doc->typographicSetttings.valueStrikeThruPos != -1) || (Doc->typographicSetttings.valueStrikeThruWidth != -1))
{
if (Doc->typographicSetttings.valueStrikeThruPos != -1)
Upos = (Doc->typographicSetttings.valueStrikeThruPos / 100.0) * (hl->cfont->numAscent * (tsz / 10.0));
else
Upos = hl->cfont->strikeout_pos * (tsz / 10.0);
if (Doc->typographicSetttings.valueStrikeThruWidth != -1)
lw = (Doc->typographicSetttings.valueStrikeThruWidth / 100.0) * (tsz / 10.0);
else
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1);
}
else
{
Upos = hl->cfont->strikeout_pos * (tsz / 10.0);
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1);
}
if (hl->ccolor != "None")
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
1363,8 → 1383,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();
}
1861,7 → 1881,27
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 Upos, lw, kern;
if (hl->cstyle & 1024)
kern = 0;
else
kern = hl->cextra;
if ((Doc->typographicSetttings.valueStrikeThruPos != -1) || (Doc->typographicSetttings.valueStrikeThruWidth != -1))
{
if (Doc->typographicSetttings.valueStrikeThruPos != -1)
Upos = (Doc->typographicSetttings.valueStrikeThruPos / 100.0) * (hl->cfont->numAscent * (tsz / 10.0));
else
Upos = hl->cfont->strikeout_pos * (tsz / 10.0);
if (Doc->typographicSetttings.valueStrikeThruWidth != -1)
lw = (Doc->typographicSetttings.valueStrikeThruWidth / 100.0) * (tsz / 10.0);
else
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1);
}
else
{
Upos = hl->cfont->strikeout_pos * (tsz / 10.0);
lw = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1);
}
if (hl->ccolor != "None")
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
1869,8 → 1909,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
2970,6 → 2970,8
doc->typographicSetttings.offsetBaseGrid = dia->tabGuides->baseOffset->value() / doc->unitRatio;
doc->typographicSetttings.valueUnderlinePos = dia->tabTypo->underlinePos->value();
doc->typographicSetttings.valueUnderlineWidth = dia->tabTypo->underlineWidth->value();
doc->typographicSetttings.valueStrikeThruPos = dia->tabTypo->strikethruPos->value();
doc->typographicSetttings.valueStrikeThruWidth = dia->tabTypo->strikethruWidth->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();
7775,6 → 7777,8
Prefs.typographicSetttings.offsetBaseGrid = dia->tabGuides->baseOffset->value() / UmReFaktor;
Prefs.typographicSetttings.valueUnderlinePos = dia->tabTypo->underlinePos->value();
Prefs.typographicSetttings.valueUnderlineWidth = dia->tabTypo->underlineWidth->value();
Prefs.typographicSetttings.valueStrikeThruPos = dia->tabTypo->strikethruPos->value();
Prefs.typographicSetttings.valueStrikeThruWidth = dia->tabTypo->strikethruWidth->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
2850,12 → 2850,31
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);
double Upos, Uwid, kern;
if (hl->cstyle & 1024)
kern = 0;
else
kern = hl->cextra;
if ((doc->typographicSetttings.valueStrikeThruPos != -1) || (doc->typographicSetttings.valueStrikeThruWidth != -1))
{
if (doc->typographicSetttings.valueStrikeThruPos != -1)
Upos = (doc->typographicSetttings.valueStrikeThruPos / 100.0) * (hl->cfont->numAscent * (tsz / 10.0));
else
Upos = hl->cfont->strikeout_pos * (tsz / 10.0);
if (doc->typographicSetttings.valueStrikeThruWidth != -1)
Uwid = (doc->typographicSetttings.valueStrikeThruWidth / 100.0) * (tsz / 10.0);
else
Uwid = QMAX(hl->cfont->strokeWidth * (tsz / 10.0), 1);
}
else
{
Upos = hl->cfont->strikeout_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)+" "+FToStr(-hl->yp+Upos)+" m\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";
}