Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 5690 → Rev 5691

/branches/Version13x/Scribus/scribus/documentchecker.cpp
123,7 → 123,7
uint chr = currItem->itemText.text(e).unicode();
if ((chr == 13) || (chr == 32) || (chr == 29) || (chr == 28) || (chr == 27) || (chr == 26) || (chr == 25))
continue;
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
chx = currItem->itemText.text(e);
if (chx.upper() != currItem->itemText.text(e))
137,13 → 137,13
if (currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar.isNull())
continue;
chx = QString(currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar);
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
for (uint t1 = 0; t1 < currItem->TabValues.count(); t1++)
151,13 → 151,13
if (currItem->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(currItem->TabValues[t1].tabFillChar);
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(currItem->TabValues[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
continue;
166,12 → 166,12
{
for (uint numco = 0x30; numco < 0x3A; ++numco)
{
if ((!currItem->itemText.at(e)->cfont->canRender(numco)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(numco)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
continue;
}
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
#endif
233,7 → 233,7
uint chr = currItem->itemText.text(e).unicode();
if ((chr == 13) || (chr == 32) || (chr == 29) || (chr == 28) || (chr == 27) || (chr == 26) || (chr == 25))
continue;
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
chx = currItem->itemText.text(e,1);
if (chx.upper() != currItem->itemText.at(e)->ch)
247,13 → 247,13
if (currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar.isNull())
continue;
chx = QString(currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar);
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(currDoc->docParagraphStyles[currItem->itemText.at(e)->cab].tabValues()[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
for (uint t1 = 0; t1 < currItem->TabValues.count(); t1++)
261,13 → 261,13
if (currItem->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(currItem->TabValues[t1].tabFillChar);
if ((currItem->itemText.charStyle(e).cstyle & 64) || (currItem->itemText.charStyle(e).cstyle & 32))
if ((currItem->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (currItem->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(currItem->TabValues[t1].tabFillChar))
chx = chx.upper();
}
chr = chx[0].unicode();
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
continue;
276,12 → 276,12
{
for (uint numco = 0x30; numco < 0x3A; ++numco)
{
if ((!currItem->itemText.at(e)->cfont->canRender(numco)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(numco)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
continue;
}
if ((!currItem->itemText.at(e)->cfont->canRender(chr)) && (checkerSettings.checkGlyphs))
if ((!currItem->itemText.at(e)->font()->canRender(chr)) && (checkerSettings.checkGlyphs))
itemError.insert(MissingGlyph, 0);
}
#endif
/branches/Version13x/Scribus/scribus/fileloader.cpp
146,7 → 146,7
int start = it->itemText.startOfRun(e);
Foi* oldFont = it->itemText.charStyle(start).font();
if (!UsedFonts.contains(oldFont->scName())) {
newFontStyle.cfont = (*ScMW->doc->AllFonts)[ReplacedFonts[oldFont->scName()]];
newFontStyle.setFont((*ScMW->doc->AllFonts)[ReplacedFonts[oldFont->scName()]]);
it->itemText.applyStyle(start, it->itemText.endOfRun(e) - start, newFontStyle );
}
}
214,8 → 214,8
for (uint a = 0; a < ScMW->doc->docParagraphStyles.count(); ++a)
{
if ( ScMW->doc->docParagraphStyles[a].charStyle().font() != &Foi::NONE && !ScMW->doc->UsedFonts.contains(ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()))
ScMW->doc->docParagraphStyles[a].charStyle().cfont =
(*ScMW->doc->AllFonts)[ReplacedFonts[ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()]];
ScMW->doc->docParagraphStyles[a].charStyle().setFont
((*ScMW->doc->AllFonts)[ReplacedFonts[ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()]]);
}
QMap<QString,QString>::Iterator itfsu;
for (itfsu = ReplacedFonts.begin(); itfsu != ReplacedFonts.end(); ++itfsu)
380,28 → 380,28
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
vg.charStyle().cfont = (*ScMW->doc->AllFonts)[tmpf];
vg.charStyle().csize = qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0);
vg.charStyle().setFont((*ScMW->doc->AllFonts)[tmpf]);
vg.charStyle().setFontSize(qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0));
vg.setHasDropCap(static_cast<bool>(pg.attribute("DROP", "0").toInt()));
vg.setDropCapLines(pg.attribute("DROPLIN", "2").toInt());
vg.setDropCapOffset(pg.attribute("DROPDIST", "0").toDouble());
vg.charStyle().cstyle = static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt());
vg.charStyle().ccolor = pg.attribute("FCOLOR", doc->toolSettings.dBrush);
vg.charStyle().cshade = pg.attribute("FSHADE", "100").toInt();
vg.charStyle().cstroke = pg.attribute("SCOLOR", doc->toolSettings.dPen);
vg.charStyle().cshade2 = pg.attribute("SSHADE", "100").toInt();
vg.charStyle().setEffects(static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt()));
vg.charStyle().setFillColor(pg.attribute("FCOLOR", doc->toolSettings.dBrush));
vg.charStyle().setFillShade(pg.attribute("FSHADE", "100").toInt());
vg.charStyle().setStrokeColor(pg.attribute("SCOLOR", doc->toolSettings.dPen));
vg.charStyle().setStrokeShade(pg.attribute("SSHADE", "100").toInt());
vg.setUseBaselineGrid(static_cast<bool>(pg.attribute("BASE", "0").toInt()));
vg.charStyle().cshadowx = qRound(pg.attribute("TXTSHX", "5").toDouble() * 10);
vg.charStyle().cshadowy = qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10);
vg.charStyle().coutline = qRound(pg.attribute("TXTOUT", "1").toDouble() * 10);
vg.charStyle().cunderpos = qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10);
vg.charStyle().cunderwidth = qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10);
vg.charStyle().cstrikepos = qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10);
vg.charStyle().cstrikewidth = qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10);
vg.charStyle().cscale = qRound(pg.attribute("SCALEH", "100").toDouble() * 10);
vg.charStyle().cscalev = qRound(pg.attribute("SCALEV", "100").toDouble() * 10);
vg.charStyle().cbase = qRound(pg.attribute("BASEO", "0").toDouble() * 10);
vg.charStyle().cextra = qRound(pg.attribute("KERN", "0").toDouble() * 10);
vg.charStyle().setShadowXOffset(qRound(pg.attribute("TXTSHX", "5").toDouble() * 10));
vg.charStyle().setShadowYOffset(qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10));
vg.charStyle().setOutlineWidth(qRound(pg.attribute("TXTOUT", "1").toDouble() * 10));
vg.charStyle().setUnderlineOffset(qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10));
vg.charStyle().setUnderlineWidth(qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruOffset(qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruWidth(qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10));
vg.charStyle().setScaleH(qRound(pg.attribute("SCALEH", "100").toDouble() * 10));
vg.charStyle().setScaleV(qRound(pg.attribute("SCALEV", "100").toDouble() * 10));
vg.charStyle().setBaselineOffset(qRound(pg.attribute("BASEO", "0").toDouble() * 10));
vg.charStyle().setTracking(qRound(pg.attribute("KERN", "0").toDouble() * 10));
vg.tabValues().clear();
if ((pg.hasAttribute("NUMTAB")) && (pg.attribute("NUMTAB", "0").toInt() != 0))
{
511,8 → 511,8
for (uint a = 0; a < ScMW->doc->docParagraphStyles.count(); ++a)
{
if ( ScMW->doc->docParagraphStyles[a].charStyle().font() != &Foi::NONE && !ScMW->doc->UsedFonts.contains(ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()))
ScMW->doc->docParagraphStyles[a].charStyle().cfont =
(*ScMW->doc->AllFonts)[ReplacedFonts[ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()]];
ScMW->doc->docParagraphStyles[a].charStyle().setFont
((*ScMW->doc->AllFonts)[ReplacedFonts[ScMW->doc->docParagraphStyles[a].charStyle().font()->scName()]]);
}
QValueList<QString> tmpList;
tmpList.clear();
/branches/Version13x/Scribus/scribus/scfonts.h
27,6 → 27,19
#include "fpointarray.h"
#include "scconfig.h"
 
/* Foi responsibilities:
 
font storage: type, format, filepath, index, document-local, substitute, etc.
usage: use, embed, subset, ...
face info: family, effect, alternative, flags, charset
encoding: CMap2String, glyphnames,
metrics: cwidth, bearing, bbox, "real" widths, paths
opentype: apply features, script support
embedding: fontdictionary, rawdata, embedPS, embedPDF, subsetPS, subsetPDF
virtual: dispatch to constituents, handle embedding
*/
 
 
// #include "scfonts_encoding.h"
 
/*! \brief Base Class Foi : This is subclassed by a class to handle Type1 fonts, a class
/branches/Version13x/Scribus/scribus/gtaction.cpp
153,37 → 153,37
if ((inPara) && (!overridePStyleFont))
{
if (ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().font() == &Foi::NONE)
newStyle.cfont = (*ScMW->doc->AllFonts)[fontName2];
newStyle.setFont((*ScMW->doc->AllFonts)[fontName2]);
else
newStyle.cfont = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().font();
newStyle.csize = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fontSize();
newStyle.ccolor = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fillColor();
newStyle.cshade = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fillShade();
newStyle.cstroke = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().strokeColor();
newStyle.cshade2 = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().strokeShade();
newStyle.cstyle = ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().effects();
newStyle.setFont(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().font());
newStyle.setFontSize(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fontSize());
newStyle.setFillColor(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fillColor());
newStyle.setFillShade(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().fillShade());
newStyle.setStrokeColor(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().strokeColor());
newStyle.setStrokeShade(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().strokeShade());
newStyle.setEffects(ScMW->doc->docParagraphStyles[paragraphStyle].charStyle().effects());
}
else
{
newStyle.cfont = (*ScMW->doc->AllFonts)[fontName];
newStyle.csize = font->getSize();
newStyle.ccolor = parseColor(font->getColor());
newStyle.cshade = font->getShade();
newStyle.cstroke = parseColor(font->getStrokeColor());
newStyle.cshade2 = font->getStrokeShade();
newStyle.cstyle = static_cast<StyleFlag>(font->getEffectsValue());
newStyle.setFont((*ScMW->doc->AllFonts)[fontName]);
newStyle.setFontSize(font->getSize());
newStyle.setFillColor(parseColor(font->getColor()));
newStyle.setFillShade(font->getShade());
newStyle.setStrokeColor(parseColor(font->getStrokeColor()));
newStyle.setStrokeShade(font->getStrokeShade());
newStyle.setEffects(static_cast<StyleFlag>(font->getEffectsValue()));
}
newStyle.cscale = font->getHscale();
newStyle.cscalev = 1000;
newStyle.cbase = 0;
newStyle.cshadowx = 50;
newStyle.cshadowy = -50;
newStyle.coutline = 10;
newStyle.cunderpos = -1;
newStyle.cunderwidth = -1;
newStyle.cstrikepos = -1;
newStyle.cstrikewidth = -1;
newStyle.cextra = font->getKerning();
newStyle.setScaleH(font->getHscale());
newStyle.setScaleV(1000);
newStyle.setBaselineOffset(0);
newStyle.setShadowXOffset(50);
newStyle.setShadowYOffset(-50);
newStyle.setOutlineWidth(10);
newStyle.setUnderlineOffset(-1);
newStyle.setUnderlineWidth(-1);
newStyle.setStrikethruOffset(-1);
newStyle.setStrikethruWidth(-1);
newStyle.setTracking(font->getKerning());
int pos = it->itemText.length();
it->itemText.insertChars(pos, QString(ch));
if (newStyle != lastStyle) {
348,8 → 348,8
vg.setFirstIndent(pstyle->getFirstLineIndent());
vg.setGapBefore(pstyle->getSpaceAbove());
vg.setGapAfter(pstyle->getSpaceBelow());
vg.charStyle().cfont = validateFont(font);
vg.charStyle().csize = font->getSize();
vg.charStyle().setFont(validateFont(font));
vg.charStyle().setFontSize(font->getSize());
vg.tabValues().clear();
QValueList<ParagraphStyle::TabRecord> *tabs = pstyle->getTabValues();
for (uint i = 0; i < tabs->size(); ++i)
360,23 → 360,23
vg.setHasDropCap(pstyle->hasDropCap());
vg.setDropCapLines(pstyle->getDropCapHeight());
vg.setDropCapOffset(0);
vg.charStyle().cstyle = static_cast<StyleFlag>(font->getEffectsValue());
vg.charStyle().ccolor = parseColor(font->getColor());
vg.charStyle().cshade = font->getShade();
vg.charStyle().cstroke = parseColor(font->getStrokeColor());
vg.charStyle().cshade2 = font->getStrokeShade();
vg.charStyle().setEffects(static_cast<StyleFlag>(font->getEffectsValue()));
vg.charStyle().setFillColor(parseColor(font->getColor()));
vg.charStyle().setFillShade(font->getShade());
vg.charStyle().setStrokeColor(parseColor(font->getStrokeColor()));
vg.charStyle().setStrokeShade(font->getStrokeShade());
vg.setUseBaselineGrid(pstyle->isAdjToBaseline());
vg.charStyle().cshadowx = 50;
vg.charStyle().cshadowy = -50;
vg.charStyle().coutline = 10;
vg.charStyle().cscale = 1000;
vg.charStyle().cscalev = 1000;
vg.charStyle().cbase = 0;
vg.charStyle().cextra = 0;
vg.charStyle().cunderpos = ScMW->doc->typographicSettings.valueUnderlinePos;
vg.charStyle().cunderwidth = ScMW->doc->typographicSettings.valueUnderlineWidth;
vg.charStyle().cstrikepos = ScMW->doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().cstrikewidth = ScMW->doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setTracking(0);
vg.charStyle().setUnderlineOffset(ScMW->doc->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(ScMW->doc->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(ScMW->doc->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(ScMW->doc->typographicSettings.valueStrikeThruPos);
textFrame->document()->docParagraphStyles.append(vg);
ScMW->propertiesPalette->Spal->updateFormatList();
}
418,8 → 418,8
vg.setFirstIndent(pstyle->getFirstLineIndent());
vg.setGapBefore(pstyle->getSpaceAbove());
vg.setGapAfter(pstyle->getSpaceBelow());
vg.charStyle().cfont = validateFont(font);
vg.charStyle().csize = font->getSize();
vg.charStyle().setFont(validateFont(font));
vg.charStyle().setFontSize(font->getSize());
vg.tabValues().clear();
QValueList<ParagraphStyle::TabRecord> *tabs = pstyle->getTabValues();
for (uint i = 0; i < tabs->size(); ++i)
430,23 → 430,23
vg.setHasDropCap(pstyle->hasDropCap());
vg.setDropCapLines(pstyle->getDropCapHeight());
vg.setDropCapOffset(0);
vg.charStyle().cstyle = static_cast<StyleFlag>(font->getEffectsValue());
vg.charStyle().ccolor = parseColor(font->getColor());
vg.charStyle().cshade = font->getShade();
vg.charStyle().cstroke = parseColor(font->getStrokeColor());
vg.charStyle().cshade2 = font->getStrokeShade();
vg.charStyle().setEffects(static_cast<StyleFlag>(font->getEffectsValue()));
vg.charStyle().setFillColor(parseColor(font->getColor()));
vg.charStyle().setFillShade(font->getShade());
vg.charStyle().setStrokeColor(parseColor(font->getStrokeColor()));
vg.charStyle().setStrokeShade(font->getStrokeShade());
vg.setUseBaselineGrid(pstyle->isAdjToBaseline());
vg.charStyle().cshadowx = 50;
vg.charStyle().cshadowy = -50;
vg.charStyle().coutline = 10;
vg.charStyle().cscale = 1000;
vg.charStyle().cscalev = 1000;
vg.charStyle().cbase = 0;
vg.charStyle().cextra = 0;
vg.charStyle().cunderpos = ScMW->doc->typographicSettings.valueUnderlinePos;
vg.charStyle().cunderwidth = ScMW->doc->typographicSettings.valueUnderlineWidth;
vg.charStyle().cstrikepos = ScMW->doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().cstrikewidth = ScMW->doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setTracking(0);
vg.charStyle().setUnderlineOffset(ScMW->doc->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(ScMW->doc->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(ScMW->doc->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(ScMW->doc->typographicSettings.valueStrikeThruPos);
ScMW->doc->docParagraphStyles[pstyleIndex] = vg;
}
 
/branches/Version13x/Scribus/scribus/mpalette.cpp
2109,7 → 2109,7
if ((HaveDoc) && (HaveItem))
{
doc->ItemTextScaleV(qRound(ChScaleV->value() * 10));
doc->currentStyle.charStyle().cscalev = qRound(ChScaleV->value() * 10);
doc->currentStyle.charStyle().setScaleV(qRound(ChScaleV->value() * 10));
emit DocChanged();
}
}
2119,7 → 2119,7
if ((HaveDoc) && (HaveItem))
{
doc->setItemTextBase(qRound(ChBase->value() * 10));
doc->currentStyle.charStyle().cbase = qRound(ChBase->value() * 10);
doc->currentStyle.charStyle().setBaselineOffset(qRound(ChBase->value() * 10));
emit DocChanged();
}
}
2149,7 → 2149,7
if ((HaveDoc) && (HaveItem))
{
doc->ItemTextScale(qRound(ChScale->value() * 10));
doc->currentStyle.charStyle().cscale = qRound(ChScale->value() * 10);
doc->currentStyle.charStyle().setScaleH(qRound(ChScale->value() * 10));
emit DocChanged();
}
}
2626,7 → 2626,7
if (CurItem->CPos != CurItem->itemText.length())
{
#ifndef NLS_PROTO
CurItem->itemText.at(CurItem->CPos)->cextra = qRound(Extra->value() * 10.0);
CurItem->itemText.at(CurItem->CPos)->setTracking(qRound(Extra->value() * 10.0));
#endif
m_MainWindow->view->RefreshItem(CurItem);
emit DocChanged();
2934,8 → 2934,8
if ((HaveDoc) && (HaveItem))
{
doc->setItemTextShadow(x, y);
doc->currentStyle.charStyle().cshadowx = x;
doc->currentStyle.charStyle().cshadowy = y;
doc->currentStyle.charStyle().setShadowXOffset(x);
doc->currentStyle.charStyle().setShadowYOffset(y);
emit DocChanged();
}
}
2959,8 → 2959,8
if ((HaveDoc) && (HaveItem))
{
doc->setItemTextUnderline(x, y);
doc->currentStyle.charStyle().cunderpos = x;
doc->currentStyle.charStyle().cunderwidth = y;
doc->currentStyle.charStyle().setUnderlineOffset(x);
doc->currentStyle.charStyle().setUnderlineWidth(y);
emit DocChanged();
}
}
2984,8 → 2984,8
if ((HaveDoc) && (HaveItem))
{
doc->setItemTextStrike(x, y);
doc->currentStyle.charStyle().cstrikepos = x;
doc->currentStyle.charStyle().cstrikewidth = y;
doc->currentStyle.charStyle().setStrikethruOffset(x);
doc->currentStyle.charStyle().setStrikethruWidth(y);
emit DocChanged();
}
}
3017,7 → 3017,7
if ((HaveDoc) && (HaveItem))
{
doc->setItemTextOutline(x);
doc->currentStyle.charStyle().coutline = x;
doc->currentStyle.charStyle().setOutlineWidth(x);
emit DocChanged();
}
}
3490,7 → 3490,7
if ((HaveDoc) && (HaveItem))
{
doc->ItemTextBrush(TxFill->currentText());
doc->currentStyle.charStyle().ccolor = TxFill->currentText();
doc->currentStyle.charStyle().setFillColor(TxFill->currentText());
emit DocChanged();
}
}
3500,7 → 3500,7
if ((HaveDoc) && (HaveItem))
{
doc->ItemTextPen(TxStroke->currentText());
doc->currentStyle.charStyle().cstroke = TxStroke->currentText();
doc->currentStyle.charStyle().setStrokeColor(TxStroke->currentText());
emit DocChanged();
}
}
3514,13 → 3514,13
{
b = PM1->getValue();
doc->ItemTextPenS(b);
doc->currentStyle.charStyle().cshade = b;
doc->currentStyle.charStyle().setFillShade(b);
}
else
{
b = PM2->getValue();
doc->ItemTextBrushS(b);
doc->currentStyle.charStyle().cshade2 = b;
doc->currentStyle.charStyle().setStrokeShade(b);
}
emit DocChanged();
}
/branches/Version13x/Scribus/scribus/sctextstruct.cpp
44,9 → 44,7
return static_cast<StyleFlag>(result);
}
 
ParagraphStyle::ParagraphStyle() :
Vname(),
pparent_(NULL),
ParagraphStyle::ParagraphStyle() : Style(),
LineSpaMode(FixedLineSpacing),
LineSpa(0),
textAlignment(0),
133,7 → 131,22
result += QObject::tr("+baseline %1").arg(cbase);
if (cscale != NOVALUE || cscalev != NOVALUE)
result += QObject::tr("+stretch ");
if (cparent_ != NULL)
result += QObject::tr("parent= %1").arg(cparent_->cname_=="" ? QObject::tr("unnamed") : cparent_->cname_);
if (parent() != NULL)
result += QObject::tr("parent= %1").arg(parent()->name()=="" ? QObject::tr("unnamed") : parent()->name());
return result.stripWhiteSpace();
}
 
 
ScText::~ScText()
{
// delete the linked list if present
GlyphLayout * more = glyph.more;
while (more) {
glyph.more = glyph.more->more;
delete more;
more = glyph.more;
}
if (parstyle)
delete parstyle;
//if (cembedded) delete cembedded
}
/branches/Version13x/Scribus/scribus/hruler.cpp
88,12 → 88,12
RulerCode = rc_none;
Markp = -1;
double Pos = (ItemPos-offs+Extra+lineCorr)*Scaling;
if ((static_cast<int>(Pos) < (m->x()+currDoc->guidesSettings.grabRad))
&& (static_cast<int>(Pos) > (m->x()-currDoc->guidesSettings.grabRad)))
if ((static_cast<int>(Pos-1) < (m->x()+currDoc->guidesSettings.grabRad))
&& (static_cast<int>(Pos-1) > (m->x()-currDoc->guidesSettings.grabRad)))
RulerCode = rc_leftFrameDist;
Pos = (ItemEndPos-offs-RExtra-lineCorr)*Scaling;
if ((static_cast<int>(Pos) < (m->x()+currDoc->guidesSettings.grabRad))
&& (static_cast<int>(Pos) > (m->x()-currDoc->guidesSettings.grabRad)))
if ((static_cast<int>(Pos+1) < (m->x()+currDoc->guidesSettings.grabRad))
&& (static_cast<int>(Pos+1) > (m->x()-currDoc->guidesSettings.grabRad)))
RulerCode = rc_rightFrameDist;
double ColWidth = (ItemEndPos - ItemPos - (ColGap * (Cols - 1)) - Extra - RExtra - 2*lineCorr) / Cols;
QRect fpo;
128,8 → 128,8
MouseX = m->x();
return;
}
Pos = (ItemPos-offs+ColWidth-RMargin+(ColWidth+ColGap)*(ActCol-1)+Extra+lineCorr)*Scaling;
fpo = QRect(static_cast<int>(Pos)-3, 9, 6, 6);
Pos = (ItemPos-offs+RMargin+(ColWidth+ColGap)*(ActCol-1)+Extra+lineCorr)*Scaling;
fpo = QRect(static_cast<int>(Pos)-5, 9, 8, 6);
if (fpo.contains(m->pos()))
{
RulerCode = rc_rightMargin;
/branches/Version13x/Scribus/scribus/search.cpp
421,7 → 421,7
found = true;
if (SSize->isChecked())
{
if (Item->itemText.charStyle(a).csize != sSize)
if (Item->itemText.charStyle(a).fontSize() != sSize)
found = false;
}
if (SFont->isChecked())
438,27 → 438,27
#endif
if (SStroke->isChecked())
{
if (Item->itemText.charStyle(a).cstroke != sCol)
if (Item->itemText.charStyle(a).strokeColor() != sCol)
found = false;
}
if (SStrokeS->isChecked())
{
if (Item->itemText.charStyle(a).cshade2 != sStrokeSh)
if (Item->itemText.charStyle(a).strokeShade() != sStrokeSh)
found = false;
}
if (SFillS->isChecked())
{
if (Item->itemText.charStyle(a).cshade != sFillSh)
if (Item->itemText.charStyle(a).fillShade() != sFillSh)
found = false;
}
if (SEffect->isChecked())
{
if ((Item->itemText.charStyle(a).cstyle & 1919) != sEff)
if ((Item->itemText.charStyle(a).effects() & 1919) != sEff)
found = false;
}
if (SFill->isChecked())
{
if (Item->itemText.charStyle(a).ccolor != fCol)
if (Item->itemText.charStyle(a).fillColor() != fCol)
found = false;
}
if (found)
571,15 → 571,15
found = false;
if ((SStyle->isChecked()) && (hg->cab != sStyle))
found = false;
if ((SStroke->isChecked()) && (hg->charStyle.cstroke != sCol))
if ((SStroke->isChecked()) && (hg->charStyle.strokeColor() != sCol))
found = false;
if ((SStrokeS->isChecked()) && (hg->charStyle.cshade2 != sStrokeSh))
if ((SStrokeS->isChecked()) && (hg->charStyle.strokeShade() != sStrokeSh))
found = false;
if ((SFillS->isChecked()) && (hg->charStyle.cshade != sFillSh))
if ((SFillS->isChecked()) && (hg->charStyle.fillShade() != sFillSh))
found = false;
if ((SEffect->isChecked()) && ((hg->charStyle.cstyle & 1919) != sEff))
if ((SEffect->isChecked()) && ((hg->charStyle.effects() & 1919) != sEff))
found = false;
if ((SFill->isChecked()) && (hg->charStyle.ccolor != fCol))
if ((SFill->isChecked()) && (hg->charStyle.fillColor() != fCol))
found = false;
inde++;
}
607,15 → 607,15
found = false;
if ((SStyle->isChecked()) && (hg->cab != sStyle))
found = false;
if ((SStroke->isChecked()) && (hg->charStyle.cstroke != sCol))
if ((SStroke->isChecked()) && (hg->charStyle.strokeColor() != sCol))
found = false;
if ((SStrokeS->isChecked()) && (hg->charStyle.cshade2 != sStrokeSh))
if ((SStrokeS->isChecked()) && (hg->charStyle.strokeShade() != sStrokeSh))
found = false;
if ((SFillS->isChecked()) && (hg->charStyle.cshade != sFillSh))
if ((SFillS->isChecked()) && (hg->charStyle.fillShade() != sFillSh))
found = false;
if ((SEffect->isChecked()) && ((hg->charStyle.cstyle & 1919) != sEff))
if ((SEffect->isChecked()) && ((hg->charStyle.effects() & 1919) != sEff))
found = false;
if ((SFill->isChecked()) && (hg->charStyle.ccolor != fCol))
if ((SFill->isChecked()) && (hg->charStyle.fillColor() != fCol))
found = false;
if (found)
{
697,31 → 697,30
hg = new ScText;
hg->ch = repl[cx];
if (RSize->isChecked())
hg->csize = qRound(RSizeVal->value() * 10.0);
hg->setFontSize(qRound(RSizeVal->value() * 10.0));
else
hg->csize = Doc->currentStyle.charStyle().fontSize();
hg->setFontSize(Doc->currentStyle.charStyle().fontSize());
if (RFill->isChecked())
hg->ccolor = RFillVal->currentText();
hg->setFillColor(RFillVal->currentText());
else
hg->ccolor = Doc->currentStyle.charStyle().fillColor();
hg->cshade = Doc->currentStyle.charStyle().fillShade();
hg->setFillColor(Doc->currentStyle.charStyle().fillColor());
hg->setFillShade(Doc->currentStyle.charStyle().fillShade());
if (RStroke->isChecked())
hg->cstroke = RStrokeVal->currentText();
hg->setStrokeColor(RStrokeVal->currentText());
else
hg->cstroke = Doc->currentStyle.charStyle().strokeColor();
hg->cshade2 = Doc->currentStyle.charStyle().strokeShade();
hg->cscale = Doc->currentStyle.charStyle().fontSize();
hg->cbase = Doc->currentStyle.charStyle().baselineOffset();
hg->cshadowx = Doc->currentStyle.charStyle().shadowXOffset();
hg->cshadowy = Doc->currentStyle.charStyle().shadowYOffset();
hg->coutline = Doc->currentStyle.charStyle().outlineWidth();
hg->cunderpos = Doc->currentStyle.charStyle().underlineOffset();
hg->cunderwidth = Doc->currentStyle.charStyle().underlineWidth();
hg->cstrikepos = Doc->currentStyle.charStyle().strikethruOffset();
hg->cstrikewidth = Doc->currentStyle.charStyle().strikethruWidth();
hg->cembedded = 0;
hg->cselect = true;
hg->cstyle = Doc->currentStyle.charStyle().effects();
hg->setStrokeColor(Doc->currentStyle.charStyle().strokeColor());
hg->setStrokeShade(Doc->currentStyle.charStyle().strokeShade());
hg->setScaleH(Doc->currentStyle.charStyle().scaleH());
hg->setScaleV(Doc->currentStyle.charStyle().scaleV());
hg->setBaselineOffset(Doc->currentStyle.charStyle().baselineOffset());
hg->setShadowXOffset(Doc->currentStyle.charStyle().shadowXOffset());
hg->setShadowYOffset(Doc->currentStyle.charStyle().shadowYOffset());
hg->setOutlineWidth(Doc->currentStyle.charStyle().outlineWidth());
hg->setUnderlineOffset(Doc->currentStyle.charStyle().underlineOffset());
hg->setUnderlineWidth(Doc->currentStyle.charStyle().underlineWidth());
hg->setStrikethruOffset(Doc->currentStyle.charStyle().strikethruOffset());
hg->setStrikethruWidth(Doc->currentStyle.charStyle().strikethruWidth());
hg->setEffects(Doc->currentStyle.charStyle().effects());
if (RStyle->isChecked())
hg->cab = RStyleVal->currentItem();
else
728,20 → 727,15
hg->cab = findParagraphStyle(Doc, Doc->currentStyle);
if (Doc->docParagraphStyles[hg->cab].charStyle().font() != &Foi::NONE)
{
hg->cfont = (*Doc->AllFonts)[Doc->docParagraphStyles[hg->cab].charStyle().font()->scName()];
hg->csize = Doc->docParagraphStyles[hg->cab].charStyle().fontSize();
hg->cstyle = Doc->docParagraphStyles[hg->cab].charStyle().effects();
hg->setFont((*Doc->AllFonts)[Doc->docParagraphStyles[hg->cab].charStyle().font()->scName()]);
hg->setFontSize(Doc->docParagraphStyles[hg->cab].charStyle().fontSize());
hg->setEffects(Doc->docParagraphStyles[hg->cab].charStyle().effects());
}
if (RFont->isChecked())
hg->cfont = (*Doc->AllFonts)[RFontVal->currentText()];
hg->setFont((*Doc->AllFonts)[RFontVal->currentText()]);
else
hg->cfont = (*Doc->AllFonts)[Doc->currentStyle.charStyle().font()->scName()];
hg->cextra = 0;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->setFont((*Doc->AllFonts)[Doc->currentStyle.charStyle().font()->scName()]);
hg->setTracking(0);
Item->itemText.insert(ReplStart+cx, hg);
#else
Item->itemText.insertChars(ReplStart+cx, repl.mid(cx,1));
776,13 → 770,15
{
#ifndef NLS_PROTO
int s = REffVal->getStyle();
Doc->currentStyle.charStyle().cstyle = static_cast<StyleFlag>(s); // ???
Doc->currentStyle.charStyle().setEffects(static_cast<StyleFlag>(s)); // ???
for (int a = 0; a < Item->itemText.length(); ++a)
{
if (Item->itemText.selected(a))
{
Item->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919);
Item->itemText.at(a)->cstyle |= static_cast<StyleFlag>(s);
StyleFlag fl = Item->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919);
fl |= static_cast<StyleFlag>(s);
Item->itemText.at(a)->setEffects(fl);
}
}
#endif
/branches/Version13x/Scribus/scribus/pdflib.cpp
2935,72 → 2935,48
for (; ite->frameDisplays(d); ++d)
{
const ScText * const hl = ite->itemText.at(d);
if ((hl->ch == QChar(13)) || (hl->ch == QChar(10)) || (hl->ch == QChar(28)) || (hl->ch == QChar(27)) || (hl->ch == QChar(26)))
if ((hl->ch == SpecialChars::PARSEP) || (hl->ch == QChar(10)) || (hl->ch == SpecialChars::LINEBREAK) || (hl->ch == SpecialChars::FRAMEBREAK) || (hl->ch == SpecialChars::COLBREAK))
continue;
if (hl->cstyle & 4096)
if (hl->effects() & ScStyle_SuppressSpace)
continue;
if ((hl->yp == 0) && (ite->asTextFrame()))
if ((hl->glyph.yoffset == 0) && (ite->asTextFrame()))
continue;
if (hl->cab < 5)
tTabValues = ite->TabValues;
else
tTabValues = doc.docParagraphStyles[hl->cab].tabValues();
if (hl->cstyle & 16384)
if (hl->effects() & ScStyle_StartOfLine)
tabCc = 0;
if ((hl->ch == QChar(9)) && (tTabValues.count() != 0))
if ((hl->ch == SpecialChars::TAB) && (tTabValues.count() != 0))
{
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
ScText hl2;
double wt = Cwidth(&doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
static_cast<CharStyle&>(hl2) = static_cast<const CharStyle&>(*hl);
hl2.cselect = hl->cselect;
 
double wt = Cwidth(&doc, hl->font(), QString(tTabValues[tabCc].tabFillChar), hl->fontSize());
int coun = static_cast<int>((hl->glyph.xoffset - tabDist) / wt);
double sPos = hl->glyph.xoffset - (hl->glyph.xoffset - tabDist) + 1;
hl2.ch = QString(tTabValues[tabCc].tabFillChar);
hl2.ccolor = hl->ccolor;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade;
hl2.cshade2 = hl->cshade2;
hl2.yp = hl->yp;
hl2.cselect = hl->cselect;
hl2.csize = hl->csize;
hl2.cstyle = hl->cstyle;
hl2.cfont = hl->cfont;
hl2.cextra = 0;
hl2.cscale = 1000;
hl2.cscalev = 1000;
hl2.cbase = hl->cbase;
hl2.cshadowx = hl->cshadowx;
hl2.cshadowy = hl->cshadowy;
hl2.coutline = hl->coutline;
hl2.cunderpos = hl->cunderpos;
hl2.cunderwidth = hl->cunderwidth;
hl2.cstrikepos = hl->cstrikepos;
hl2.cstrikewidth = hl->cstrikewidth;
 
hl2.setTracking(0);
hl2.setScaleH(1000);
hl2.setScaleV(1000);
 
hl2.glyph.yoffset = hl->glyph.yoffset;
for (int cx = 0; cx < coun; ++cx)
{
hl2.xp = sPos + wt * cx;
if ((hl2.cstyle & 256) && (hl2.cstroke != CommonStrings::None))
hl2.glyph.xoffset = sPos + wt * cx;
if ((hl2.effects() & ScStyle_Shadowed) && (hl2.strokeColor() != CommonStrings::None))
{
ScText hl3;
static_cast<CharStyle&>(hl3) = static_cast<const CharStyle&>(hl2);
hl3.ch = hl2.ch;
hl3.ccolor = hl2.cstroke;
hl3.cstroke = hl2.cstroke;
hl3.cshade = hl2.cshade2;
hl3.cshade2 = hl2.cshade2;
hl3.yp = hl2.yp - (hl2.csize * hl2.cshadowy / 10000.0);
hl3.xp = hl2.xp + (hl2.csize * hl2.cshadowx / 10000.0);
hl3.csize = hl2.csize;
hl3.cstyle = hl2.cstyle;
hl3.cfont = hl2.cfont;
hl3.cscale = hl2.cscale;
hl3.cscalev = hl2.cscalev;
hl3.cextra = hl2.cextra;
hl3.cbase = hl2.cbase;
hl3.coutline = hl2.coutline;
hl3.cunderpos = hl2.cunderpos;
hl3.cunderwidth = hl2.cunderwidth;
hl3.cstrikepos = hl2.cstrikepos;
hl3.cstrikewidth = hl2.cstrikewidth;
 
hl3.glyph.yoffset = hl2.glyph.yoffset - (hl2.fontSize() * hl2.shadowYOffset() / 10000.0);
hl3.glyph.xoffset = hl2.glyph.xoffset + (hl2.fontSize() * hl2.shadowXOffset() / 10000.0);
 
setTextCh(ite, PNr, d, tmp, tmp2, &hl3, pag);
}
setTextCh(ite, PNr, d, tmp, tmp2, &hl2, pag);
3014,36 → 2990,22
continue;
}
}
if (hl->ch == QChar(9))
if (hl->ch == SpecialChars::TAB)
continue;
if ((hl->cstyle & 256) && (hl->cstroke != CommonStrings::None))
if ((hl->effects() & ScStyle_Shadowed) && (hl->strokeColor() != CommonStrings::None))
{
ScText hl2;
hl2.ch = hl->ch;
hl2.ccolor = hl->cstroke;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade2;
hl2.cshade2 = hl->cshade2;
hl2.yp = hl->yp - (hl->csize * hl->cshadowy / 10000.0);
hl2.xp = hl->xp + (hl->csize * hl->cshadowx / 10000.0);
hl2.csize = hl->csize;
hl2.cstyle = hl->cstyle;
hl2.cfont = hl->cfont;
hl2.cscale = hl->cscale;
hl2.cscalev = hl->cscalev;
hl2.cextra = hl->cextra;
hl2.cbase = hl->cbase;
hl2.cshadowx = hl->cshadowx;
hl2.cshadowy = hl->cshadowy;
hl2.coutline = hl->coutline;
hl2.cunderpos = hl->cunderpos;
hl2.cunderwidth = hl->cunderwidth;
hl2.cstrikepos = hl->cstrikepos;
hl2.cstrikewidth = hl->cstrikewidth;
static_cast<CharStyle&>(hl2) = static_cast<const CharStyle&>(*hl);
hl2.cselect = hl->cselect;
 
hl2.glyph.yoffset = hl->glyph.yoffset - (hl->fontSize() * hl->shadowYOffset() / 10000.0);
hl2.glyph.xoffset = hl->glyph.xoffset + (hl->fontSize() * hl->shadowXOffset() / 10000.0);
 
setTextCh(ite, PNr, d, tmp, tmp2, &hl2, pag);
}
setTextCh(ite, PNr, d, tmp, tmp2, hl, pag);
tabDist = hl->xp + Cwidth(&doc, hl->cfont, hl->ch, hl->csize) * (hl->cscale / 1000.0);
tabDist = hl->glyph.xoffset + Cwidth(&doc, hl->font(), hl->ch, hl->fontSize()) * (hl->scaleH() / 1000.0);
}
#endif
if (ite->itemType() == PageItem::TextFrame)
3060,26 → 3022,26
{
tmp += "q\n";
QWMatrix trafo = QWMatrix( 1, 0, 0, -1, -hl->PRot, 0 );
trafo *= QWMatrix( hl->PtransX, -hl->PtransY, -hl->PtransY, -hl->PtransX, hl->xp, -hl->yp );
trafo *= QWMatrix( hl->PtransX, -hl->PtransY, -hl->PtransY, -hl->PtransX, hl->glyph.xoffset, -hl->glyph.yoffset );
tmp += FToStr(trafo.m11())+" "+FToStr(trafo.m12())+" "+FToStr(trafo.m21())+" "+FToStr(trafo.m22())+" "+FToStr(trafo.dx())+" "+FToStr(trafo.dy())+" cm\n";
if (ite->BaseOffs != 0)
tmp += "1 0 0 1 0 "+FToStr( -ite->BaseOffs)+" cm\n";
tmp += "BT\n";
}
int tsz = hl->csize;
int tsz = hl->fontSize();
QString chx = hl->ch;
if (hl->cstyle & 2048)
if (hl->effects() & ScStyle_DropCap)
{
if (doc.docParagraphStyles[hl->cab].useBaselineGrid())
tsz = qRound(10 * ((doc.typographicSettings.valueBaseGrid * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(&doc, hl->cfont, chx, 10))));
tsz = qRound(10 * ((doc.typographicSettings.valueBaseGrid * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(&doc, hl->font(), chx, 10))));
else
{
if (doc.docParagraphStyles[hl->cab].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
tsz = qRound(10 * ((doc.docParagraphStyles[hl->cab].lineSpacing() * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(&doc, hl->cfont, chx, 10))));
tsz = qRound(10 * ((doc.docParagraphStyles[hl->cab].lineSpacing() * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(&doc, hl->font(), chx, 10))));
else
{
double currasce = RealFHeight(&doc, hl->cfont, doc.docParagraphStyles[hl->cab].charStyle().fontSize());
tsz = qRound(10 * ((currasce * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(&doc, hl->cfont, chx, 10)));
double currasce = RealFHeight(&doc, hl->font(), doc.docParagraphStyles[hl->cab].charStyle().fontSize());
tsz = qRound(10 * ((currasce * (doc.docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (doc.docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(&doc, hl->font(), chx, 10)));
}
}
}
3109,15 → 3071,15
{
PageItem* embedded = emG.at(em);
tmp2 += "q\n";
tmp2 += FToStr(hl->cscale / 1000.0)+" 0 0 "+FToStr(hl->cscalev / 1000.0)+" "+FToStr(hl->xp + embedded->gXpos * (hl->cscale / 1000.0))+" "+FToStr(-hl->yp + (embedded->gHeight * (hl->cscalev / 1000.0)) - embedded->gYpos * (hl->cscalev / 1000.0)+embedded->gHeight * (hl->cbase / 1000.0))+" cm\n";
tmp2 += FToStr(hl->scaleH() / 1000.0)+" 0 0 "+FToStr(hl->scaleV() / 1000.0)+" "+FToStr(hl->glyph.xoffset + embedded->gXpos * (hl->scaleH() / 1000.0))+" "+FToStr(-hl->glyph.yoffset + (embedded->gHeight * (hl->scaleV() / 1000.0)) - embedded->gYpos * (hl->scaleV() / 1000.0)+embedded->gHeight * (hl->baselineOffset() / 1000.0))+" cm\n";
tmp2 += PDF_ProcessItem(embedded, pag, PNr, true);
tmp2 += "Q\n";
}
return;
}
if (hl->ch == QChar(29))
if (hl->ch == SpecialChars::NBSPACE)
chx = " ";
if (hl->ch == QChar(24))
if (hl->ch == SpecialChars::NBHYPHEN)
chx = "-";
if (hl->ch == QChar(0xA0))
chx = " ";
3150,53 → 3112,53
}
uint cc = chx[0].unicode();
uint idx = 0;
if (GlyphsIdxOfFont[hl->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
if (GlyphsIdxOfFont[hl->font()->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->font()->scName()][cc].Code;
uint idx1 = (idx >> 8) & 0xFF;
if (hl->cstyle & 32)
if (hl->effects() & ScStyle_AllCaps)
{
if (chx.upper() != chx)
chx = chx.upper();
}
if (hl->cstyle & 64)
if (hl->effects() & ScStyle_SmallCaps)
{
if (chx.upper() != chx)
{
tsz = hl->csize * doc.typographicSettings.valueSmallCaps / 100;
tsz = hl->fontSize() * doc.typographicSettings.valueSmallCaps / 100;
chx = chx.upper();
}
}
if (hl->cstyle & 1)
tsz = hl->csize * doc.typographicSettings.scalingSuperScript / 100;
if (hl->cstyle & 2)
tsz = hl->csize * doc.typographicSettings.scalingSubScript / 100;
if (hl->cstroke != CommonStrings::None)
if (hl->effects() & ScStyle_Superscript)
tsz = hl->fontSize() * doc.typographicSettings.scalingSuperScript / 100;
if (hl->effects() & ScStyle_Subscript)
tsz = hl->fontSize() * doc.typographicSettings.scalingSubScript / 100;
if (hl->strokeColor() != CommonStrings::None)
{
StrokeColor = "";
StrokeColor += putColor(hl->cstroke, hl->cshade2, false);
StrokeColor += putColor(hl->strokeColor(), hl->strokeShade(), false);
}
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
FillColor = "";
FillColor += putColor(hl->ccolor, hl->cshade, true);
FillColor += putColor(hl->fillColor(), hl->fillShade(), true);
}
if ((hl->cfont->isOTF()) || (!hl->cfont->hasNames()) || (hl->cfont->subset()) || (Options.SubsetList.contains(hl->cfont->scName())))
if ((hl->font()->isOTF()) || (!hl->font()->hasNames()) || (hl->font()->subset()) || (Options.SubsetList.contains(hl->font()->scName())))
{
uint chr = chx[0].unicode();
if ((hl->cfont->canRender(chx[0])) && (chr != 32))
if ((hl->font()->canRender(chx[0])) && (chr != 32))
{
if ((hl->cstroke != CommonStrings::None) && (hl->cstyle & 4))
if ((hl->strokeColor() != CommonStrings::None) && (hl->effects() & ScStyle_Outline))
{
tmp2 += FToStr((tsz * hl->coutline / 1000.0) / tsz)+" w\n[] 0 d\n0 J\n0 j\n";
tmp2 += FToStr((tsz * hl->outlineWidth() / 1000.0) / tsz)+" w\n[] 0 d\n0 J\n0 j\n";
tmp2 += StrokeColor;
}
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
tmp2 += FillColor;
tmp2 += "q\n";
if (ite->itemType() == PageItem::PathText)
{
QWMatrix trafo = QWMatrix( 1, 0, 0, -1, -hl->PRot, 0 );
trafo *= QWMatrix( hl->PtransX, -hl->PtransY, -hl->PtransY, -hl->PtransX, hl->xp, -hl->yp );
trafo *= QWMatrix( hl->PtransX, -hl->PtransY, -hl->PtransY, -hl->PtransX, hl->glyph.xoffset, -hl->glyph.yoffset );
tmp2 += FToStr(trafo.m11())+" "+FToStr(trafo.m12())+" "+FToStr(trafo.m21())+" "+FToStr(trafo.m22())+" "+FToStr(trafo.dx())+" "+FToStr(trafo.dy())+" cm\n";
}
if (!ite->asPathText())
3203,8 → 3165,8
{
if (ite->reversed())
{
double wid = Cwidth(&doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
tmp2 += "1 0 0 1 "+FToStr(hl->xp)+" "+FToStr((hl->yp - (tsz / 10.0)) * -1 + ((tsz / 10.0) * (hl->cbase / 1000.0)))+" cm\n";
double wid = Cwidth(&doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
tmp2 += "1 0 0 1 "+FToStr(hl->glyph.xoffset)+" "+FToStr((hl->glyph.yoffset - (tsz / 10.0)) * -1 + ((tsz / 10.0) * (hl->baselineOffset() / 1000.0)))+" cm\n";
tmp2 += "-1 0 0 1 0 0 cm\n";
tmp2 += "1 0 0 1 "+FToStr(-wid)+" 0 cm\n";
tmp2 += FToStr(tsz / 10.0)+" 0 0 "+FToStr(tsz / 10.0)+" 0 0 cm\n";
3211,7 → 3173,7
}
else
{
tmp2 += FToStr(tsz / 10.0)+" 0 0 "+FToStr(tsz / 10.0)+" "+FToStr(hl->xp)+" "+FToStr((hl->yp - (tsz / 10.0)) * -1 + ((tsz / 10.0) * (hl->cbase / 1000.0)))+" cm\n";
tmp2 += FToStr(tsz / 10.0)+" 0 0 "+FToStr(tsz / 10.0)+" "+FToStr(hl->glyph.xoffset)+" "+FToStr((hl->glyph.yoffset - (tsz / 10.0)) * -1 + ((tsz / 10.0) * (hl->baselineOffset() / 1000.0)))+" cm\n";
}
}
else
3220,14 → 3182,14
tmp2 += "1 0 0 1 0 "+FToStr( -ite->BaseOffs)+" cm\n";
tmp2 += FToStr(tsz / 10.0)+" 0 0 "+FToStr(tsz / 10.0)+" 0 "+FToStr(tsz / 10.0)+" cm\n";
}
if (hl->cscalev != 1000)
tmp2 += "1 0 0 1 0 "+FToStr( (((tsz / 10.0) - (tsz / 10.0) * (hl->cscalev / 1000.0)) / (tsz / 10.0)) * -1)+" cm\n";
tmp2 += FToStr(QMIN(QMAX(hl->cscale, 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->cscalev, 100), 4000) / 1000.0)+" 0 0 cm\n";
if (hl->ccolor != CommonStrings::None)
tmp2 += "/"+hl->cfont->RealName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+QString::number(chr)+" Do\n";
if (hl->cstyle & 4)
if (hl->scaleV() != 1000)
tmp2 += "1 0 0 1 0 "+FToStr( (((tsz / 10.0) - (tsz / 10.0) * (hl->scaleV() / 1000.0)) / (tsz / 10.0)) * -1)+" cm\n";
tmp2 += FToStr(QMIN(QMAX(hl->scaleH(), 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->scaleV(), 100), 4000) / 1000.0)+" 0 0 cm\n";
if (hl->fillColor() != CommonStrings::None)
tmp2 += "/"+hl->font()->RealName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+QString::number(chr)+" Do\n";
if (hl->effects() & ScStyle_Outline)
{
FPointArray gly = hl->cfont->outline(chr).copy();
FPointArray gly = hl->font()->outline(chr).copy();
QWMatrix mat;
mat.scale(0.1, 0.1);
gly.map(mat);
3259,14 → 3221,14
}
tmp2 += "s\n";
}
if (hl->cstyle & 8192)
if (hl->effects() & ScStyle_SmartHyphenVisible)
{
int chs = hl->csize;
double wtr = Cwidth(&doc, hl->cfont, chx, chs) * (hl->cscale / 1000.0);
int chs = hl->fontSize();
double wtr = Cwidth(&doc, hl->font(), chx, chs) * (hl->scaleH() / 1000.0);
tmp2 += "1 0 0 1 "+FToStr(wtr / (tsz / 10.0))+" 0 cm\n";
chx = "-";
chr = chx[0].unicode();
FPointArray gly = hl->cfont->outline(chr).copy();
FPointArray gly = hl->font()->outline(chr).copy();
QWMatrix mat;
mat.scale(0.1, 0.1);
gly.map(mat);
3305,24 → 3267,24
{
cc = chx[0].unicode();
idx = 0;
if (GlyphsIdxOfFont[hl->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
if (GlyphsIdxOfFont[hl->font()->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->font()->scName()][cc].Code;
idx1 = (idx >> 8) & 0xFF;
tmp += UsedFontsP[hl->cfont->scName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
if (hl->cstroke != CommonStrings::None)
tmp += UsedFontsP[hl->font()->scName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
if (hl->strokeColor() != CommonStrings::None)
{
tmp += StrokeColor;
if ((hl->cstyle & 8) || (hl->cstyle & 16))
if ((hl->effects() & ScStyle_Underline) || (hl->effects() & ScStyle_Strikethrough))
tmp2 += StrokeColor;
}
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
tmp += FillColor;
if ((hl->cstyle & 8) || (hl->cstyle & 16))
if ((hl->effects() & ScStyle_Underline) || (hl->effects() & ScStyle_Strikethrough))
tmp2 += FillColor;
}
if (hl->cstyle & 4)
tmp += FToStr(tsz * hl->coutline / 10000.0) + (hl->ccolor != CommonStrings::None ? " w 2 Tr\n" : " w 1 Tr\n");
if (hl->effects() & 4)
tmp += FToStr(tsz * hl->outlineWidth() / 10000.0) + (hl->fillColor() != CommonStrings::None ? " w 2 Tr\n" : " w 1 Tr\n");
else
tmp += "0 Tr\n";
if (!ite->asPathText())
3329,112 → 3291,112
{
if (ite->reversed())
{
int chs = hl->csize;
int chs = hl->fontSize();
double wtr;
if (ite->frameDisplays(d+1))
{
QString ctx = ite->itemText.at(d+1)->ch;
if (ctx == QChar(29))
if (ctx == SpecialChars::NBSPACE)
ctx = " ";
if (ctx == QChar(0xA0))
ctx = " ";
wtr = Cwidth(&doc, hl->cfont, chx, chs, ctx) * (hl->cscale / 1000.0);
wtr = Cwidth(&doc, hl->font(), chx, chs, ctx) * (hl->scaleH() / 1000.0);
}
else
wtr = Cwidth(&doc, hl->cfont, chx, chs) * (hl->cscale / 1000.0);
tmp += FToStr(-QMIN(QMAX(hl->cscale, 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->cscalev, 100), 4000) / 1000.0)+" "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp+(hl->csize / 10.0) * (hl->cbase / 1000.0))+" Tm\n";
wtr = Cwidth(&doc, hl->font(), chx, chs) * (hl->scaleH() / 1000.0);
tmp += FToStr(-QMIN(QMAX(hl->scaleH(), 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->scaleV(), 100), 4000) / 1000.0)+" "+FToStr(hl->glyph.xoffset+wtr)+" "+FToStr(-hl->glyph.yoffset+(hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0))+" Tm\n";
// tmp += "-1 0 0 1 "+FToStr(wtr)+" "+FToStr(0)+" Tm\n";
}
else
tmp += FToStr(QMIN(QMAX(hl->cscale, 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->cscalev, 100), 4000) / 1000.0)+" "+FToStr(hl->xp)+" "+FToStr(-hl->yp+(hl->csize / 10.0) * (hl->cbase / 1000.0))+" Tm\n";
tmp += FToStr(QMIN(QMAX(hl->scaleH(), 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->scaleV(), 100), 4000) / 1000.0)+" "+FToStr(hl->glyph.xoffset)+" "+FToStr(-hl->glyph.yoffset+(hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0))+" Tm\n";
}
else
tmp += FToStr(QMIN(QMAX(hl->cscale, 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->cscalev, 100), 4000) / 1000.0)+" 0 0 Tm\n";
tmp += FToStr(QMIN(QMAX(hl->scaleH(), 100), 4000) / 1000.0)+" 0 0 "+FToStr(QMIN(QMAX(hl->scaleV(), 100), 4000) / 1000.0)+" 0 0 Tm\n";
uchar idx2 = idx & 0xFF;
tmp += "<"+QString(toHex(idx2))+"> Tj\n";
if (! ite->asPathText())
{
if (hl->cstyle & 8192)
if (hl->effects() & ScStyle_SmartHyphenVisible)
{
int chs = hl->csize;
double wtr = Cwidth(&doc, hl->cfont, chx, chs) * (hl->cscale / 1000.0);
tmp += "1 0 0 1 "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp)+" Tm\n";
int chs = hl->fontSize();
double wtr = Cwidth(&doc, hl->font(), chx, chs) * (hl->scaleH() / 1000.0);
tmp += "1 0 0 1 "+FToStr(hl->glyph.xoffset+wtr)+" "+FToStr(-hl->glyph.yoffset)+" Tm\n";
chx = "-";
cc = chx[0].unicode();
idx = 0;
if (GlyphsIdxOfFont[hl->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
if (GlyphsIdxOfFont[hl->font()->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->font()->scName()][cc].Code;
idx1 = (idx >> 8) & 0xFF;
tmp += UsedFontsP[hl->cfont->scName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
tmp += UsedFontsP[hl->font()->scName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
idx2 = idx & 0xFF;
tmp += "<"+QString(toHex(idx2))+"> Tj\n";
}
}
}
if (((hl->cstyle & 8) && (chx != QChar(13))) || ((hl->cstyle & 512) && (!chx[0].isSpace())))
if (((hl->effects() & ScStyle_Underline) && (chx != SpecialChars::PARSEP)) || ((hl->effects() & ScStyle_UnderlineWords) && (!chx[0].isSpace())))
{
double Ulen = Cwidth(&doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
double Ulen = Cwidth(&doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
double Upos, Uwid, kern;
if (hl->cstyle & 16384)
if (hl->effects() & ScStyle_StartOfLine)
kern = 0;
else
kern = hl->csize * hl->cextra / 10000.0;
if ((hl->cunderpos != -1) || (hl->cunderwidth != -1))
kern = hl->fontSize() * hl->tracking() / 10000.0;
if ((hl->underlineOffset() != -1) || (hl->underlineWidth() != -1))
{
if (hl->cunderpos != -1)
Upos = (hl->cunderpos / 1000.0) * (hl->cfont->descent() * (hl->csize / 10.0));
if (hl->underlineOffset() != -1)
Upos = (hl->underlineOffset() / 1000.0) * (hl->font()->descent() * (hl->fontSize() / 10.0));
else
Upos = hl->cfont->underlinePos() * (hl->csize / 10.0);
if (hl->cunderwidth != -1)
Uwid = (hl->cunderwidth / 1000.0) * (hl->csize / 10.0);
Upos = hl->font()->underlinePos() * (hl->fontSize() / 10.0);
if (hl->underlineWidth() != -1)
Uwid = (hl->underlineWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
Uwid = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Uwid = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->cfont->underlinePos() * (hl->csize / 10.0);
Uwid = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Upos = hl->font()->underlinePos() * (hl->fontSize() / 10.0);
Uwid = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
if (hl->cbase != 0)
Upos += (hl->csize / 10.0) * (hl->cbase / 1000.0);
if (hl->ccolor != CommonStrings::None)
tmp2 += putColor(hl->ccolor, hl->cshade, false);
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
if (hl->fillColor() != CommonStrings::None)
tmp2 += putColor(hl->fillColor(), hl->fillShade(), 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 += FToStr(hl->glyph.xoffset-kern)+" "+FToStr(-hl->glyph.yoffset+Upos)+" m\n";
tmp2 += FToStr(hl->glyph.xoffset+Ulen)+" "+FToStr(-hl->glyph.yoffset+Upos)+" l\n";
tmp2 += "S\n";
}
if ((hl->cstyle & 16) && (chx != QChar(13)))
if ((hl->effects() & ScStyle_Strikethrough) && (chx != SpecialChars::PARSEP))
{
double Ulen = Cwidth(&doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
double Ulen = Cwidth(&doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
double Upos, Uwid, kern;
if (hl->cstyle & 16384)
if (hl->effects() & ScStyle_StartOfLine)
kern = 0;
else
kern = hl->csize * hl->cextra / 10000.0;
if ((hl->cstrikepos != -1) || (hl->cstrikewidth != -1))
kern = hl->fontSize() * hl->tracking() / 10000.0;
if ((hl->strikethruOffset() != -1) || (hl->strikethruWidth() != -1))
{
if (hl->cstrikepos != -1)
Upos = (hl->cstrikepos / 1000.0) * (hl->cfont->ascent() * (hl->csize / 10.0));
if (hl->strikethruOffset() != -1)
Upos = (hl->strikethruOffset() / 1000.0) * (hl->font()->ascent() * (hl->fontSize() / 10.0));
else
Upos = hl->cfont->strikeoutPos() * (hl->csize / 10.0);
if (hl->cstrikewidth != -1)
Uwid = (hl->cstrikewidth / 1000.0) * (hl->csize / 10.0);
Upos = hl->font()->strikeoutPos() * (hl->fontSize() / 10.0);
if (hl->strikethruWidth() != -1)
Uwid = (hl->strikethruWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
Uwid = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Uwid = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->cfont->strikeoutPos() * (hl->csize / 10.0);
Uwid = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Upos = hl->font()->strikeoutPos() * (hl->fontSize() / 10.0);
Uwid = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
if (hl->cbase != 0)
Upos += (hl->csize / 10.0) * (hl->cbase / 1000.0);
if (hl->ccolor != CommonStrings::None)
tmp2 += putColor(hl->ccolor, hl->cshade, false);
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
if (hl->fillColor() != CommonStrings::None)
tmp2 += putColor(hl->fillColor(), hl->fillShade(), 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 += FToStr(hl->glyph.xoffset-kern)+" "+FToStr(-hl->glyph.yoffset+Upos)+" m\n";
tmp2 += FToStr(hl->glyph.xoffset+Ulen)+" "+FToStr(-hl->glyph.yoffset+Upos)+" l\n";
tmp2 += "S\n";
}
if (ite->asPathText())
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
226,29 → 226,29
vg.setFirstIndent(0);
vg.setGapBefore(0);
vg.setGapAfter(0);
vg.charStyle().cfont = prefsData.AvailFonts[toolSettings.defFont];
vg.charStyle().csize = toolSettings.defSize;
vg.charStyle().setFont(prefsData.AvailFonts[toolSettings.defFont]);
vg.charStyle().setFontSize(toolSettings.defSize);
vg.tabValues().clear();
vg.setHasDropCap(false);
vg.setDropCapLines(2);
vg.setDropCapOffset(0);
vg.charStyle().cstyle = ScStyle_Default;
vg.charStyle().ccolor = toolSettings.dBrush;
vg.charStyle().cshade = toolSettings.dShade;
vg.charStyle().cstroke = toolSettings.dPen;
vg.charStyle().cshade2 = toolSettings.dShade2;
vg.charStyle().cbase = false;
vg.charStyle().cshadowx = 50;
vg.charStyle().cshadowy = -50;
vg.charStyle().coutline = 10;
vg.charStyle().cunderpos = typographicSettings.valueUnderlinePos;
vg.charStyle().cunderwidth = typographicSettings.valueUnderlineWidth;
vg.charStyle().cstrikepos = typographicSettings.valueStrikeThruPos;
vg.charStyle().cstrikewidth = typographicSettings.valueStrikeThruPos;
vg.charStyle().cscale = 1000;
vg.charStyle().cscalev = 1000;
vg.charStyle().cbase = 0;
vg.charStyle().cextra = 0;
vg.setUseBaselineGrid(false);
vg.charStyle().setEffects(ScStyle_Default);
vg.charStyle().setFillColor(toolSettings.dBrush);
vg.charStyle().setFillShade(toolSettings.dShade);
vg.charStyle().setStrokeColor(toolSettings.dPen);
vg.charStyle().setStrokeShade(toolSettings.dShade2);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setUnderlineOffset(typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(typographicSettings.valueStrikeThruPos);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setTracking(0);
docParagraphStyles.append(vg);
vg.setName("Center Internal");
vg.setAlignment(1);
650,29 → 650,29
sty.setFirstIndent(docParagraphStyles[xx].firstIndent());
sty.setGapBefore(docParagraphStyles[xx].gapBefore());
sty.setGapAfter(docParagraphStyles[xx].gapAfter());
sty.charStyle().cfont = docParagraphStyles[xx].charStyle().font();
sty.charStyle().csize = docParagraphStyles[xx].charStyle().fontSize();
sty.charStyle().setFont(docParagraphStyles[xx].charStyle().font());
sty.charStyle().setFontSize(docParagraphStyles[xx].charStyle().fontSize());
sty.tabValues() = docParagraphStyles[xx].tabValues();
sty.setHasDropCap(docParagraphStyles[xx].hasDropCap());
sty.setDropCapLines(docParagraphStyles[xx].dropCapLines());
sty.setDropCapOffset(docParagraphStyles[xx].dropCapOffset());
sty.charStyle().cstyle = docParagraphStyles[xx].charStyle().cstyle;
sty.charStyle().ccolor = docParagraphStyles[xx].charStyle().ccolor;
sty.charStyle().cshade = docParagraphStyles[xx].charStyle().cshade;
sty.charStyle().cstroke = docParagraphStyles[xx].charStyle().cstroke;
sty.charStyle().cshade2 = docParagraphStyles[xx].charStyle().cshade;
sty.charStyle().setEffects(docParagraphStyles[xx].charStyle().effects());
sty.charStyle().setFillColor(docParagraphStyles[xx].charStyle().fillColor());
sty.charStyle().setFillShade(docParagraphStyles[xx].charStyle().fillShade());
sty.charStyle().setStrokeColor(docParagraphStyles[xx].charStyle().strokeColor());
sty.charStyle().setStrokeShade(docParagraphStyles[xx].charStyle().strokeShade());
sty.setUseBaselineGrid(docParagraphStyles[xx].useBaselineGrid());
sty.charStyle().cshadowx = docParagraphStyles[xx].charStyle().cshadowx;
sty.charStyle().cshadowy = docParagraphStyles[xx].charStyle().cshadowy;
sty.charStyle().coutline = docParagraphStyles[xx].charStyle().coutline;
sty.charStyle().cunderpos = docParagraphStyles[xx].charStyle().cunderpos;
sty.charStyle().cunderwidth = docParagraphStyles[xx].charStyle().cunderwidth;
sty.charStyle().cstrikepos = docParagraphStyles[xx].charStyle().cstrikepos;
sty.charStyle().cstrikewidth = docParagraphStyles[xx].charStyle().cstrikewidth;
sty.charStyle().cscale = docParagraphStyles[xx].charStyle().cscale;
sty.charStyle().cscalev = docParagraphStyles[xx].charStyle().cscalev;
sty.charStyle().cbase = docParagraphStyles[xx].charStyle().cbase;
sty.charStyle().cextra = docParagraphStyles[xx].charStyle().cextra;
sty.charStyle().setShadowXOffset(docParagraphStyles[xx].charStyle().shadowXOffset());
sty.charStyle().setShadowYOffset(docParagraphStyles[xx].charStyle().shadowYOffset());
sty.charStyle().setOutlineWidth(docParagraphStyles[xx].charStyle().outlineWidth());
sty.charStyle().setUnderlineOffset(docParagraphStyles[xx].charStyle().underlineOffset());
sty.charStyle().setUnderlineWidth(docParagraphStyles[xx].charStyle().underlineWidth());
sty.charStyle().setStrikethruOffset(docParagraphStyles[xx].charStyle().strikethruOffset());
sty.charStyle().setStrikethruWidth(docParagraphStyles[xx].charStyle().strikethruWidth());
sty.charStyle().setScaleH(docParagraphStyles[xx].charStyle().scaleH());
sty.charStyle().setScaleV(docParagraphStyles[xx].charStyle().scaleV());
sty.charStyle().setBaselineOffset(docParagraphStyles[xx].charStyle().baselineOffset());
sty.charStyle().setTracking(docParagraphStyles[xx].charStyle().tracking());
wrkStyles->append(sty);
}
}
1885,9 → 1885,9
{
for (int d=0; d<ite->itemText.length(); ++d)
{
if (it.key() == ite->itemText.charStyle(d).ccolor)
if (it.key() == ite->itemText.charStyle(d).fillColor())
found = true;
if (it.key() == ite->itemText.charStyle(d).cstroke)
if (it.key() == ite->itemText.charStyle(d).strokeColor())
found = true;
if (found)
break;
1926,7 → 1926,7
for (int d=0; d<ite->itemText.length(); ++d)
{
/* PFJ - 29.02.04 - Merged if's */
if ((it.key() == ite->itemText.charStyle(d).ccolor) || (it.key() == ite->itemText.charStyle(d).cstroke))
if ((it.key() == ite->itemText.charStyle(d).fillColor()) || (it.key() == ite->itemText.charStyle(d).strokeColor()))
found = true;
if (found)
break;
1965,7 → 1965,7
for (int d=0; d<ite->itemText.length(); ++d)
{
/* PFJ - 29.02.04 - Merged if's */
if ((it.key() == ite->itemText.charStyle(d).ccolor) || (it.key() == ite->itemText.charStyle(d).cstroke))
if ((it.key() == ite->itemText.charStyle(d).fillColor()) || (it.key() == ite->itemText.charStyle(d).strokeColor()))
found = true;
if (found)
break;
2042,7 → 2042,7
if (it->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar.isNull())
continue;
chx = QString(it->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar);
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
if ((it->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (it->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(it->itemText.paragraphStyle(e).tabValues()[t1].tabFillChar))
chx = chx.upper();
2056,7 → 2056,7
if (it->TabValues[t1].tabFillChar.isNull())
continue;
chx = QString(it->TabValues[t1].tabFillChar);
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
if ((it->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (it->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
if (chx.upper() != QString(it->TabValues[t1].tabFillChar))
chx = chx.upper();
2114,7 → 2114,7
}
continue;
}
if ((it->itemText.charStyle(e).cstyle & ScStyle_SmallCaps) || (it->itemText.charStyle(e).cstyle & ScStyle_AllCaps))
if ((it->itemText.charStyle(e).effects() & ScStyle_SmallCaps) || (it->itemText.charStyle(e).effects() & ScStyle_AllCaps))
{
chx = it->itemText.text(e, 1);
if (chx.upper() != it->itemText.text(e, 1))
3951,10 → 3951,10
{
#ifndef NLS_PROTO
for (int a = 0; a < currItem->itemText.length(); ++a)
currItem->itemText.at(a)->cfont = (*AllFonts)[fon];
currItem->itemText.at(a)->setFont((*AllFonts)[fon]);
#else
CharStyle newstyle;
newstyle.cfont = (*AllFonts)[fon];
newstyle.setFont((*AllFonts)[fon]);
currItem->itemText.applyStyle(0, currItem->itemText.length(), newstyle);
#endif
if (currItem->asPathText())
3974,10 → 3974,10
#ifndef NLS_PROTO
for (int a = 0; a < currItem->itemText.length(); ++a)
if (currItem->itemText.selected(a))
currItem->itemText.at(a)->cfont = (*AllFonts)[fon];
currItem->itemText.at(a)->setFont((*AllFonts)[fon]);
#else
CharStyle newstyle;
newstyle.cfont = (*AllFonts)[fon];
newstyle.setFont((*AllFonts)[fon]);
currItem->itemText.applyStyle(currItem->itemText.startOfSelection(),
currItem->itemText.lengthOfSelection(),
newstyle);
4041,10 → 4041,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->ccolor = farbe;
currItem->itemText.at(i)->setFillColor(farbe);
}
else
currItem->itemText.at(i)->ccolor = farbe;
currItem->itemText.at(i)->setFillColor(farbe);
}
#endif
}
4077,10 → 4077,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cshade = sha;
currItem->itemText.at(i)->setFillShade(sha);
}
else
currItem->itemText.at(i)->cshade = sha;
currItem->itemText.at(i)->setFillShade(sha);
}
#endif
}
4115,10 → 4115,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cstroke = farbe;
currItem->itemText.at(i)->setStrokeColor(farbe);
}
else
currItem->itemText.at(i)->cstroke = farbe;
currItem->itemText.at(i)->setStrokeColor(farbe);
}
#endif
}
4151,10 → 4151,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cshade2 = sha;
currItem->itemText.at(i)->setStrokeShade(sha);
}
else
currItem->itemText.at(i)->cshade2 = sha;
currItem->itemText.at(i)->setStrokeShade(sha);
}
#endif
}
4186,10 → 4186,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cscalev = sha;
currItem->itemText.at(i)->setScaleV(sha);
}
else
currItem->itemText.at(i)->cscalev = sha;
currItem->itemText.at(i)->setScaleV(sha);
}
#endif
}
4222,10 → 4222,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cscale = sha;
currItem->itemText.at(i)->setScaleH(sha);
}
else
currItem->itemText.at(i)->cscale = sha;
currItem->itemText.at(i)->setScaleH(sha);
}
#endif
}
4260,14 → 4260,14
{
if (currItem->itemText.at(i)->cselect)
{
currItem->itemText.at(i)->cshadowx = shx;
currItem->itemText.at(i)->cshadowy = shy;
currItem->itemText.at(i)->setShadowXOffset(shx);
currItem->itemText.at(i)->setShadowYOffset(shy);
}
}
else
{
currItem->itemText.at(i)->cshadowx = shx;
currItem->itemText.at(i)->cshadowy = shy;
currItem->itemText.at(i)->setShadowXOffset(shx);
currItem->itemText.at(i)->setShadowYOffset(shy);
}
}
#endif
4301,14 → 4301,14
{
if (currItem->itemText.at(i)->cselect)
{
currItem->itemText.at(i)->cunderpos = pos;
currItem->itemText.at(i)->cunderwidth = wid;
currItem->itemText.at(i)->setUnderlineOffset(pos);
currItem->itemText.at(i)->setUnderlineWidth(wid);
}
}
else
{
currItem->itemText.at(i)->cunderpos = pos;
currItem->itemText.at(i)->cunderwidth = wid;
currItem->itemText.at(i)->setUnderlineOffset(pos);
currItem->itemText.at(i)->setUnderlineWidth(wid);
}
}
#endif
4342,14 → 4342,14
{
if (currItem->itemText.at(i)->cselect)
{
currItem->itemText.at(i)->cstrikepos = pos;
currItem->itemText.at(i)->cstrikewidth = wid;
currItem->itemText.at(i)->setStrikethruOffset(pos);
currItem->itemText.at(i)->setStrikethruWidth(wid);
}
}
else
{
currItem->itemText.at(i)->cstrikepos = pos;
currItem->itemText.at(i)->cstrikewidth = wid;
currItem->itemText.at(i)->setStrikethruOffset(pos);
currItem->itemText.at(i)->setStrikethruWidth(wid);
}
}
#endif
4378,10 → 4378,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->cbase = sha;
currItem->itemText.at(i)->setBaselineOffset(sha);
}
else
currItem->itemText.at(i)->cbase = sha;
currItem->itemText.at(i)->setBaselineOffset(sha);
}
#endif
}
4409,10 → 4409,10
if (appMode == modeEdit)
{
if (currItem->itemText.at(i)->cselect)
currItem->itemText.at(i)->coutline = sha;
currItem->itemText.at(i)->setOutlineWidth(sha);
}
else
currItem->itemText.at(i)->coutline = sha;
currItem->itemText.at(i)->setOutlineWidth(sha);
}
#endif
}
4525,8 → 4525,10
{
if (currItem->itemText.at(a)->cselect)
{
currItem->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919); // 0x11101111111
currItem->itemText.at(a)->cstyle |= static_cast<StyleFlag>(s & 1919);
StyleFlag fl = currItem->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919); // 0x11101111111
fl |= static_cast<StyleFlag>(s & 1919);
currItem->itemText.at(a)->setEffects(fl);
}
}
}
4534,8 → 4536,10
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
{
currItem->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919); // 1024+512+256+64+32+16+8+4+2+1
currItem->itemText.at(a)->cstyle |= static_cast<StyleFlag>(s & 1919);
StyleFlag fl = currItem->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919); // 1024+512+256+64+32+16+8+4+2+1
fl |= static_cast<StyleFlag>(s & 1919);
currItem->itemText.at(a)->setEffects(fl);
}
}
#endif
4575,7 → 4579,7
ax = a;
for (int xx=0; xx<ax+1; ++xx)
{
if (nextItem->itemText.at(a)->ch == QChar(13))
if (nextItem->itemText.at(a)->ch == SpecialChars::PARSEP)
{
cr = false;
break;
4585,27 → 4589,29
if (docParagraphStyles[s].charStyle().font() != &Foi::NONE
&& (!nextItem->HasSel || nextItem->itemText.at(a)->cselect))
{
nextItem->itemText.at(a)->cfont = docParagraphStyles[s].charStyle().font();
nextItem->itemText.at(a)->csize = docParagraphStyles[s].charStyle().fontSize();
if (docParagraphStyles[s].charStyle().cstyle != ScStyle_None) {
nextItem->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919);
nextItem->itemText.at(a)->cstyle |= static_cast<StyleFlag>(docParagraphStyles[s].charStyle().cstyle & 1919);
nextItem->itemText.at(a)->setFont(docParagraphStyles[s].charStyle().font());
nextItem->itemText.at(a)->setFontSize(docParagraphStyles[s].charStyle().fontSize());
if (docParagraphStyles[s].charStyle().effects() != ScStyle_None) {
StyleFlag fl = nextItem->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919);
fl |= static_cast<StyleFlag>(docParagraphStyles[s].charStyle().effects() & 1919);
nextItem->itemText.at(a)->setEffects(fl);
}
nextItem->itemText.at(a)->ccolor = docParagraphStyles[s].charStyle().ccolor;
nextItem->itemText.at(a)->cshade = docParagraphStyles[s].charStyle().cshade;
nextItem->itemText.at(a)->cstroke = docParagraphStyles[s].charStyle().cstroke;
nextItem->itemText.at(a)->cshade2 = docParagraphStyles[s].charStyle().cshade2;
nextItem->itemText.at(a)->cshadowx = docParagraphStyles[s].charStyle().cshadowx;
nextItem->itemText.at(a)->cshadowy = docParagraphStyles[s].charStyle().cshadowy;
nextItem->itemText.at(a)->coutline = docParagraphStyles[s].charStyle().coutline;
nextItem->itemText.at(a)->cunderpos = docParagraphStyles[s].charStyle().cunderpos;
nextItem->itemText.at(a)->cunderwidth = docParagraphStyles[s].charStyle().cunderwidth;
nextItem->itemText.at(a)->cstrikepos = docParagraphStyles[s].charStyle().cstrikepos;
nextItem->itemText.at(a)->cstrikewidth = docParagraphStyles[s].charStyle().cstrikewidth;
nextItem->itemText.at(a)->cscale = docParagraphStyles[s].charStyle().cscale;
nextItem->itemText.at(a)->cscalev = docParagraphStyles[s].charStyle().cscalev;
nextItem->itemText.at(a)->cbase = docParagraphStyles[s].charStyle().cbase;
nextItem->itemText.at(a)->cextra = docParagraphStyles[s].charStyle().cextra;
nextItem->itemText.at(a)->setFillColor(docParagraphStyles[s].charStyle().fillColor());
nextItem->itemText.at(a)->setFillShade(docParagraphStyles[s].charStyle().fillShade());
nextItem->itemText.at(a)->setStrokeColor(docParagraphStyles[s].charStyle().strokeColor());
nextItem->itemText.at(a)->setStrokeShade(docParagraphStyles[s].charStyle().strokeShade());
nextItem->itemText.at(a)->setShadowXOffset(docParagraphStyles[s].charStyle().shadowXOffset());
nextItem->itemText.at(a)->setShadowYOffset(docParagraphStyles[s].charStyle().shadowYOffset());
nextItem->itemText.at(a)->setOutlineWidth(docParagraphStyles[s].charStyle().outlineWidth());
nextItem->itemText.at(a)->setUnderlineOffset(docParagraphStyles[s].charStyle().underlineOffset());
nextItem->itemText.at(a)->setUnderlineWidth(docParagraphStyles[s].charStyle().underlineWidth());
nextItem->itemText.at(a)->setStrikethruOffset(docParagraphStyles[s].charStyle().strikethruOffset());
nextItem->itemText.at(a)->setStrikethruWidth(docParagraphStyles[s].charStyle().strikethruWidth());
nextItem->itemText.at(a)->setScaleH(docParagraphStyles[s].charStyle().scaleH());
nextItem->itemText.at(a)->setScaleV(docParagraphStyles[s].charStyle().scaleV());
nextItem->itemText.at(a)->setBaselineOffset(docParagraphStyles[s].charStyle().baselineOffset());
nextItem->itemText.at(a)->setTracking(docParagraphStyles[s].charStyle().tracking());
}
}
if ((s < 5) && (nextItem->itemText.at(a)->cab > 4))
4640,27 → 4646,29
if (docParagraphStyles[s].charStyle().font() != &Foi::NONE
&& (!nextItem->HasSel || nextItem->itemText.at(a)->cselect))
{
nextItem->itemText.at(a)->cfont = docParagraphStyles[s].charStyle().font();
nextItem->itemText.at(a)->csize = docParagraphStyles[s].charStyle().fontSize();
if (docParagraphStyles[s].charStyle().cstyle != ScStyle_None) {
nextItem->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919);
nextItem->itemText.at(a)->cstyle |= static_cast<StyleFlag>(docParagraphStyles[s].charStyle().cstyle & 1919);
nextItem->itemText.at(a)->setFont(docParagraphStyles[s].charStyle().font());
nextItem->itemText.at(a)->setFontSize(docParagraphStyles[s].charStyle().fontSize());
if (docParagraphStyles[s].charStyle().effects() != ScStyle_None) {
StyleFlag fl = nextItem->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919);
fl |= static_cast<StyleFlag>(docParagraphStyles[s].charStyle().effects() & 1919);
nextItem->itemText.at(a)->setEffects(fl);
}
nextItem->itemText.at(a)->ccolor = docParagraphStyles[s].charStyle().ccolor;
nextItem->itemText.at(a)->cshade = docParagraphStyles[s].charStyle().cshade;
nextItem->itemText.at(a)->cstroke = docParagraphStyles[s].charStyle().cstroke;
nextItem->itemText.at(a)->cshade2 = docParagraphStyles[s].charStyle().cshade2;
nextItem->itemText.at(a)->cshadowx = docParagraphStyles[s].charStyle().cshadowx;
nextItem->itemText.at(a)->cshadowy = docParagraphStyles[s].charStyle().cshadowy;
nextItem->itemText.at(a)->coutline = docParagraphStyles[s].charStyle().coutline;
nextItem->itemText.at(a)->cunderpos = docParagraphStyles[s].charStyle().cunderpos;
nextItem->itemText.at(a)->cunderwidth = docParagraphStyles[s].charStyle().cunderwidth;
nextItem->itemText.at(a)->cstrikepos = docParagraphStyles[s].charStyle().cstrikepos;
nextItem->itemText.at(a)->cstrikewidth = docParagraphStyles[s].charStyle().cstrikewidth;
nextItem->itemText.at(a)->cscale = docParagraphStyles[s].charStyle().cscale;
nextItem->itemText.at(a)->cscalev = docParagraphStyles[s].charStyle().cscalev;
nextItem->itemText.at(a)->cbase = docParagraphStyles[s].charStyle().cbase;
nextItem->itemText.at(a)->cextra = docParagraphStyles[s].charStyle().cextra;
nextItem->itemText.at(a)->setFillColor(docParagraphStyles[s].charStyle().fillColor());
nextItem->itemText.at(a)->setFillShade(docParagraphStyles[s].charStyle().fillShade());
nextItem->itemText.at(a)->setStrokeColor(docParagraphStyles[s].charStyle().strokeColor());
nextItem->itemText.at(a)->setStrokeShade(docParagraphStyles[s].charStyle().strokeShade());
nextItem->itemText.at(a)->setShadowXOffset(docParagraphStyles[s].charStyle().shadowXOffset());
nextItem->itemText.at(a)->setShadowYOffset(docParagraphStyles[s].charStyle().shadowYOffset());
nextItem->itemText.at(a)->setOutlineWidth(docParagraphStyles[s].charStyle().outlineWidth());
nextItem->itemText.at(a)->setUnderlineOffset(docParagraphStyles[s].charStyle().underlineOffset());
nextItem->itemText.at(a)->setUnderlineWidth(docParagraphStyles[s].charStyle().underlineWidth());
nextItem->itemText.at(a)->setStrikethruOffset(docParagraphStyles[s].charStyle().strikethruOffset());
nextItem->itemText.at(a)->setStrikethruWidth(docParagraphStyles[s].charStyle().strikethruWidth());
nextItem->itemText.at(a)->setScaleH(docParagraphStyles[s].charStyle().scaleH());
nextItem->itemText.at(a)->setScaleV(docParagraphStyles[s].charStyle().scaleV());
nextItem->itemText.at(a)->setBaselineOffset(docParagraphStyles[s].charStyle().baselineOffset());
nextItem->itemText.at(a)->setTracking(docParagraphStyles[s].charStyle().tracking());
}
}
if ((s < 5) && (nextItem->itemText.at(a)->cab > 4))
4722,25 → 4730,29
{
if (docParagraphStyles[s].charStyle().font() != &Foi::NONE)
{
currItem->itemText.at(a)->cfont = docParagraphStyles[s].charStyle().font();
currItem->itemText.at(a)->csize = docParagraphStyles[s].charStyle().fontSize();
currItem->itemText.at(a)->cstyle &= static_cast<StyleFlag>(~1919);
currItem->itemText.at(a)->cstyle |= docParagraphStyles[s].charStyle().cstyle;
currItem->itemText.at(a)->ccolor = docParagraphStyles[s].charStyle().ccolor;
currItem->itemText.at(a)->cshade = docParagraphStyles[s].charStyle().cshade;
currItem->itemText.at(a)->cstroke = docParagraphStyles[s].charStyle().cstroke;
currItem->itemText.at(a)->cshade2 = docParagraphStyles[s].charStyle().cshade2;
currItem->itemText.at(a)->cshadowx = docParagraphStyles[s].charStyle().cshadowx;
currItem->itemText.at(a)->cshadowy = docParagraphStyles[s].charStyle().cshadowy;
currItem->itemText.at(a)->coutline = docParagraphStyles[s].charStyle().coutline;
currItem->itemText.at(a)->cunderpos = docParagraphStyles[s].charStyle().cunderpos;
currItem->itemText.at(a)->cunderwidth = docParagraphStyles[s].charStyle().cunderwidth;
currItem->itemText.at(a)->cstrikepos = docParagraphStyles[s].charStyle().cstrikepos;
currItem->itemText.at(a)->cstrikewidth = docParagraphStyles[s].charStyle().cstrikewidth;
currItem->itemText.at(a)->cscale = docParagraphStyles[s].charStyle().cscale;
currItem->itemText.at(a)->cscalev = docParagraphStyles[s].charStyle().cscalev;
currItem->itemText.at(a)->cbase = docParagraphStyles[s].charStyle().cbase;
currItem->itemText.at(a)->cextra = docParagraphStyles[s].charStyle().cextra;
currItem->itemText.at(a)->setFont(docParagraphStyles[s].charStyle().font());
currItem->itemText.at(a)->setFontSize(docParagraphStyles[s].charStyle().fontSize());
if (docParagraphStyles[s].charStyle().effects() != ScStyle_None) {
StyleFlag fl = currItem->itemText.at(a)->effects();
fl &= static_cast<StyleFlag>(~1919);
fl |= static_cast<StyleFlag>(docParagraphStyles[s].charStyle().effects() & 1919);
currItem->itemText.at(a)->setEffects(fl);
}
currItem->itemText.at(a)->setFillColor(docParagraphStyles[s].charStyle().fillColor());
currItem->itemText.at(a)->setFillShade(docParagraphStyles[s].charStyle().fillShade());
currItem->itemText.at(a)->setStrokeColor(docParagraphStyles[s].charStyle().strokeColor());
currItem->itemText.at(a)->setStrokeShade(docParagraphStyles[s].charStyle().strokeShade());
currItem->itemText.at(a)->setShadowXOffset(docParagraphStyles[s].charStyle().shadowXOffset());
currItem->itemText.at(a)->setShadowYOffset(docParagraphStyles[s].charStyle().shadowYOffset());
currItem->itemText.at(a)->setOutlineWidth(docParagraphStyles[s].charStyle().outlineWidth());
currItem->itemText.at(a)->setUnderlineOffset(docParagraphStyles[s].charStyle().underlineOffset());
currItem->itemText.at(a)->setUnderlineWidth(docParagraphStyles[s].charStyle().underlineWidth());
currItem->itemText.at(a)->setStrikethruOffset(docParagraphStyles[s].charStyle().strikethruOffset());
currItem->itemText.at(a)->setStrikethruWidth(docParagraphStyles[s].charStyle().strikethruWidth());
currItem->itemText.at(a)->setScaleH(docParagraphStyles[s].charStyle().scaleH());
currItem->itemText.at(a)->setScaleV(docParagraphStyles[s].charStyle().scaleV());
currItem->itemText.at(a)->setBaselineOffset(docParagraphStyles[s].charStyle().baselineOffset());
currItem->itemText.at(a)->setTracking(docParagraphStyles[s].charStyle().tracking());
}
}
if ((s < 5) && (currItem->itemText.at(a)->cab > 4))
4814,7 → 4826,7
for (uint a = 0; a < currItem->itemText.count(); ++a)
{
if (currItem->itemText.at(a)->cselect)
currItem->itemText.at(a)->cextra = us;
currItem->itemText.at(a)->setTracking(us);
}
emit refreshItem(currItem);
}
4829,7 → 4841,7
{
for (uint a = 0; a < currItem->itemText.count(); ++a)
{
currItem->itemText.at(a)->cextra = us;
currItem->itemText.at(a)->setTracking(us);
}
emit refreshItem(currItem);
}
4914,7 → 4926,7
for (uint a = 0; a < currItemTextCount; ++a)
{
if (currItem->itemText.at(a)->cselect)
currItem->itemText.at(a)->csize = size;
currItem->itemText.at(a)->setFontSize(size);
}
}
else
4922,7 → 4934,7
for (uint a = 0; a < currItemTextCount; ++a)
{
if (currItem->itemText.at(a)->cab < 5)
currItem->itemText.at(a)->csize = size;
currItem->itemText.at(a)->setFontSize(size);
}
}
if (currItem->asPathText())
/branches/Version13x/Scribus/scribus/editformats.cpp
295,22 → 295,22
sty.setHasDropCap(false);
sty.setDropCapLines(2);
sty.setDropCapOffset(0);
sty.charStyle().ccolor = Docu->toolSettings.dBrush;
sty.charStyle().cshade = Docu->toolSettings.dShade;
sty.charStyle().cstroke = Docu->toolSettings.dPen;
sty.charStyle().cshade2 = Docu->toolSettings.dShade2;
sty.charStyle().setFillColor(Docu->toolSettings.dBrush);
sty.charStyle().setFillShade(Docu->toolSettings.dShade);
sty.charStyle().setStrokeColor(Docu->toolSettings.dPen);
sty.charStyle().setStrokeShade(Docu->toolSettings.dShade2);
sty.setUseBaselineGrid(false);
sty.charStyle().cshadowx = 50;
sty.charStyle().cshadowy = -50;
sty.charStyle().coutline = 10;
sty.charStyle().cunderpos = Docu->typographicSettings.valueUnderlinePos;
sty.charStyle().cunderwidth = Docu->typographicSettings.valueUnderlineWidth;
sty.charStyle().cstrikepos = Docu->typographicSettings.valueStrikeThruPos;
sty.charStyle().cstrikewidth = Docu->typographicSettings.valueStrikeThruPos;
sty.charStyle().cscale = 1000;
sty.charStyle().cscalev = 1000;
sty.charStyle().cbase = 0;
sty.charStyle().cextra = 0;
sty.charStyle().setShadowXOffset(50);
sty.charStyle().setShadowYOffset(-50);
sty.charStyle().setOutlineWidth(10);
sty.charStyle().setUnderlineOffset(Docu->typographicSettings.valueUnderlinePos);
sty.charStyle().setUnderlineWidth(Docu->typographicSettings.valueUnderlineWidth);
sty.charStyle().setStrikethruOffset(Docu->typographicSettings.valueStrikeThruPos);
sty.charStyle().setStrikethruWidth(Docu->typographicSettings.valueStrikeThruPos);
sty.charStyle().setScaleH(1000);
sty.charStyle().setScaleV(1000);
sty.charStyle().setBaselineOffset(0);
sty.charStyle().setTracking(0);
TempVorl.append(sty);
sFnumber = TempVorl.count()-1;
EditStyle* dia2 = new EditStyle(this, &TempVorl[sFnumber], TempVorl, true, static_cast<double>(Docu->typographicSettings.autoLineSpacing), Docu->unitIndex(), Docu);
405,10 → 405,10
{
sty = TempVorl2[it.data()];
TempVorl.append(sty);
if ((!Docu->PageColors.contains(sty.charStyle().cstroke)) && (!neededColors.contains(sty.charStyle().cstroke)))
neededColors.append(sty.charStyle().cstroke);
if ((!Docu->PageColors.contains(sty.charStyle().ccolor)) && (!neededColors.contains(sty.charStyle().ccolor)))
neededColors.append(sty.charStyle().ccolor);
if ((!Docu->PageColors.contains(sty.charStyle().strokeColor())) && (!neededColors.contains(sty.charStyle().strokeColor())))
neededColors.append(sty.charStyle().strokeColor());
if ((!Docu->PageColors.contains(sty.charStyle().fillColor())) && (!neededColors.contains(sty.charStyle().fillColor())))
neededColors.append(sty.charStyle().fillColor());
}
}
if (!neededColors.isEmpty())
/branches/Version13x/Scribus/scribus/sampleitem.cpp
54,29 → 54,29
tmpStyle.setFirstIndent(0);
tmpStyle.setGapBefore(0);
tmpStyle.setGapAfter(0);
tmpStyle.charStyle().cfont = PrefsManager::instance()->appPrefs.AvailFonts[doc->toolSettings.defFont];
tmpStyle.charStyle().csize = doc->toolSettings.defSize;
tmpStyle.charStyle().setFont(PrefsManager::instance()->appPrefs.AvailFonts[doc->toolSettings.defFont]);
tmpStyle.charStyle().setFontSize(doc->toolSettings.defSize);
tmpStyle.tabValues().clear();
tmpStyle.setHasDropCap(false);
tmpStyle.setDropCapLines(0);//2;
tmpStyle.setDropCapOffset(0);
tmpStyle.charStyle().cstyle = ScStyle_Default;
tmpStyle.charStyle().ccolor = "__blackforpreview__";
tmpStyle.charStyle().cshade = 100; //doc->toolSettings.dShade;
tmpStyle.charStyle().cstroke = "__whiteforpreview__";
tmpStyle.charStyle().cshade2 = 100; //doc->toolSettings.dShade2;
tmpStyle.charStyle().setEffects(ScStyle_Default);
tmpStyle.charStyle().setFillColor("__blackforpreview__");
tmpStyle.charStyle().setFillShade(100); //doc->toolSettings.dShade;
tmpStyle.charStyle().setStrokeColor("__whiteforpreview__");
tmpStyle.charStyle().setStrokeShade(100); //doc->toolSettings.dShade2;
tmpStyle.setUseBaselineGrid(false);
tmpStyle.charStyle().cshadowx = 50;
tmpStyle.charStyle().cshadowy = -50;
tmpStyle.charStyle().coutline = 10;
tmpStyle.charStyle().cunderpos = 0; //doc->typographicSettings.valueUnderlinePos;
tmpStyle.charStyle().cunderwidth = 0; //doc->typographicSettings.valueUnderlineWidth;
tmpStyle.charStyle().cstrikepos = 0; //doc->typographicSettings.valueStrikeThruPos;
tmpStyle.charStyle().cstrikewidth = 0; //doc->typographicSettings.valueStrikeThruPos;
tmpStyle.charStyle().cscale = 1000;
tmpStyle.charStyle().cscalev = 1000;
tmpStyle.charStyle().cbase = 0;
tmpStyle.charStyle().cextra = 0;
tmpStyle.charStyle().setShadowXOffset(50);
tmpStyle.charStyle().setShadowYOffset(-50);
tmpStyle.charStyle().setOutlineWidth(10);
tmpStyle.charStyle().setUnderlineOffset(0); //doc->typographicSettings.valueUnderlinePos;
tmpStyle.charStyle().setUnderlineWidth(0); //doc->typographicSettings.valueUnderlineWidth;
tmpStyle.charStyle().setStrikethruOffset(0); //doc->typographicSettings.valueStrikeThruPos;
tmpStyle.charStyle().setStrikethruWidth(0); //doc->typographicSettings.valueStrikeThruPos;
tmpStyle.charStyle().setScaleH(1000);
tmpStyle.charStyle().setScaleV(1000);
tmpStyle.charStyle().setBaselineOffset(0);
tmpStyle.charStyle().setTracking(0);
}
 
SampleItem::~SampleItem()
125,7 → 125,7
 
void SampleItem::setTxShade(int c)
{
tmpStyle.charStyle().cshade = c;
tmpStyle.charStyle().setFillShade(c);
}
 
void SampleItem::setLineSpaMode(int lineSpaMode)
165,12 → 165,12
 
void SampleItem::setFont(QString font)
{
tmpStyle.charStyle().cfont = PrefsManager::instance()->appPrefs.AvailFonts[font];
tmpStyle.charStyle().setFont(PrefsManager::instance()->appPrefs.AvailFonts[font]);
}
 
void SampleItem::setFontSize(int fontSize, bool autoLineSpa)
{
tmpStyle.charStyle().csize = fontSize;
tmpStyle.charStyle().setFontSize(fontSize);
if (autoLineSpa)
tmpStyle.setLineSpacing(((fontSize / 10) * (doc->typographicSettings.autoLineSpacing / 100) + (fontSize / 10)));
}
197,27 → 197,27
 
void SampleItem::setFontEffect(int fontEffect)
{
tmpStyle.charStyle().cstyle = static_cast<StyleFlag>(fontEffect);
tmpStyle.charStyle().setEffects(static_cast<StyleFlag>(fontEffect));
}
 
void SampleItem::setFColor(QString fColor)
{
tmpStyle.charStyle().ccolor = fColor;
tmpStyle.charStyle().setFillColor(fColor);
}
 
void SampleItem::setFShade(int fShade)
{
tmpStyle.charStyle().cshade = fShade;
tmpStyle.charStyle().setFillShade(fShade);
}
 
void SampleItem::setSColor(QString sColor)
{
tmpStyle.charStyle().ccolor = sColor;
tmpStyle.charStyle().setStrokeColor(sColor);
}
 
void SampleItem::setSShade(int sShade)
{
tmpStyle.charStyle().cstroke = sShade;
tmpStyle.charStyle().setStrokeShade(sShade);
}
 
void SampleItem::setBaseAdj(bool baseAdj)
227,57 → 227,57
 
void SampleItem::setTxtShadowX(int txtShadowX)
{
tmpStyle.charStyle().cshadowx = txtShadowX;
tmpStyle.charStyle().setShadowXOffset(txtShadowX);
}
 
void SampleItem::setTxtShadowY(int txtShadowY)
{
tmpStyle.charStyle().cshadowy = txtShadowY;
tmpStyle.charStyle().setShadowYOffset(txtShadowY);
}
 
void SampleItem::setTxtOutline(int txtOutline)
{
tmpStyle.charStyle().coutline = txtOutline;
tmpStyle.charStyle().setOutlineWidth(txtOutline);
}
 
void SampleItem::setTxtUnderPos(int txtUnderPos)
{
tmpStyle.charStyle().cunderpos = txtUnderPos;
tmpStyle.charStyle().setUnderlineOffset(txtUnderPos);
}
 
void SampleItem::setTxtUnderWidth(int txtUnderWidth)
{
tmpStyle.charStyle().cunderwidth = txtUnderWidth;
tmpStyle.charStyle().setUnderlineWidth(txtUnderWidth);
}
 
void SampleItem::setTxtStrikePos(int txtStrikePos)
{
tmpStyle.charStyle().cstrikepos = txtStrikePos;
tmpStyle.charStyle().setStrikethruOffset(txtStrikePos);
}
 
void SampleItem::setTxtStrikeWidth(int txtStrikeWidth)
{
tmpStyle.charStyle().cstrikewidth = txtStrikeWidth;
tmpStyle.charStyle().setStrikethruWidth(txtStrikeWidth);
}
 
void SampleItem::setScaleH(int scaleH)
{
tmpStyle.charStyle().cscale = scaleH;
tmpStyle.charStyle().setScaleH(scaleH);
}
 
void SampleItem::setScaleV(int scaleV)
{
tmpStyle.charStyle().cscalev = scaleV;
tmpStyle.charStyle().setScaleV(scaleV);
}
 
void SampleItem::setBaseOff(int baseOff)
{
tmpStyle.charStyle().cbase = baseOff;
tmpStyle.charStyle().setBaselineOffset(baseOff);
}
 
void SampleItem::setKernVal(int kernVal)
{
tmpStyle.charStyle().cextra = kernVal;
tmpStyle.charStyle().setTracking(kernVal);
}
 
QPixmap SampleItem::getSample(int width, int height)
330,7 → 330,7
 
// cleanups and resets
if (!previouslyUsedFont)
doc->UsedFonts.remove(tmpStyle.charStyle().cfont->scName());
doc->UsedFonts.remove(tmpStyle.charStyle().font()->scName());
if (ScMW->view != NULL)
ScMW->view->setScale(sca);
doc->appMode = userAppMode;
/branches/Version13x/Scribus/scribus/scribusXml.cpp
139,15 → 139,14
if (hg->ch == QChar(4))
hg->ch = QChar(9);
if (unknown)
hg->cfont = dummy;
hg->setFont(dummy);
else
hg->cfont = (*doc->AllFonts)[tmpf];
hg->csize = size;
hg->ccolor = fcolor;
hg->cextra = extra;
hg->cshade = shade;
hg->cselect = false;
hg->cstyle = static_cast<StyleFlag>(cstyle);
hg->setFont((*doc->AllFonts)[tmpf]);
hg->setFontSize(size);
hg->setFillColor(fcolor);
hg->setTracking(extra);
hg->setFillShade(shade);
hg->setEffects(static_cast<StyleFlag>(cstyle));
if (impo)
{
if (VorLFound)
162,24 → 161,18
}
else
hg->cab = ab;
hg->cstroke = stroke;
hg->cshade2 = shade2;
hg->cscale = QMIN(QMAX(scale, 100), 4000);
hg->cscalev = QMIN(QMAX(scalev, 100), 4000);
hg->cbase = base;
hg->cshadowx = shX;
hg->cshadowy = shY;
hg->coutline = outL;
hg->cunderpos = ulp;
hg->cunderwidth = ulw;
hg->cstrikepos = stp;
hg->cstrikewidth = stw;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setStrokeColor(stroke);
hg->setStrokeShade(shade2);
hg->setScaleH(QMIN(QMAX(scale, 100), 4000));
hg->setScaleV(QMIN(QMAX(scalev, 100), 4000));
hg->setBaselineOffset(base);
hg->setShadowXOffset(shX);
hg->setShadowYOffset(shY);
hg->setOutlineWidth(outL);
hg->setUnderlineOffset(ulp);
hg->setUnderlineWidth(ulw);
hg->setStrikethruOffset(stp);
hg->setStrikethruWidth(stw);
obj->itemText.append(hg);
}
#else
486,28 → 479,28
tmpf = AskForFont(prefsManager->appPrefs.AvailFonts, tmpf, doc);
else
tmpf = DoFonts[tmf];
vg->charStyle().cfont = prefsManager->appPrefs.AvailFonts[tmpf];
vg->charStyle().csize = qRound(pg->attribute("FONTSIZE", "12").toDouble() * 10.0);
vg->charStyle().setFont(prefsManager->appPrefs.AvailFonts[tmpf]);
vg->charStyle().setFontSize(qRound(pg->attribute("FONTSIZE", "12").toDouble() * 10.0));
vg->setHasDropCap(static_cast<bool>(pg->attribute("DROP", "0").toInt()));
vg->setDropCapLines(pg->attribute("DROPLIN", "2").toInt());
vg->setDropCapOffset(pg->attribute("DROPDIST", "0").toDouble());
vg->charStyle().cstyle = static_cast<StyleFlag>(pg->attribute("EFFECT", "0").toInt());
vg->charStyle().ccolor = pg->attribute("FCOLOR", doc->toolSettings.dBrush);
vg->charStyle().cshade = pg->attribute("FSHADE", "100").toInt();
vg->charStyle().cstroke = pg->attribute("SCOLOR", doc->toolSettings.dPen);
vg->charStyle().cshade2 = pg->attribute("SSHADE", "100").toInt();
vg->charStyle().setEffects(static_cast<StyleFlag>(pg->attribute("EFFECT", "0").toInt()));
vg->charStyle().setFillColor(pg->attribute("FCOLOR", doc->toolSettings.dBrush));
vg->charStyle().setFillShade(pg->attribute("FSHADE", "100").toInt());
vg->charStyle().setStrokeColor(pg->attribute("SCOLOR", doc->toolSettings.dPen));
vg->charStyle().setStrokeShade(pg->attribute("SSHADE", "100").toInt());
vg->setUseBaselineGrid(static_cast<bool>(pg->attribute("BASE", "0").toInt()));
vg->charStyle().cshadowx = qRound(pg->attribute("TXTSHX", "5").toDouble() * 10);
vg->charStyle().cshadowy = qRound(pg->attribute("TXTSHY", "-5").toDouble() * 10);
vg->charStyle().coutline = qRound(pg->attribute("TXTOUT", "1").toDouble() * 10);
vg->charStyle().cunderpos = qRound(pg->attribute("TXTULP", "-0.1").toDouble() * 10);
vg->charStyle().cunderwidth = qRound(pg->attribute("TXTULW", "-0.1").toDouble() * 10);
vg->charStyle().cstrikepos = qRound(pg->attribute("TXTSTP", "-0.1").toDouble() * 10);
vg->charStyle().cstrikewidth = qRound(pg->attribute("TXTSTW", "-0.1").toDouble() * 10);
vg->charStyle().cscale = qRound(pg->attribute("SCALEH", "100").toDouble() * 10);
vg->charStyle().cscalev = qRound(pg->attribute("SCALEV", "100").toDouble() * 10);
vg->charStyle().cbase = qRound(pg->attribute("BASEO", "0").toDouble() * 10);
vg->charStyle().cextra = qRound(pg->attribute("KERN", "0").toDouble() * 10);
vg->charStyle().setShadowXOffset(qRound(pg->attribute("TXTSHX", "5").toDouble() * 10));
vg->charStyle().setShadowYOffset(qRound(pg->attribute("TXTSHY", "-5").toDouble() * 10));
vg->charStyle().setOutlineWidth(qRound(pg->attribute("TXTOUT", "1").toDouble() * 10));
vg->charStyle().setUnderlineOffset(qRound(pg->attribute("TXTULP", "-0.1").toDouble() * 10));
vg->charStyle().setUnderlineWidth(qRound(pg->attribute("TXTULW", "-0.1").toDouble() * 10));
vg->charStyle().setStrikethruOffset(qRound(pg->attribute("TXTSTP", "-0.1").toDouble() * 10));
vg->charStyle().setStrikethruWidth(qRound(pg->attribute("TXTSTW", "-0.1").toDouble() * 10));
vg->charStyle().setScaleH(qRound(pg->attribute("SCALEH", "100").toDouble() * 10));
vg->charStyle().setScaleV(qRound(pg->attribute("SCALEV", "100").toDouble() * 10));
vg->charStyle().setBaselineOffset(qRound(pg->attribute("BASEO", "0").toDouble() * 10));
vg->charStyle().setTracking(qRound(pg->attribute("KERN", "0").toDouble() * 10));
vg->tabValues().clear();
if ((pg->hasAttribute("NUMTAB")) && (pg->attribute("NUMTAB", "0").toInt() != 0))
{
1063,22 → 1056,22
fo.appendChild(tabs);
}
}
fo.setAttribute("FCOLOR",UsedStyles[actSt].charStyle().ccolor);
fo.setAttribute("FSHADE",UsedStyles[actSt].charStyle().cshade);
fo.setAttribute("SCOLOR",UsedStyles[actSt].charStyle().cstroke);
fo.setAttribute("SSHADE",UsedStyles[actSt].charStyle().cshade2);
fo.setAttribute("FCOLOR",UsedStyles[actSt].charStyle().fillColor());
fo.setAttribute("FSHADE",UsedStyles[actSt].charStyle().fillShade());
fo.setAttribute("SCOLOR",UsedStyles[actSt].charStyle().strokeColor());
fo.setAttribute("SSHADE",UsedStyles[actSt].charStyle().strokeShade());
fo.setAttribute("BASE", static_cast<int>(UsedStyles[actSt].useBaselineGrid()));
fo.setAttribute("TXTSHX",UsedStyles[actSt].charStyle().cshadowx / 10.0);
fo.setAttribute("TXTSHY",UsedStyles[actSt].charStyle().cshadowy / 10.0);
fo.setAttribute("TXTOUT",UsedStyles[actSt].charStyle().coutline / 10.0);
fo.setAttribute("TXTULP",UsedStyles[actSt].charStyle().cunderpos / 10.0);
fo.setAttribute("TXTULW",UsedStyles[actSt].charStyle().cunderwidth / 10.0);
fo.setAttribute("TXTSTP",UsedStyles[actSt].charStyle().cstrikepos / 10.0);
fo.setAttribute("TXTSTW",UsedStyles[actSt].charStyle().cstrikewidth / 10.0);
fo.setAttribute("SCALEH",UsedStyles[actSt].charStyle().cscale / 10.0);
fo.setAttribute("SCALEV",UsedStyles[actSt].charStyle().cscalev / 10.0);
fo.setAttribute("BASEO",UsedStyles[actSt].charStyle().cbase / 10.0);
fo.setAttribute("KERN",UsedStyles[actSt].charStyle().cextra / 10.0);
fo.setAttribute("TXTSHX",UsedStyles[actSt].charStyle().shadowXOffset() / 10.0);
fo.setAttribute("TXTSHY",UsedStyles[actSt].charStyle().shadowYOffset() / 10.0);
fo.setAttribute("TXTOUT",UsedStyles[actSt].charStyle().outlineWidth() / 10.0);
fo.setAttribute("TXTULP",UsedStyles[actSt].charStyle().underlineOffset() / 10.0);
fo.setAttribute("TXTULW",UsedStyles[actSt].charStyle().underlineWidth() / 10.0);
fo.setAttribute("TXTSTP",UsedStyles[actSt].charStyle().strikethruOffset() / 10.0);
fo.setAttribute("TXTSTW",UsedStyles[actSt].charStyle().strikethruWidth() / 10.0);
fo.setAttribute("SCALEH",UsedStyles[actSt].charStyle().scaleH() / 10.0);
fo.setAttribute("SCALEV",UsedStyles[actSt].charStyle().scaleV() / 10.0);
fo.setAttribute("BASEO",UsedStyles[actSt].charStyle().baselineOffset() / 10.0);
fo.setAttribute("KERN",UsedStyles[actSt].charStyle().tracking() / 10.0);
elem.appendChild(fo);
}
}
1224,12 → 1217,12
const CharStyle& style4(item->itemText.charStyle(k));
QChar ch = item->itemText.text(k);
QDomElement it=docu.createElement("ITEXT");
ts = style4.csize / 10.0;
tf = style4.cfont->scName();
tc = style4.ccolor;
te = style4.cextra;
tsh = style4.cshade;
tst = style4.cstyle & 2047;
ts = style4.fontSize() / 10.0;
tf = style4.font()->scName();
tc = style4.fillColor();
te = style4.tracking();
tsh = style4.fillShade();
tst = style4.effects() & 2047;
#ifndef NLS_PROTO
if (item->itemText.at(k)->cab > 4)
tsb = UsedMapped2Saved[item->itemText.at(k)->cab];
1238,21 → 1231,21
#else
tsb = 0;
#endif
tcs = style4.cstroke;
tshs = style4.cshade2;
tsc = style4.cscale / 10.0;
tscv = style4.cscalev / 10.0;
tb = style4.cbase / 10.0;
tsx = style4.cshadowx / 10.0;
tsy = style4.cshadowy / 10.0;
tout = style4.coutline / 10.0;
tulp = style4.cunderpos / 10.0;
tulw = style4.cunderwidth / 10.0;
tstp = style4.cstrikepos / 10.0;
tstw = style4.cstrikewidth / 10.0;
if (ch == QChar(13))
tcs = style4.strokeColor();
tshs = style4.strokeShade();
tsc = style4.scaleH() / 10.0;
tscv = style4.scaleV() / 10.0;
tb = style4.baselineOffset() / 10.0;
tsx = style4.shadowXOffset() / 10.0;
tsy = style4.shadowYOffset() / 10.0;
tout = style4.outlineWidth() / 10.0;
tulp = style4.underlineOffset() / 10.0;
tulw = style4.underlineWidth() / 10.0;
tstp = style4.strikethruOffset()/ 10.0;
tstw = style4.strikethruWidth() / 10.0;
if (ch == SpecialChars::PARSEP)
text = QChar(5);
else if (ch == QChar(9))
else if (ch == SpecialChars::TAB)
text = QChar(4);
else
text = ch;
1284,12 → 1277,12
}
const CharStyle& style5(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style5.csize / 10.0;
tf2 = style5.cfont->scName();
tc2 = style5.ccolor;
te2 = style5.cextra;
tsh2 = style5.cshade;
tst2 = style5.cstyle & 2047;
ts2 = style5.fontSize() / 10.0;
tf2 = style5.font()->scName();
tc2 = style5.fillColor();
te2 = style5.tracking();
tsh2 = style5.fillShade();
tst2 = style5.effects() & 2047;
#ifndef NLS_PROTO
if (item->itemText.at(k)->cab > 4)
tsb2 = UsedMapped2Saved[item->itemText.at(k)->cab];
1298,18 → 1291,18
#else
tsb2 = 0;
#endif
tcs2 = style5.cstroke;
tshs2 = style5.cshade2;
tsc2 = style5.cscale / 10.0;
tscv2 = style5.cscalev / 10.0;
tb2 = style5.cbase / 10.0;
tsx2 = style5.cshadowx / 10.0;
tsy2 = style5.cshadowy / 10.0;
tout2 = style5.coutline / 10.0;
tulp2 = style5.cunderpos / 10.0;
tulw2 = style5.cunderwidth / 10.0;
tstp2 = style5.cstrikepos / 10.0;
tstw2 = style5.cstrikewidth / 10.0;
tcs2 = style5.strokeColor();
tshs2 = style5.strokeShade();
tsc2 = style5.scaleH() / 10.0;
tscv2 = style5.scaleV() / 10.0;
tb2 = style5.baselineOffset() / 10.0;
tsx2 = style5.shadowXOffset() / 10.0;
tsy2 = style5.shadowYOffset() / 10.0;
tout2 = style5.outlineWidth() / 10.0;
tulp2 = style5.underlineOffset() / 10.0;
tulw2 = style5.underlineWidth() / 10.0;
tstp2 = style5.strikethruOffset() / 10.0;
tstw2 = style5.strikethruWidth() / 10.0;
while ((ts2 == ts)
&& (tsb2 == tsb)
&& (tf2 == tf)
1341,12 → 1334,12
break;
const CharStyle& style6(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style6.csize / 10.0;
tf2 = style6.cfont->scName();
tc2 = style6.ccolor;
te2 = style6.cextra;
tsh2 = style6.cshade;
tst2 = style6.cstyle & 2047;
ts2 = style6.fontSize() / 10.0;
tf2 = style6.font()->scName();
tc2 = style6.fillColor();
te2 = style6.tracking();
tsh2 = style6.fillShade();
tst2 = style6.effects() & 2047;
#ifndef NLS_PROTO
if (item->itemText.at(k)->cab > 4)
tsb2 = UsedMapped2Saved[item->itemText.at(k)->cab];
1355,18 → 1348,18
#else
tsb2 = 0;
#endif
tcs2 = style6.cstroke;
tshs2 = style6.cshade2;
tsc2 = style6.cscale / 10.0;
tscv2 = style6.cscalev / 10.0;
tb2 = style6.cbase / 10.0;
tsx2 = style6.cshadowx / 10.0;
tsy2 = style6.cshadowy / 10.0;
tout2 = style6.coutline / 10.0;
tulp2 = style6.cunderpos / 10.0;
tulw2 = style6.cunderwidth / 10.0;
tstp2 = style6.cstrikepos / 10.0;
tstw2 = style6.cstrikewidth / 10.0;
tcs2 = style6.strokeColor();
tshs2 = style6.strokeShade();
tsc2 = style6.scaleH() / 10.0;
tscv2 = style6.scaleV() / 10.0;
tb2 = style6.baselineOffset() / 10.0;
tsx2 = style6.shadowXOffset() / 10.0;
tsy2 = style6.shadowYOffset() / 10.0;
tout2 = style6.outlineWidth() / 10.0;
tulp2 = style6.underlineOffset() / 10.0;
tulw2 = style6.underlineWidth() / 10.0;
tstp2 = style6.strikethruOffset() / 10.0;
tstw2 = style6.strikethruWidth() / 10.0;
}
it.setAttribute("CH",text);
it.setAttribute("CSIZE",ts);
1395,7 → 1388,7
QString txnu = "";
for(int kt = 0; kt < item->itemText.length(); ++kt)
#ifndef NLS_PROTO
txnu += tmp.setNum(item->itemText.at(kt)->xp) + " " + tmpy.setNum(item->itemText.at(kt)->yp) + " ";
txnu += tmp.setNum(item->itemText.at(kt)->glyph.xoffset) + " " + tmpy.setNum(item->itemText.at(kt)->glyph.yoffset) + " ";
#else
txnu += "0 0 ";
#endif
/branches/Version13x/Scribus/scribus/pageitem_pathtext.cpp
96,7 → 96,7
}
}
if (itemText.length() != 0)
CurX += itemText.charStyle(0).csize * itemText.charStyle(0).cextra / 10000.0;
CurX += itemText.charStyle(0).fontSize() * itemText.charStyle(0).tracking() / 10000.0;
segLen = PoLine.lenPathSeg(seg);
#ifndef NLS_PROTO
for (a = 0; a < itemText.length(); ++a)
106,7 → 106,7
chx = hl->ch;
if ((chx == QChar(30)) || (chx == QChar(13)) || (chx == QChar(9)) || (chx == QChar(28)))
continue;
chs = hl->csize;
chs = hl->fontSize();
SetZeichAttr(*hl, &chs, &chx);
if (chx == QChar(29))
chx2 = " ";
122,11 → 122,11
chx3 = "-";
else
chx3 = itemText.at(a+1)->ch;
wide = Cwidth(m_Doc, hl->cfont, chx2, chs, chx3);
wide = Cwidth(m_Doc, hl->font(), chx2, chs, chx3);
}
else
wide = Cwidth(m_Doc, hl->cfont, chx2, chs);
wide = wide * (hl->cscale / 1000.0);
wide = Cwidth(m_Doc, hl->font(), chx2, chs);
wide = wide * (hl->scaleH() / 1000.0);
dx = wide / 2.0;
CurX += dx;
ext = false;
181,8 → 181,8
else
break;
}
hl->xp = point.x();
hl->yp = point.y();
hl->glyph.xoffset = point.x();
hl->glyph.yoffset = point.y();
hl->PtransX = tangent.x();
hl->PtransY = tangent.y();
hl->PRot = dx;
195,41 → 195,41
p->setWorldMatrix(trafo);
Zli = new ZZ;
Zli->Zeich = chx;
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
QColor tmp;
SetFarbe(&tmp, hl->ccolor, hl->cshade);
SetFarbe(&tmp, hl->fillColor(), hl->fillShade());
p->setBrush(tmp);
}
if (hl->cstroke != CommonStrings::None)
if (hl->strokeColor() != CommonStrings::None)
{
QColor tmp;
SetFarbe(&tmp, hl->cstroke, hl->cshade2);
SetFarbe(&tmp, hl->strokeColor(), hl->strokeShade());
p->setPen(tmp, 1, SolidLine, FlatCap, MiterJoin);
}
Zli->Farb = hl->ccolor;
Zli->Farb2 = hl->cstroke;
Zli->shade = hl->cshade;
Zli->shade2 = hl->cshade2;
Zli->Farb = hl->fillColor();
Zli->Farb2 = hl->strokeColor();
Zli->shade = hl->fillShade();
Zli->shade2 = hl->strokeShade();
Zli->xco = 0;
Zli->yco = BaseOffs;
Zli->Sele = hl->cselect;
Zli->Siz = chs;
Zli->realSiz = hl->csize;
Zli->Style = hl->cstyle;
Zli->ZFo = hl->cfont;
Zli->realSiz = hl->fontSize();
Zli->Style = hl->effects();
Zli->ZFo = hl->font();
Zli->wide = wide;
Zli->kern = hl->csize * hl->cextra / 10000.0;
Zli->scale = hl->cscale;
Zli->scalev = hl->cscalev;
Zli->base = hl->cbase;
Zli->shadowX = hl->cshadowx;
Zli->shadowY = hl->cshadowx;
Zli->outline = hl->coutline;
Zli->underpos = hl->cunderpos;
Zli->underwidth = hl->cunderwidth;
Zli->strikepos = hl->cstrikepos;
Zli->strikewidth = hl->cstrikewidth;
Zli->kern = hl->fontSize() * hl->tracking() / 10000.0;
Zli->scale = hl->scaleH();
Zli->scalev = hl->scaleV();
Zli->base = hl->baselineOffset();
Zli->shadowX = hl->shadowXOffset();
Zli->shadowY = hl->shadowYOffset();
Zli->outline = hl->outlineWidth();
Zli->underpos = hl->underlineOffset();
Zli->underwidth = hl->underlineWidth();
Zli->strikepos = hl->strikethruOffset();
Zli->strikewidth = hl->strikethruWidth();
Zli->embedded = 0;
if (!m_Doc->RePos)
DrawZeichenS(p, Zli);
240,7 → 240,7
MaxChars = a+1;
oCurX = CurX;
CurX -= dx;
CurX += wide+hl->csize * hl->cextra / 10000.0;
CurX += wide+hl->fontSize() * hl->tracking() / 10000.0;
first = false;
}
#endif
/branches/Version13x/Scribus/scribus/edit1format.cpp
64,13 → 64,13
GroupFontLayout = new QVBoxLayout( GroupFont->layout() );
GroupFontLayout->setAlignment( Qt::AlignLeft );
FontC = new FontComboH(GroupFont);
FontC->setCurrentFont(vor->charStyle().cfont->scName());
FontC->setCurrentFont(vor->charStyle().font()->scName());
GroupFontLayout->addWidget( FontC );
layout7 = new QHBoxLayout( 0, 0, 5, "layout7");
SizeC = new MSpinBox( 1, 2048, GroupFont, 1 );
SizeC->setMinimumSize( QSize( 70, 22 ) );
SizeC->setSuffix( tr( " pt" ) );
SizeC->setValue(vor->charStyle().csize / 10.0);
SizeC->setValue(vor->charStyle().fontSize() / 10.0);
TextF2 = new QLabel( "" ,GroupFont, "TextF2" );
TextF2->setPixmap(loadIcon("Zeichen.xpm"));
TextF2->setMinimumSize( QSize( 22, 22 ) );
83,7 → 83,7
pixmapLabel3->setPixmap( loadIcon("textscaleh.png") );
layout7->addWidget( pixmapLabel3 );
fontHScale = new MSpinBox( 10, 400, GroupFont, 1 );
fontHScale->setValue( vor->charStyle().cscale / 10.0 );
fontHScale->setValue( vor->charStyle().scaleH() / 10.0 );
fontHScale->setSuffix( tr( " %" ) );
layout7->addWidget( fontHScale );
pixmapLabel3_2 = new QLabel( "", GroupFont, "pixmapLabel3_2" );
93,7 → 93,7
layout7->addWidget( pixmapLabel3_2 );
 
fontVScale = new MSpinBox( 10, 400, GroupFont, 1 );
fontVScale->setValue( vor->charStyle().cscalev / 10.0 );
fontVScale->setValue( vor->charStyle().scaleV() / 10.0 );
fontVScale->setSuffix( tr( " %" ) );
layout7->addWidget( fontVScale );
GroupFontLayout->addLayout( layout7 );
100,14 → 100,14
 
layout9a = new QHBoxLayout( 0, 0, 0, "layout9");
EffeS = new StyleSelect(GroupFont);
EffeS->setStyle(vor->charStyle().cstyle);
EffeS->ShadowVal->Xoffset->setValue(vor->charStyle().cshadowx / 10.0);
EffeS->ShadowVal->Yoffset->setValue(vor->charStyle().cshadowy / 10.0);
EffeS->OutlineVal->LWidth->setValue(vor->charStyle().coutline / 10.0);
EffeS->UnderlineVal->LPos->setValue(vor->charStyle().cunderpos / 10.0);
EffeS->UnderlineVal->LWidth->setValue(vor->charStyle().cunderwidth / 10.0);
EffeS->StrikeVal->LPos->setValue(vor->charStyle().cstrikepos / 10.0);
EffeS->StrikeVal->LWidth->setValue(vor->charStyle().cstrikewidth / 10.0);
EffeS->setStyle(vor->charStyle().effects());
EffeS->ShadowVal->Xoffset->setValue(vor->charStyle().shadowXOffset() / 10.0);
EffeS->ShadowVal->Yoffset->setValue(vor->charStyle().shadowYOffset() / 10.0);
EffeS->OutlineVal->LWidth->setValue(vor->charStyle().outlineWidth() / 10.0);
EffeS->UnderlineVal->LPos->setValue(vor->charStyle().underlineOffset() / 10.0);
EffeS->UnderlineVal->LWidth->setValue(vor->charStyle().underlineWidth() / 10.0);
EffeS->StrikeVal->LPos->setValue(vor->charStyle().strikethruOffset() / 10.0);
EffeS->StrikeVal->LWidth->setValue(vor->charStyle().strikethruWidth() / 10.0);
layout9a->addWidget( EffeS );
QSpacerItem* spacer1 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
layout9a->addItem( spacer1 );
170,10 → 170,10
StrokeIcon->setEnabled(false);
PM1->setEnabled(false);
TxStroke->setEnabled(false);
TxFill->setCurrentText(vor->charStyle().ccolor);
TxStroke->setCurrentText(vor->charStyle().cstroke);
PM2->setValue(vor->charStyle().cshade);
PM1->setValue(vor->charStyle().cshade2);
TxFill->setCurrentText(vor->charStyle().fillColor());
TxStroke->setCurrentText(vor->charStyle().strokeColor());
PM2->setValue(vor->charStyle().fillShade());
PM1->setValue(vor->charStyle().strokeShade());
 
layout9->addWidget( GroupFont );
 
207,7 → 207,7
pixmapLabel2->setPixmap( loadIcon("textbase.png") );
AbstandVLayout->addWidget( pixmapLabel2, 0, 2 );
fontBase = new MSpinBox( -100, 100, AbstandV, 1 );
fontBase->setValue( vor->charStyle().cbase / 10.0 );
fontBase->setValue( vor->charStyle().baselineOffset() / 10.0 );
fontBase->setSuffix( tr( " %" ) );
AbstandVLayout->addWidget( fontBase, 0, 3 );
pixmapLabel3_3 = new QLabel( AbstandV, "pixmapLabel3_3" );
216,7 → 216,7
pixmapLabel3_3->setPixmap( loadIcon("textkern.png") );
AbstandVLayout->addWidget( pixmapLabel3_3, 0, 4 );
fontKern = new MSpinBox( -300, 300, AbstandV, 1 );
fontKern->setValue( vor->charStyle().cextra / 10.0 );
fontKern->setValue( vor->charStyle().tracking() / 10.0 );
fontKern->setSuffix( tr( " %" ) );
AbstandVLayout->addWidget( fontKern, 0, 5 );
 
512,7 → 512,7
void EditStyle::copyStyleSettings(ParagraphStyle& parstyle)
{
CharStyle charstyle;
charstyle.cstyle = static_cast<StyleFlag>(EffeS->getStyle());
charstyle.setEffects(static_cast<StyleFlag>(EffeS->getStyle()));
parstyle.setAlignment(AligS->getStyle());
for (uint al = 0; al < lineSpacingPop->count(); ++al)
{
529,28 → 529,28
parstyle.setGapBefore(AboveV->value() / parentDoc->unitRatio());
parstyle.setGapAfter(BelowV->value() / parentDoc->unitRatio());
parstyle.setName(Name->text());
charstyle.cfont = PrefsManager::instance()->appPrefs.AvailFonts[FontC->currentFont()];
charstyle.csize = qRound(SizeC->value() * 10.0);
charstyle.setFont(PrefsManager::instance()->appPrefs.AvailFonts[FontC->currentFont()]);
charstyle.setFontSize(qRound(SizeC->value() * 10.0));
parstyle.setHasDropCap(DropCaps->isChecked());
parstyle.setDropCapLines(DropLines->value());
parstyle.setDropCapOffset(DropDist->value() / parentDoc->unitRatio());
charstyle.ccolor = TxFill->currentText();
charstyle.cshade = PM2->getValue();
charstyle.cstroke = TxStroke->currentText();
charstyle.cshade2 = PM1->getValue();
charstyle.setFillColor(TxFill->currentText());
charstyle.setFillShade(PM2->getValue());
charstyle.setStrokeColor(TxStroke->currentText());
charstyle.setStrokeShade(PM1->getValue());
parstyle.tabValues() = TabList->getTabVals();
charstyle.cshadowx = qRound(EffeS->ShadowVal->Xoffset->value() * 10.0);
charstyle.cshadowy = qRound(EffeS->ShadowVal->Yoffset->value() * 10.0);
charstyle.coutline = qRound(EffeS->OutlineVal->LWidth->value() * 10.0);
charstyle.cstrikepos = qRound(EffeS->StrikeVal->LPos->value() * 10.0);
charstyle.cstrikewidth = qRound(EffeS->StrikeVal->LWidth->value() * 10.0);
charstyle.cunderpos = qRound(EffeS->UnderlineVal->LPos->value() * 10.0);
charstyle.cunderwidth = qRound(EffeS->UnderlineVal->LWidth->value() * 10.0);
charstyle.cscale = qRound(fontHScale->value() * 10.0);
charstyle.cscalev = qRound(fontVScale->value() * 10.0);
charstyle.cbase = qRound(fontBase->value() * 10.0);
charstyle.cextra = qRound(fontKern->value() * 10.0);
parstyle.charStyle().applyStyle(charstyle);
charstyle.setShadowXOffset(qRound(EffeS->ShadowVal->Xoffset->value() * 10.0));
charstyle.setShadowYOffset(qRound(EffeS->ShadowVal->Yoffset->value() * 10.0));
charstyle.setOutlineWidth(qRound(EffeS->OutlineVal->LWidth->value() * 10.0));
charstyle.setStrikethruOffset(qRound(EffeS->StrikeVal->LPos->value() * 10.0));
charstyle.setStrikethruWidth(qRound(EffeS->StrikeVal->LWidth->value() * 10.0));
charstyle.setUnderlineOffset(qRound(EffeS->UnderlineVal->LPos->value() * 10.0));
charstyle.setUnderlineWidth(qRound(EffeS->UnderlineVal->LWidth->value() * 10.0));
charstyle.setScaleH(qRound(fontHScale->value() * 10.0));
charstyle.setScaleV(qRound(fontVScale->value() * 10.0));
charstyle.setBaselineOffset(qRound(fontBase->value() * 10.0));
charstyle.setTracking(qRound(fontKern->value() * 10.0));
parstyle.charStyle().applyCharStyle(charstyle);
}
 
 
/branches/Version13x/Scribus/scribus/story.cpp
531,25 → 531,25
struct PtiSmall *hg;
hg = new PtiSmall;
hg->ch = t[a];
hg->charStyle.ccolor = CurrTextFill;
hg->charStyle.cshade = CurrTextFillSh;
hg->charStyle.cstroke = CurrTextStroke;
hg->charStyle.cshade2 = CurrTextStrokeSh;
hg->charStyle.cfont = (*doc->AllFonts)[CurrFont];
hg->charStyle.csize = CurrFontSize;
hg->charStyle.cstyle = CurrentStyle;
hg->charStyle.setFillColor(CurrTextFill);
hg->charStyle.setFillShade(CurrTextFillSh);
hg->charStyle.setStrokeColor(CurrTextStroke);
hg->charStyle.setStrokeShade(CurrTextStrokeSh);
hg->charStyle.setFont((*doc->AllFonts)[CurrFont]);
hg->charStyle.setFontSize(CurrFontSize);
hg->charStyle.setEffects(CurrentStyle);
hg->cab = ccab;
hg->charStyle.cextra = CurrTextKern;
hg->charStyle.cscale = CurrTextScale;
hg->charStyle.cscalev = CurrTextScaleV;
hg->charStyle.cbase = CurrTextBase;
hg->charStyle.cshadowx = CurrTextShadowX;
hg->charStyle.cshadowy = CurrTextShadowY;
hg->charStyle.coutline = CurrTextOutline;
hg->charStyle.cunderpos = CurrTextUnderPos;
hg->charStyle.cunderwidth =CurrTextUnderWidth;
hg->charStyle.cstrikepos = CurrTextStrikePos;
hg->charStyle.cstrikewidth =CurrTextStrikeWidth;
hg->charStyle.setTracking(CurrTextKern);
hg->charStyle.setScaleH(CurrTextScale);
hg->charStyle.setScaleV(CurrTextScaleV);
hg->charStyle.setBaselineOffset(CurrTextBase);
hg->charStyle.setShadowXOffset(CurrTextShadowX);
hg->charStyle.setShadowYOffset(CurrTextShadowY);
hg->charStyle.setOutlineWidth(CurrTextOutline);
hg->charStyle.setUnderlineOffset(CurrTextUnderPos);
hg->charStyle.setUnderlineWidth(CurrTextUnderWidth);
hg->charStyle.setStrikethruOffset(CurrTextStrikePos);
hg->charStyle.setStrikethruWidth(CurrTextStrikeWidth);
hg->cembedded = 0;
chars->insert(i, hg);
i++;
657,25 → 657,25
hg = new PtiSmall;
hg->ch = QChar(13);
tBuffer += QChar(13);
hg->charStyle.cfont = (*doc->AllFonts)[""]; //FIXME
hg->charStyle.csize = 1;
hg->charStyle.ccolor = "";
hg->charStyle.cshade = 1;
hg->charStyle.cstroke = "";
hg->charStyle.cshade2 = 1;
hg->charStyle.cscale = 10;
hg->charStyle.cscalev = 10;
hg->charStyle.cstyle = ScStyle_Default;
hg->charStyle.setFont((*doc->AllFonts)[""]); //FIXME
hg->charStyle.setFontSize(1);
hg->charStyle.setFillColor("");
hg->charStyle.setFillShade(1);
hg->charStyle.setStrokeColor("");
hg->charStyle.setStrokeShade(1);
hg->charStyle.setScaleH(10);
hg->charStyle.setScaleV(10);
hg->charStyle.setEffects(ScStyle_Default);
hg->cab = 0;
hg->charStyle.cextra = 0;
hg->charStyle.cbase = 0;
hg->charStyle.cshadowx = 50;
hg->charStyle.cshadowy = -50;
hg->charStyle.coutline = 10;
hg->charStyle.cunderpos = -1;
hg->charStyle.cunderwidth = -1;
hg->charStyle.cstrikepos = -1;
hg->charStyle.cstrikewidth = -1;
hg->charStyle.setTracking(0);
hg->charStyle.setBaselineOffset(0);
hg->charStyle.setShadowXOffset(50);
hg->charStyle.setShadowYOffset(-50);
hg->charStyle.setOutlineWidth(10);
hg->charStyle.setUnderlineOffset(-1);
hg->charStyle.setUnderlineWidth(-1);
hg->charStyle.setStrikethruOffset(-1);
hg->charStyle.setStrikethruWidth(-1);
hg->cembedded = 0;
cBuffer.append(hg);
}
704,28 → 704,28
}
else
{
newStyle.ccolor = CurrTextFill;
newStyle.cshade = CurrTextFillSh;
newStyle.cstroke = CurrTextStroke;
newStyle.cshade2 = CurrTextStrokeSh;
newStyle.cfont = (*doc->AllFonts)[CurrFont];
newStyle.csize = CurrFontSize;
newStyle.cstyle = static_cast<StyleFlag>(CurrentStyle);
newStyle.cextra = CurrTextKern;
newStyle.cscale = CurrTextScale;
newStyle.cscalev = CurrTextScaleV;
newStyle.cbase = CurrTextBase;
newStyle.cshadowx = CurrTextShadowX;
newStyle.cshadowy = CurrTextShadowY;
newStyle.coutline = CurrTextOutline;
newStyle.cunderpos = CurrTextUnderPos;
newStyle.cunderwidth = CurrTextUnderWidth;
newStyle.cstrikepos = CurrTextStrikePos;
newStyle.cstrikewidth = CurrTextStrikeWidth;
newStyle.setFillColor(CurrTextFill);
newStyle.setFillShade(CurrTextFillSh);
newStyle.setStrokeColor(CurrTextStroke);
newStyle.setStrokeShade(CurrTextStrokeSh);
newStyle.setFont((*doc->AllFonts)[CurrFont]);
newStyle.setFontSize(CurrFontSize);
newStyle.setEffects(static_cast<StyleFlag>(CurrentStyle));
newStyle.setTracking(CurrTextKern);
newStyle.setScaleH(CurrTextScale);
newStyle.setScaleV(CurrTextScaleV);
newStyle.setBaselineOffset(CurrTextBase);
newStyle.setShadowXOffset(CurrTextShadowX);
newStyle.setShadowYOffset(CurrTextShadowY);
newStyle.setOutlineWidth(CurrTextOutline);
newStyle.setUnderlineOffset(CurrTextUnderPos);
newStyle.setUnderlineWidth(CurrTextUnderWidth);
newStyle.setStrikethruOffset(CurrTextStrikePos);
newStyle.setStrikethruWidth(CurrTextStrikeWidth);
if (doc->docParagraphStyles[ParagStyles[p-1]].charStyle().font() != &Foi::NONE)
{
newStyle.cfont = doc->docParagraphStyles[ParagStyles[p-1]].charStyle().font();
newStyle.csize = doc->docParagraphStyles[ParagStyles[p-1]].charStyle().fontSize();
newStyle.setFont(doc->docParagraphStyles[ParagStyles[p-1]].charStyle().font());
newStyle.setFontSize(doc->docParagraphStyles[ParagStyles[p-1]].charStyle().fontSize());
}
}
int pos = currItem->itemText.length();
908,7 → 908,7
continue;
}
#endif
if ((Ali == hg->cab) && (Csty == hg->charStyle.cstyle))
if ((Ali == hg->cab) && (Csty == hg->charStyle.effects()))
{
if (hg->ch == QChar(parentStoryEditor->seActions["unicodePageNumber"]->actionInt()))
{
991,7 → 991,7
setStyle(Csty);
insert(Text);
Text = hg->ch;
Csty = hg->charStyle.cstyle;
Csty = hg->charStyle.effects();
Ali = hg->cab;
}
chars->append(hg);
1069,7 → 1069,7
ChList *chars = StyledText.at(0);
if (chars->count() != 0)
{
Csty = chars->at(0)->charStyle.cstyle;
Csty = chars->at(0)->charStyle.effects();
Ali = chars->at(0)->cab;
}
else
1101,7 → 1101,7
Text = "";
continue;
}
if ((Ali == hg->cab) && (Csty == hg->charStyle.cstyle))
if ((Ali == hg->cab) && (Csty == hg->charStyle.effects()))
{
if (hg->ch == QChar(parentStoryEditor->seActions["unicodePageNumber"]->actionInt()))
{
1180,7 → 1180,7
setStyle(Csty);
insert(Text);
Text = hg->ch;
Csty = hg->charStyle.cstyle;
Csty = hg->charStyle.effects();
Ali = hg->cab;
}
}
1205,10 → 1205,10
int p, i;
getCursorPosition(&p, &i);
removeSelection();
int Csty = chars->at(0)->charStyle.cstyle;
int Csty = chars->at(0)->charStyle.effects();
for (uint a = 0; a < chars->count(); ++a)
{
if (Csty == chars->at(a)->charStyle.cstyle)
if (Csty == chars->at(a)->charStyle.effects())
SelEnd++;
else
{
1215,7 → 1215,7
setSelection(pa, SelStart, pa, SelEnd);
setStyle(Csty);
removeSelection();
Csty = chars->at(a)->charStyle.cstyle;
Csty = chars->at(a)->charStyle.effects();
SelStart = SelEnd;
SelEnd++;
}
1269,46 → 1269,49
switch (code)
{
case 0:
chars->at(ca)->charStyle.ccolor = hg->charStyle.ccolor;
chars->at(ca)->charStyle.cshade = hg->charStyle.cshade;
chars->at(ca)->charStyle.setFillColor(hg->charStyle.fillColor());
chars->at(ca)->charStyle.setFillShade(hg->charStyle.fillShade());
break;
case 1:
chars->at(ca)->charStyle.cstroke = hg->charStyle.cstroke;
chars->at(ca)->charStyle.cshade2 = hg->charStyle.cshade2;
chars->at(ca)->charStyle.setStrokeColor(hg->charStyle.strokeColor());
chars->at(ca)->charStyle.setStrokeShade(hg->charStyle.strokeShade());
break;
case 2:
chars->at(ca)->charStyle.cfont = hg->charStyle.cfont;
chars->at(ca)->charStyle.setFont(hg->charStyle.font());
break;
case 3:
chars->at(ca)->charStyle.csize = hg->charStyle.csize;
chars->at(ca)->charStyle.setFontSize(hg->charStyle.fontSize());
break;
case 4:
chars->at(ca)->charStyle.cstyle &= static_cast<StyleFlag>(~1919);
chars->at(ca)->charStyle.cstyle |= hg->charStyle.cstyle;
break;
{
StyleFlag fl = chars->at(ca)->charStyle.effects();
fl &= static_cast<StyleFlag>(~1919);
fl |= hg->charStyle.effects();
chars->at(ca)->charStyle.setEffects(fl);
} break;
case 5:
chars->at(ca)->charStyle.cscale = hg->charStyle.cscale;
chars->at(ca)->charStyle.setScaleH(hg->charStyle.scaleH());
break;
case 6:
chars->at(ca)->charStyle.cextra = hg->charStyle.cextra;
chars->at(ca)->charStyle.setTracking(hg->charStyle.tracking());
break;
case 7:
chars->at(ca)->charStyle.cscalev = hg->charStyle.cscalev;
chars->at(ca)->charStyle.setScaleV(hg->charStyle.scaleV());
break;
case 8:
chars->at(ca)->charStyle.cshadowx = hg->charStyle.cshadowx;
chars->at(ca)->charStyle.cshadowy = hg->charStyle.cshadowy;
chars->at(ca)->charStyle.setShadowXOffset(hg->charStyle.shadowXOffset());
chars->at(ca)->charStyle.setShadowYOffset(hg->charStyle.shadowYOffset());
break;
case 9:
chars->at(ca)->charStyle.coutline = hg->charStyle.coutline;
chars->at(ca)->charStyle.setOutlineWidth(hg->charStyle.outlineWidth());
break;
case 10:
chars->at(ca)->charStyle.cunderpos = hg->charStyle.cunderpos;
chars->at(ca)->charStyle.cunderwidth = hg->charStyle.cunderwidth;
chars->at(ca)->charStyle.setUnderlineOffset(hg->charStyle.underlineOffset());
chars->at(ca)->charStyle.setUnderlineWidth(hg->charStyle.underlineWidth());
break;
case 11:
chars->at(ca)->charStyle.cstrikepos = hg->charStyle.cstrikepos;
chars->at(ca)->charStyle.cstrikewidth = hg->charStyle.cstrikewidth;
chars->at(ca)->charStyle.setStrikethruOffset(hg->charStyle.strikethruOffset());
chars->at(ca)->charStyle.setStrikethruWidth(hg->charStyle.strikethruWidth());
break;
default:
break;
2520,8 → 2523,8
if (s != -1)
Editor->CurrTextFillSh = s;
struct PtiSmall hg;
hg.charStyle.ccolor = Editor->CurrTextFill;
hg.charStyle.cshade = Editor->CurrTextFillSh;
hg.charStyle.setFillColor(Editor->CurrTextFill);
hg.charStyle.setFillShade(Editor->CurrTextFillSh);
Editor->updateSel(0, &hg);
modifiedText();
Editor->setFocus();
2534,8 → 2537,8
if (s != -1)
Editor->CurrTextStrokeSh = s;
struct PtiSmall hg;
hg.charStyle.cstroke = Editor->CurrTextStroke;
hg.charStyle.cshade2 = Editor->CurrTextStrokeSh;
hg.charStyle.setStrokeColor(Editor->CurrTextStroke);
hg.charStyle.setStrokeShade(Editor->CurrTextStrokeSh);
Editor->updateSel(1, &hg);
modifiedText();
Editor->setFocus();
2554,7 → 2557,7
Editor->CurrFont = f;
updateUnicodeActions();
struct PtiSmall hg;
hg.charStyle.cfont = (*currDoc->AllFonts)[Editor->CurrFont];
hg.charStyle.setFont((*currDoc->AllFonts)[Editor->CurrFont]);
Editor->updateSel(2, &hg);
modifiedText();
Editor->setFocus();
2564,7 → 2567,7
{
Editor->CurrFontSize = qRound(s * 10.0);
struct PtiSmall hg;
hg.charStyle.csize = Editor->CurrFontSize;
hg.charStyle.setFontSize(Editor->CurrFontSize);
Editor->updateSel(3, &hg);
modifiedText();
Editor->setFocus();
2574,7 → 2577,7
{
Editor->CurrentStyle = static_cast<StyleFlag>(s);
struct PtiSmall hg;
hg.charStyle.cstyle = Editor->CurrentStyle;
hg.charStyle.setEffects(Editor->CurrentStyle);
Editor->updateSel(4, &hg);
Editor->setStyle(s);
if (s & 4)
2596,7 → 2599,7
int ss = qRound(FontTools->ChScale->value() * 10);
Editor->CurrTextScale = ss;
struct PtiSmall hg;
hg.charStyle.cscale = Editor->CurrTextScale;
hg.charStyle.setScaleH(Editor->CurrTextScale);
Editor->updateSel(5, &hg);
modifiedText();
Editor->setFocus();
2607,7 → 2610,7
int ss = qRound(FontTools->ChScaleV->value() * 10);
Editor->CurrTextScaleV = ss;
struct PtiSmall hg;
hg.charStyle.cscalev = Editor->CurrTextScaleV;
hg.charStyle.setScaleV(Editor->CurrTextScaleV);
Editor->updateSel(7, &hg);
modifiedText();
Editor->setFocus();
2617,7 → 2620,7
{
Editor->CurrTextKern = s;
struct PtiSmall hg;
hg.charStyle.cextra = Editor->CurrTextKern;
hg.charStyle.setTracking(Editor->CurrTextKern);
Editor->updateSel(6, &hg);
modifiedText();
Editor->setFocus();
2626,8 → 2629,8
void StoryEditor::newShadowOffs(int x, int y)
{
struct PtiSmall hg;
hg.charStyle.cshadowx = x;
hg.charStyle.cshadowy = y;
hg.charStyle.setShadowXOffset(x);
hg.charStyle.setShadowYOffset(y);
Editor->CurrTextShadowX = x;
Editor->CurrTextShadowY = y;
Editor->updateSel(8, &hg);
2639,7 → 2642,7
{
Editor->CurrTextOutline = o;
struct PtiSmall hg;
hg.charStyle.coutline = Editor->CurrTextOutline;
hg.charStyle.setOutlineWidth(Editor->CurrTextOutline);
Editor->updateSel(9, &hg);
modifiedText();
Editor->setFocus();
2648,8 → 2651,8
void StoryEditor::newTxtUnderline(int p, int w)
{
struct PtiSmall hg;
hg.charStyle.cunderpos = p;
hg.charStyle.cunderwidth = w;
hg.charStyle.setUnderlineOffset(p);
hg.charStyle.setUnderlineWidth(w);
Editor->CurrTextUnderPos = p;
Editor->CurrTextUnderWidth = w;
Editor->updateSel(10, &hg);
2660,8 → 2663,8
void StoryEditor::newTxtStrike(int p, int w)
{
struct PtiSmall hg;
hg.charStyle.cstrikepos = p;
hg.charStyle.cstrikewidth = w;
hg.charStyle.setStrikethruOffset(p);
hg.charStyle.setStrikethruWidth(w);
Editor->CurrTextStrikePos = p;
Editor->CurrTextStrikeWidth = w;
Editor->updateSel(11, &hg);
2767,17 → 2770,17
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().font()->scName();
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fontSize();
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().effects();
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().ccolor;
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade;
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstroke;
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade2;
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowx;
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowy;
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().coutline;
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderpos;
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderwidth;
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikepos;
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikewidth;
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillColor();
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillShade();
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeColor();
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeShade();
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowXOffset();
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowYOffset();
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().outlineWidth();
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineOffset();
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineWidth();
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruOffset();
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruWidth();
}
Editor->setAlign(Editor->currentParaStyle);
Editor->setStyle(Editor->CurrentStyle);
2795,10 → 2798,10
}
else
hg = chars->at(QMIN(QMAX(ch-1, 0), static_cast<int>(chars->count())-1));
Editor->CurrTextFill = hg->charStyle.ccolor;
Editor->CurrTextFillSh = hg->charStyle.cshade;
Editor->CurrTextStroke = hg->charStyle.cstroke;
Editor->CurrTextStrokeSh = hg->charStyle.cshade2;
Editor->CurrTextFill = hg->charStyle.fillColor();
Editor->CurrTextFillSh = hg->charStyle.fillShade();
Editor->CurrTextStroke = hg->charStyle.strokeColor();
Editor->CurrTextStrokeSh = hg->charStyle.strokeShade();
Editor->prevFont = Editor->CurrFont;
Editor->CurrFont = hg->charStyle.font()->scName();
Editor->CurrFontSize = hg->charStyle.fontSize();
3309,17 → 3312,17
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().font()->scName();
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fontSize();
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().effects();
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().ccolor;
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade;
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstroke;
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade2;
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowx;
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowy;
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().coutline;
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderpos;
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderwidth;
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikepos;
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikewidth;
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillColor();
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillShade();
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeColor();
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeShade();
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowXOffset();
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowYOffset();
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().outlineWidth();
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineOffset();
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineWidth();
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruOffset();
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruWidth();
}
}
else
3429,17 → 3432,17
Editor->CurrFont = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().font()->scName();
Editor->CurrFontSize = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fontSize();
Editor->CurrentStyle = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().effects();
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().ccolor;
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade;
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstroke;
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshade2;
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowx;
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cshadowy;
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().coutline;
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderpos;
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cunderwidth;
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikepos;
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().cstrikewidth;
Editor->CurrTextFill = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillColor();
Editor->CurrTextFillSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().fillShade();
Editor->CurrTextStroke = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeColor();
Editor->CurrTextStrokeSh = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strokeShade();
Editor->CurrTextShadowX = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowXOffset();
Editor->CurrTextShadowY = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().shadowYOffset();
Editor->CurrTextOutline = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().outlineWidth();
Editor->CurrTextUnderPos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineOffset();
Editor->CurrTextUnderWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().underlineWidth();
Editor->CurrTextStrikePos = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruOffset();
Editor->CurrTextStrikeWidth = currDoc->docParagraphStyles[Editor->currentParaStyle].charStyle().strikethruWidth();
}
}
else
/branches/Version13x/Scribus/scribus/sctextstruct.h
23,6 → 23,7
#include <qstring.h>
 
#include "scfonts.h"
#include "style.h"
 
class PageItem;
 
38,430 → 39,41
*
*/
 
enum StyleFlag {
ScStyle_Default = 0,
ScStyle_Superscript = 1,
ScStyle_Subscript = 2,
ScStyle_Outline = 4,
ScStyle_Underline = 8,
ScStyle_Strikethrough = 16,
ScStyle_AllCaps = 32,
ScStyle_SmallCaps = 64,
ScStyle_HyphenationPossible=128, //Hyphenation possible here (Smart Hyphen)
ScStyle_Shadowed = 256,
ScStyle_UnderlineWords= 512,
ScStyle_Reserved01 = 1024, //free, not used in the moment
ScStyle_DropCap = 2048,
ScStyle_SuppressSpace = 4096,//internal use in PageItem (Suppresses spaces when in Block alignment)
ScStyle_SmartHyphenVisible=8192, //Smart Hyphen visible at line end
ScStyle_StartOfLine = 16384,
ScStyle_UserStyles = 2047, // 1919, // == 1024 + 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
ScStyle_None = 65535
};
 
StyleFlag& operator&= (StyleFlag& left, StyleFlag right);
 
StyleFlag& operator|= (StyleFlag& left, StyleFlag right);
 
StyleFlag operator& (StyleFlag left, StyleFlag right);
 
StyleFlag operator| (StyleFlag left, StyleFlag right);
 
StyleFlag operator^ (StyleFlag left, StyleFlag right);
 
StyleFlag operator~ (StyleFlag arg);
 
 
 
 
class SCRIBUS_API CharStyle {
public:
static const short NOVALUE = -16000;
static const QString NOCOLOR;
static const QString NOLANG;
CharStyle() {
cname_ = "";
cparent_ = NULL;
csize = NOVALUE;
cshade = NOVALUE;
cshade2 = NOVALUE;
cstyle = ScStyle_None;
cscale = NOVALUE;
cscalev = NOVALUE;
cbase = NOVALUE;
cshadowx = NOVALUE;
cshadowy = NOVALUE;
coutline = NOVALUE;
cunderpos = NOVALUE;
cunderwidth = NOVALUE;
cstrikepos = NOVALUE;
cstrikewidth = NOVALUE;
cextra = NOVALUE;
 
cfont = const_cast<Foi*>(&Foi::NONE);
ccolor = NOCOLOR;
cstroke = NOCOLOR;
language_ = NOLANG;
};
 
CharStyle(Foi * font, int size, StyleFlag style = ScStyle_Default) {
cname_ = "";
cparent_ = NULL;
csize = size;
cshade = 1;
cshade2 = 1;
cstyle = style;
cscale = 1000;
cscalev = 1000;
cbase = 0;
cshadowx = 0;
cshadowy = 0;
coutline = 0;
cunderpos = 0;
cunderwidth = 0;
cstrikepos = 0;
cstrikewidth = 0;
cextra = 0;
 
cfont = font;
ccolor = "Black";
cstroke = "Black";
language_ = "";
};
 
CharStyle(const CharStyle & other);
bool operator==(const CharStyle & other) const;
bool operator!=(const CharStyle & other) const { return ! (*this==other); }
CharStyle & operator=(const CharStyle & other);
 
void applyStyle(const CharStyle & other);
void eraseStyle(const CharStyle & other);
QString asString() const;
QString name() const { return cname_; }
const CharStyle * parent() const { return cparent_; }
int fontSize() const { return csize; }
int fillShade() const { return cshade; }
int strokeShade() const { return cshade2; }
StyleFlag effects() const { return cstyle; }
int scaleH() const { return cscale; }
int scaleV() const { return cscalev; }
int baselineOffset() const { return cbase; }
int shadowXOffset() const { return cshadowx; }
int shadowYOffset() const { return cshadowy; }
int outlineWidth() const { return coutline; }
int underlineOffset() const { return cunderpos; }
int underlineWidth() const { return cunderwidth; }
int strikethruOffset() const { return cstrikepos; }
int strikethruWidth() const { return cstrikewidth; }
int tracking() const { return cextra; }
Foi* font() const { return cfont; }
QString fillColor() const { return ccolor; }
QString strokeColor() const { return cstroke; }
QString language() const { return language_; }
NLS_PRIVATE:
QString cname_;
CharStyle * cparent_;
int csize;
short cshade;
short cshade2;
StyleFlag cstyle;
short cscale;
short cscalev;
short cbase;
short cshadowx;
short cshadowy;
short coutline;
short cunderpos;
short cunderwidth;
short cstrikepos;
short cstrikewidth;
short cextra;
 
Foi* cfont;
QString ccolor;
QString cstroke;
QString language_;
 
/**
* This struct stores a positioned glyph. This is the result of the layout process.
* If a char gets translated to more than one glyph, a linked list is built.
*/
struct SCRIBUS_API GlyphLayout {
float xadvance;
float yadvance;
float xoffset;
float yoffset;
double scaleV;
double scaleH;
uint glyph;
GlyphLayout* more;
GlyphLayout() : xadvance(0.0f), yadvance(0.0f), xoffset(0.0f), yoffset(0.0f),
scaleV(1.0), scaleH(1.0), glyph(0), more(NULL) { }
};
 
inline bool CharStyle::operator==(const CharStyle & other) const
{
return (csize == other.csize &&
cshade == other.cshade &&
cshade2 == other.cshade2 &&
cstyle == other.cstyle &&
cscale == other.cscale &&
cscalev == other.cscalev &&
cbase == other.cbase &&
cshadowx == other.cshadowx &&
cshadowy == other.cshadowy &&
coutline == other.coutline &&
cunderpos == other.cunderpos &&
cunderwidth == other.cunderwidth &&
cstrikepos == other.cstrikepos &&
cstrikewidth == other.cstrikewidth &&
cextra == other.cextra &&
cfont == other.cfont &&
ccolor == other.ccolor &&
cstroke == other.cstroke &&
language_ == other.language_ );
}
 
inline CharStyle & CharStyle::operator=(const CharStyle & other)
{
csize = other.csize;
cshade = other.cshade;
cshade2 = other.cshade2;
cstyle = other.cstyle;
cscale = other.cscale;
cscalev = other.cscalev;
cbase = other.cbase;
cshadowx = other.cshadowx;
cshadowy = other.cshadowy;
coutline = other.coutline;
cunderpos = other.cunderpos;
cunderwidth = other.cunderwidth;
cstrikepos = other.cstrikepos;
cstrikewidth = other.cstrikewidth;
cextra = other.cextra;
cfont = other.cfont;
ccolor = other.ccolor;
cstroke = other.cstroke;
language_ = other.language_;
return *this;
}
 
inline CharStyle::CharStyle(const CharStyle & other)
{
csize = other.csize;
cshade = other.cshade;
cshade2 = other.cshade2;
cstyle = other.cstyle;
cscale = other.cscale;
cscalev = other.cscalev;
cbase = other.cbase;
cshadowx = other.cshadowx;
cshadowy = other.cshadowy;
coutline = other.coutline;
cunderpos = other.cunderpos;
cunderwidth = other.cunderwidth;
cstrikepos = other.cstrikepos;
cstrikewidth = other.cstrikewidth;
cextra = other.cextra;
cfont = other.cfont;
ccolor = other.ccolor;
cstroke = other.cstroke;
language_ = other.language_;
}
 
 
inline void CharStyle::applyStyle(const CharStyle & other)
{
if (other.csize != NOVALUE)
csize = other.csize;
if (other.cshade != NOVALUE)
cshade = other.cshade;
if (other.cshade2 != NOVALUE)
cshade2 = other.cshade2;
if (other.cstyle != ScStyle_None)
cstyle = static_cast<StyleFlag>((cstyle & ~ScStyle_UserStyles) | (other.cstyle & ScStyle_UserStyles));
if (other.cscale != NOVALUE)
cscale = other.cscale;
if (other.cscalev != NOVALUE)
cscalev = other.cscalev;
if (other.cbase != NOVALUE)
cbase = other.cbase;
if (other.cshadowx != NOVALUE)
cshadowx = other.cshadowx;
if (other.cshadowy != NOVALUE)
cshadowy = other.cshadowy;
if (other.coutline != NOVALUE)
coutline = other.coutline;
if (other.cunderpos != NOVALUE)
cunderpos = other.cunderpos;
if (other.cunderwidth != NOVALUE)
cunderwidth = other.cunderwidth;
if (other.cstrikepos != NOVALUE)
cstrikepos = other.cstrikepos;
if (other.cstrikewidth != NOVALUE)
cstrikewidth = other.cstrikewidth;
if (other.cextra != NOVALUE)
cextra = other.cextra;
if (other.cfont != &Foi::NONE)
cfont = other.cfont;
if (other.ccolor != NOCOLOR)
ccolor = other.ccolor;
if (other.cstroke != NOCOLOR)
cstroke = other.cstroke;
if (other.language_ != NOLANG)
language_ = other.language_;
}
 
inline void CharStyle::eraseStyle(const CharStyle & other)
{
if (other.csize == csize)
csize = NOVALUE;
if (other.cshade == cshade)
cshade = NOVALUE;
if (other.cshade2 == cshade2)
cshade2 = NOVALUE;
if ((other.cstyle & ScStyle_UserStyles) == (cstyle & ScStyle_UserStyles))
cstyle = ScStyle_None;
if (other.cscale == cscale)
cscale = NOVALUE;
if (other.cscalev == cscalev)
cscalev = NOVALUE;
if (other.cbase == cbase)
cbase = NOVALUE;
if (other.cshadowx == cshadowx)
cshadowx = NOVALUE;
if (other.cshadowy == cshadowy)
cshadowy = NOVALUE;
if (other.coutline == coutline)
coutline = NOVALUE;
if (other.cunderpos == cunderpos)
cunderpos = NOVALUE;
if (other.cunderwidth == cunderwidth)
cunderwidth = NOVALUE;
if (other.cstrikepos == cstrikepos)
cstrikepos = NOVALUE;
if (other.cstrikewidth == cstrikewidth)
cstrikewidth = NOVALUE;
if (other.cextra == cextra)
cextra = NOVALUE;
if (other.cfont == cfont)
cfont = const_cast<Foi*>(&Foi::NONE);
if (other.ccolor == ccolor)
ccolor = NOCOLOR;
if (other.cstroke == cstroke)
cstroke = NOCOLOR;
if (other.language_ == language_)
language_ = NOLANG;
}
 
 
class SCRIBUS_API ParagraphStyle : private CharStyle
{
public:
enum LineSpacingMode {
FixedLineSpacing = 0,
AutomaticLineSpacing = 1,
BaselineGridLineSpacing = 2
};
struct TabRecord
{
double tabPosition;
int tabType;
QChar tabFillChar;
};
private:
QString Vname;
ParagraphStyle * pparent_;
LineSpacingMode LineSpaMode;
double LineSpa;
int textAlignment;
double Indent;
double rightMargin_;
double First;
double gapBefore_;
double gapAfter_;
QValueList<TabRecord> TabValues;
bool Drop;
int DropLin;
double DropDist;
bool BaseAdj;
public:
ParagraphStyle();
QString name() const { return Vname; }
const ParagraphStyle * parent() const { return pparent_; }
int lineSpacingMode() const { return LineSpaMode; }
double lineSpacing() const { return LineSpa; }
int alignment() const { return textAlignment; }
double firstIndent() const { return First; }
double leftMargin() const { return Indent; }
double rightMargin() const { return rightMargin_; }
double gapBefore() const { return gapBefore_; }
double gapAfter() const { return gapAfter_; }
bool hasDropCap() const { return Drop; }
int dropCapLines() const { return DropLin; }
double dropCapOffset() const { return DropDist; }
bool useBaselineGrid() const { return BaseAdj; }
void setName(QString p) {
Vname = p;
}
void setLineSpacingMode(LineSpacingMode p) {
LineSpaMode = p;
}
void setLineSpacing(double p) {
LineSpa = p;
}
void setAlignment(int p) {
textAlignment = p;
}
void setFirstIndent(double p) {
First = p;
}
void setLeftMargin(double p) {
Indent = p;
}
void setRightMargin(double p) {
rightMargin_ = p;
}
void setGapBefore(double p) {
gapBefore_ = p;
}
void setGapAfter(double p) {
gapAfter_ = p;
}
void setHasDropCap(bool p) {
Drop = p;
}
void setDropCapLines(int p) {
DropLin = p;
}
void setDropCapOffset(double p) {
DropDist = p;
}
 
void setUseBaselineGrid(bool p) {
BaseAdj = p;
}
 
// these return writeable references for now:
QValueList<TabRecord> & tabValues() { return TabValues; }
const QValueList<TabRecord> & tabValues() const { return TabValues; }
CharStyle & charStyle() { return *this; }
const CharStyle& charStyle() const { return *this; }
bool equiv(const ParagraphStyle& other) const;
bool operator==(const ParagraphStyle& other) const
{
return name()==other.name() && equiv(other);
}
};
 
 
#ifndef NLS_PROTO
class SCRIBUS_API ScText : public CharStyle
{
public:
bool cselect;
short cab;
float xp;
float yp;
bool cselect; // to go
short cab; // to go
ParagraphStyle* parstyle; // only for parseps
GlyphLayout glyph;
float PtransX;
float PtransY;
float PRot;
PageItem* cembedded;
QString ch;
ScText() : cselect(false), cab(0), parstyle(NULL), glyph(),
PtransX(0.0f), PtransY(0.0f), PRot(0.0f), cembedded(NULL), ch() {}
~ScText();
};
#endif
 
/branches/Version13x/Scribus/scribus/pageitem.cpp
638,7 → 638,7
/// returns the style at the current charpos for changing
ParagraphStyle& PageItem::changeCurrentStyle()
{
#ifndef NLS_PROTO
#if 0
if (frameDisplays(CPos) && itemText.item(CPos)->cab > 4)
return m_Doc->docParagraphStyles[itemText.item(CPos)->cab];
else
645,9 → 645,9
return const_cast<ParagraphStyle&>(itemText.defaultStyle());
#else
if (frameDisplays(CPos))
return itemText.paragraphStyle(CPos);
return const_cast<ParagraphStyle&>(itemText.paragraphStyle(CPos));
else
return itemText.defaultStyle();
return const_cast<ParagraphStyle&>(itemText.defaultStyle());
#endif
}
 
994,7 → 994,7
vg.setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(m_Doc->docParagraphStyles[xxx].lineSpacingMode()));
vg.setUseBaselineGrid(m_Doc->docParagraphStyles[xxx].useBaselineGrid());
vg.setLineSpacing(m_Doc->docParagraphStyles[xxx].lineSpacing());
vg.charStyle().csize = m_Doc->docParagraphStyles[xxx].charStyle().fontSize();
vg.charStyle().setFontSize(m_Doc->docParagraphStyles[xxx].charStyle().fontSize());
vg.setLeftMargin(m_Doc->docParagraphStyles[xxx].leftMargin());
vg.setFirstIndent(m_Doc->docParagraphStyles[xxx].firstIndent());
vg.setGapBefore(m_Doc->docParagraphStyles[xxx].gapBefore());
1041,7 → 1041,7
m_Doc->docParagraphStyles[xxx].setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(savedParagraphStyles[xxx].lineSpacingMode()));
m_Doc->docParagraphStyles[xxx].setUseBaselineGrid(savedParagraphStyles[xxx].useBaselineGrid());
m_Doc->docParagraphStyles[xxx].setLineSpacing(savedParagraphStyles[xxx].lineSpacing());
m_Doc->docParagraphStyles[xxx].charStyle().csize = savedParagraphStyles[xxx].charStyle().fontSize();
m_Doc->docParagraphStyles[xxx].charStyle().setFontSize(savedParagraphStyles[xxx].charStyle().fontSize());
m_Doc->docParagraphStyles[xxx].setLeftMargin(savedParagraphStyles[xxx].leftMargin());
m_Doc->docParagraphStyles[xxx].setFirstIndent(savedParagraphStyles[xxx].firstIndent());
m_Doc->docParagraphStyles[xxx].setGapBefore(savedParagraphStyles[xxx].gapBefore());
1248,19 → 1248,19
double PageItem::SetZeichAttr(const CharStyle& style, int *chs, QString *chx)
{
double retval = 0.0;
double asce = style.cfont->ascent() * (style.csize / 10.0);
int chst = style.cstyle & 1919;
double asce = style.font()->ascent() * (style.fontSize() / 10.0);
int chst = style.effects() & 1919;
if (chst != ScStyle_Default)
{
if (chst & ScStyle_Superscript)
{
retval -= asce * m_Doc->typographicSettings.valueSuperScript / 100;
*chs = QMAX(static_cast<int>(style.csize * m_Doc->typographicSettings.scalingSuperScript / 100), 1);
*chs = QMAX(static_cast<int>(style.fontSize() * m_Doc->typographicSettings.scalingSuperScript / 100), 1);
}
if (chst & ScStyle_Subscript)
{
retval += asce * m_Doc->typographicSettings.valueSubScript / 100;
*chs = QMAX(static_cast<int>(style.csize * m_Doc->typographicSettings.scalingSubScript / 100), 1);
*chs = QMAX(static_cast<int>(style.fontSize() * m_Doc->typographicSettings.scalingSubScript / 100), 1);
}
if (chst & ScStyle_AllCaps)
{
1271,7 → 1271,7
{
if (chx->upper() != *chx)
{
*chs = QMAX(static_cast<int>(style.csize * m_Doc->typographicSettings.valueSmallCaps / 100), 1);
*chs = QMAX(static_cast<int>(style.fontSize() * m_Doc->typographicSettings.valueSmallCaps / 100), 1);
*chx = chx->upper();
}
}
2833,25 → 2833,25
Text += QString(QChar(4))+"\t";
else
Text += itemText.text(a,1)+"\t";
Text += itemText.charStyle(a).cfont->scName()+"\t";
Text += QString::number(itemText.charStyle(a).csize / 10.0)+"\t";
Text += itemText.charStyle(a).ccolor+"\t";
Text += QString::number(itemText.charStyle(a).cextra)+"\t";
Text += QString::number(itemText.charStyle(a).cshade)+'\t';
Text += QString::number(itemText.charStyle(a).cstyle)+'\t';
Text += itemText.charStyle(a).font()->scName()+"\t";
Text += QString::number(itemText.charStyle(a).fontSize() / 10.0)+"\t";
Text += itemText.charStyle(a).fillColor()+"\t";
Text += QString::number(itemText.charStyle(a).tracking())+"\t";
Text += QString::number(itemText.charStyle(a).fillShade())+'\t';
Text += QString::number(itemText.charStyle(a).effects())+'\t';
Text += QString::number(findParagraphStyle(m_Doc, itemText.paragraphStyle(a)))+'\t';
Text += itemText.charStyle(a).cstroke+"\t";
Text += QString::number(itemText.charStyle(a).cshade2)+'\t';
Text += QString::number(itemText.charStyle(a).cscale)+'\t';
Text += QString::number(itemText.charStyle(a).cscalev)+'\t';
Text += QString::number(itemText.charStyle(a).cbase)+'\t';
Text += QString::number(itemText.charStyle(a).cshadowx)+'\t';
Text += QString::number(itemText.charStyle(a).cshadowy)+'\t';
Text += QString::number(itemText.charStyle(a).coutline)+'\t';
Text += QString::number(itemText.charStyle(a).cunderpos)+'\t';
Text += QString::number(itemText.charStyle(a).cunderwidth)+'\t';
Text += QString::number(itemText.charStyle(a).cstrikepos)+'\t';
Text += QString::number(itemText.charStyle(a).cstrikewidth)+'\n';
Text += itemText.charStyle(a).strokeColor()+"\t";
Text += QString::number(itemText.charStyle(a).strokeShade())+'\t';
Text += QString::number(itemText.charStyle(a).scaleH())+'\t';
Text += QString::number(itemText.charStyle(a).scaleV())+'\t';
Text += QString::number(itemText.charStyle(a).baselineOffset())+'\t';
Text += QString::number(itemText.charStyle(a).shadowXOffset())+'\t';
Text += QString::number(itemText.charStyle(a).shadowYOffset())+'\t';
Text += QString::number(itemText.charStyle(a).outlineWidth())+'\t';
Text += QString::number(itemText.charStyle(a).underlineOffset())+'\t';
Text += QString::number(itemText.charStyle(a).underlineWidth())+'\t';
Text += QString::number(itemText.charStyle(a).strikethruOffset())+'\t';
Text += QString::number(itemText.charStyle(a).strikethruWidth())+'\n';
}
}
Buffer->itemText = Text;
3343,8 → 3343,8
for (uint a = 0; a < itemTextCount; ++a)
{
const CharStyle& hl (itemText.charStyle(a));
int des = static_cast<int>(hl.cfont->descent() * (-hl.csize / 10.0));
int asc = static_cast<int>(hl.cfont->ascent() * (hl.csize / 10.0));
int des = static_cast<int>(hl.font()->descent() * (-hl.fontSize() / 10.0));
int asc = static_cast<int>(hl.font()->ascent() * (hl.fontSize() / 10.0));
if (asc > asce)
asce = asc;
if (des > desc)
/branches/Version13x/Scribus/scribus/scribusview.cpp
3000,8 → 3000,8
#ifndef NLS_PROTO
for (uint aa = 0; aa < currItem->itemText.count(); ++aa)
{
currItem->itemText.at(aa)->csize = QMAX(qRound(currItem->itemText.at(aa)->csize*scy), 1);
currItem->itemText.at(aa)->cscale = QMAX(QMIN(qRound(currItem->itemText.at(aa)->cscale*scx), 4000), 100);
currItem->itemText.at(aa)->setFontSize(QMAX(qRound(currItem->itemText.at(aa)->fontSize()*scy), 1));
currItem->itemText.at(aa)->setScaleH(QMAX(QMIN(qRound(currItem->itemText.at(aa)->scaleH()*scx), 4000), 100));
}
#endif
}
6966,7 → 6966,7
{
// bb->setLineSpacing(((bb->fontSize() / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100) + (bb->fontSize() / 10.0));
for (aa = 0; aa < bb->itemText.count(); ++aa)
bb->itemText.at(aa)->csize = QMAX(qRound(bb->itemText.at(aa)->csize*((scx+scy)/2)), 1);
bb->itemText.at(aa)->setFontSize(QMAX(qRound(bb->itemText.at(aa)->fontSize()*((scx+scy)/2)), 1));
if (bb->asPathText())
bb->updatePolyClip();
}
7209,11 → 7209,11
uint currItemTextCount=currItem->itemText.count();
for (a=0; a<currItemTextCount; ++a)
{
xp = static_cast<int>(currItem->itemText.at(a)->xp);
xp = static_cast<int>(currItem->itemText.at(a)->glyph.xoffset);
//If x pos of curr char is less than left position of current column, continue
if (xp+currItem->xPos()<cp-colWidth-colGap)
continue;
yp = static_cast<int>(currItem->itemText.at(a)->yp);
yp = static_cast<int>(currItem->itemText.at(a)->glyph.yoffset);
h = static_cast<int>(Doc->docParagraphStyles[currItem->itemText.at(a)->cab].lineSpacing());
 
if (a<currItemTextCount-1)
7232,7 → 7232,7
if (yp-h+currItem->yPos()<=yP && yp+currItem->yPos()>=yP)
{
//click where next char is on next line in same or next column
if (static_cast<int>(currItem->itemText.at(a+1)->yp)!=yp)
if (static_cast<int>(currItem->itemText.at(a+1)->glyph.yoffset)!=yp)
{
if (((currItem->itemText.at(a+1)->ch.at(0).latin1() == 13) || (currItem->itemText.at(a+1)->ch.at(0).latin1() == 28)))
currItem->CPos = a+1;
7373,7 → 7373,7
if (currItem->itemText.count() != 0)
{
a=currItem->itemText.count()-1;
int w = qRound(Cwidth(Doc, currItem->itemText.at(a)->cfont, currItem->itemText.at(a)->ch, currItem->itemText.at(a)->csize)*(currItem->itemText.at(a)->cscale / 1000.0));
int w = qRound(Cwidth(Doc, currItem->itemText.at(a)->font(), currItem->itemText.at(a)->ch, currItem->itemText.at(a)->fontSize())*(currItem->itemText.at(a)->scaleH() / 1000.0));
if (xp+currItem->xPos()+w<xP || yp+currItem->yPos()<yP)
currItem->CPos = a+1;
else
7389,19 → 7389,19
if (b<0)
b=0;
Doc->currentStyle.charStyle() = currItem->itemText.charStyle(b);
emit ItemTextStrike(currItem->itemText.at(b)->cstrikepos, currItem->itemText.at(b)->cstrikewidth);
emit ItemTextUnderline(currItem->itemText.at(b)->cunderpos, currItem->itemText.at(b)->cunderwidth);
emit ItemTextOutline(currItem->itemText.at(b)->coutline);
emit ItemTextShadow(currItem->itemText.at(b)->cshadowx, currItem->itemText.at(b)->cshadowy);
emit ItemTextSca(currItem->itemText.at(b)->cscale);
emit ItemTextScaV(currItem->itemText.at(b)->cscalev);
emit ItemTextFarben(currItem->itemText.at(b)->cstroke, currItem->itemText.at(b)->ccolor, currItem->itemText.at(b)->cshade2, currItem->itemText.at(b)->cshade);
emit ItemTextFont(currItem->itemText.at(b)->cfont->scName());
emit ItemTextSize(currItem->itemText.at(b)->csize);
emit ItemTextUSval(currItem->itemText.at(b)->cextra);
emit ItemTextStil(currItem->itemText.at(b)->cstyle);
emit ItemTextStrike(currItem->itemText.at(b)->strikethruOffset(), currItem->itemText.at(b)->strikethruWidth());
emit ItemTextUnderline(currItem->itemText.at(b)->underlineOffset(), currItem->itemText.at(b)->underlineWidth());
emit ItemTextOutline(currItem->itemText.at(b)->outlineWidth());
emit ItemTextShadow(currItem->itemText.at(b)->shadowXOffset(), currItem->itemText.at(b)->shadowYOffset());
emit ItemTextSca(currItem->itemText.at(b)->scaleH());
emit ItemTextScaV(currItem->itemText.at(b)->scaleV());
emit ItemTextFarben(currItem->itemText.at(b)->strokeColor(), currItem->itemText.at(b)->fillColor(), currItem->itemText.at(b)->strokeShade(), currItem->itemText.at(b)->fillShade());
emit ItemTextFont(currItem->itemText.at(b)->font()->scName());
emit ItemTextSize(currItem->itemText.at(b)->fontSize());
emit ItemTextUSval(currItem->itemText.at(b)->tracking());
emit ItemTextStil(currItem->itemText.at(b)->effects());
emit ItemTextAbs(currItem->itemText.at(b)->cab);
emit ItemTextBase(currItem->itemText.at(b)->cbase);
emit ItemTextBase(currItem->itemText.at(b)->baselineOffset());
return true;
}
else
7524,7 → 7524,7
int offs = QMIN(currItem->CPos-1, static_cast<int>(currItem->itemText.count()-1));
if (currItem->CPos < static_cast<int>(currItem->itemText.count()-1))
{
if (currItem->itemText.at(offs+1)->cstyle & 4096)
if (currItem->itemText.at(offs+1)->effects() & ScStyle_SuppressSpace)
{
if (currItem->CPos < static_cast<int>(currItem->itemText.count()-1))
currItem->CPos++;
7531,7 → 7531,7
return;
}
}
if (currItem->itemText.at(offs)->yp == 0)
if (currItem->itemText.at(offs)->glyph.yoffset == 0)
return;
if (Doc->CurTimer != 0)
Doc->CurTimer->stop();
7540,51 → 7540,51
chx = currItem->ExpandToken(offs);
if (chx == QChar(29))
chx = " ";
int chs = currItem->itemText.at(offs)->csize;
int chs = currItem->itemText.at(offs)->fontSize();
currItem->SetZeichAttr(currItem->itemText.charStyle(offs), &chs, &chx);
if (currItem->CPos != static_cast<int>(currItem->itemText.count()))
{
if (currItem->itemText.at(currItem->CPos)->ch == QChar(9))
{
xp = static_cast<int>(currItem->itemText.at(currItem->CPos-1)->xp);
chs = currItem->itemText.at(currItem->CPos-1)->csize;
xp = static_cast<int>(currItem->itemText.at(currItem->CPos-1)->glyph.xoffset);
chs = currItem->itemText.at(currItem->CPos-1)->fontSize();
chx = currItem->itemText.at(currItem->CPos-1)->ch;
xp += qRound(Cwidth(Doc, currItem->itemText.at(currItem->CPos-1)->cfont, chx, chs)*(currItem->itemText.at(currItem->CPos-1)->cscale / 1000.0));
xp += qRound(Cwidth(Doc, currItem->itemText.at(currItem->CPos-1)->font(), chx, chs)*(currItem->itemText.at(currItem->CPos-1)->scaleH() / 1000.0));
}
else
xp = static_cast<int>(currItem->itemText.at(offs+1)->xp);
xp = static_cast<int>(currItem->itemText.at(offs+1)->glyph.xoffset);
}
else
{
xp = static_cast<int>(currItem->itemText.at(offs)->xp);
xp = static_cast<int>(currItem->itemText.at(offs)->glyph.xoffset);
//TODO Change placement of cursor to middle or right if here and cursor is at left..
if (currItem->itemText.at(offs)->ch != QChar(9))
{
chs = currItem->itemText.at(offs)->csize;
chs = currItem->itemText.at(offs)->fontSize();
chx = currItem->itemText.at(offs)->ch;
xp += qRound(Cwidth(Doc, currItem->itemText.at(offs)->cfont, chx, chs)*(currItem->itemText.at(offs)->cscale / 1000.0));
xp += qRound(Cwidth(Doc, currItem->itemText.at(offs)->font(), chx, chs)*(currItem->itemText.at(offs)->scaleH() / 1000.0));
}
}
if (currItem->CPos != static_cast<int>(currItem->itemText.count()))
{
if (currItem->itemText.at(offs)->yp != currItem->itemText.at(offs+1)->yp)
if (currItem->itemText.at(offs)->glyph.yoffset != currItem->itemText.at(offs+1)->glyph.yoffset)
{
offs++;
if ((currItem->itemText.at(offs)->ch == QChar(13)) || (currItem->itemText.at(offs)->ch == QChar(28)))
{
offs--;
xp = static_cast<int>(currItem->itemText.at(offs)->xp);
chs = currItem->itemText.at(offs)->csize;
xp = static_cast<int>(currItem->itemText.at(offs)->glyph.xoffset);
chs = currItem->itemText.at(offs)->fontSize();
chx = currItem->itemText.at(offs)->ch;
xp += qRound(Cwidth(Doc, currItem->itemText.at(offs)->cfont, chx, chs)*(currItem->itemText.at(offs)->cscale / 1000.0));
xp += qRound(Cwidth(Doc, currItem->itemText.at(offs)->font(), chx, chs)*(currItem->itemText.at(offs)->scaleH() / 1000.0));
}
else
xp = static_cast<int>(currItem->itemText.at(offs)->xp);
xp = static_cast<int>(currItem->itemText.at(offs)->glyph.xoffset);
}
}
yp = static_cast<int>(currItem->itemText.at(offs)->yp);
desc = static_cast<int>(currItem->itemText.at(offs)->cfont->descent() * (-currItem->itemText.at(offs)->csize / 10.0));
asce = static_cast<int>(currItem->itemText.at(offs)->cfont->ascent() * (currItem->itemText.at(offs)->csize / 10.0));
yp = static_cast<int>(currItem->itemText.at(offs)->glyph.yoffset);
desc = static_cast<int>(currItem->itemText.at(offs)->font()->descent() * (-currItem->itemText.at(offs)->fontSize() / 10.0));
asce = static_cast<int>(currItem->itemText.at(offs)->font()->ascent() * (currItem->itemText.at(offs)->fontSize() / 10.0));
}
else
{
7616,10 → 7616,10
}
else
{
xp = static_cast<int>(currItem->itemText.at(currItem->CPos)->xp);
yp = static_cast<int>(currItem->itemText.at(currItem->CPos)->yp);
desc = static_cast<int>(currItem->itemText.at(currItem->CPos)->cfont->descent() * (-currItem->itemText.at(currItem->CPos)->csize / 10.0));
asce = static_cast<int>(currItem->itemText.at(currItem->CPos)->cfont->ascent() * (currItem->itemText.at(currItem->CPos)->csize / 10.0));
xp = static_cast<int>(currItem->itemText.at(currItem->CPos)->glyph.xoffset);
yp = static_cast<int>(currItem->itemText.at(currItem->CPos)->glyph.yoffset);
desc = static_cast<int>(currItem->itemText.at(currItem->CPos)->font()->descent() * (-currItem->itemText.at(currItem->CPos)->fontSize() / 10.0));
asce = static_cast<int>(currItem->itemText.at(currItem->CPos)->font()->ascent() * (currItem->itemText.at(currItem->CPos)->fontSize() / 10.0));
}
}
}
9517,55 → 9517,49
if (hg->ch == QChar(4))
hg->ch = QChar(9);
it++;
hg->cfont = (*Doc->AllFonts)[*it];
hg->setFont((*Doc->AllFonts)[*it]);
it++;
hg->csize = qRound((*it).toDouble() * 10);
hg->setFontSize(qRound((*it).toDouble() * 10));
it++;
hg->ccolor = *it;
hg->setFillColor(*it);
it++;
hg->cextra = (*it).toInt();
hg->setTracking((*it).toInt());
it++;
hg->cshade = (*it).toInt();
hg->cselect = false;
hg->setFillShade((*it).toInt());
it++;
hg->cstyle = static_cast<StyleFlag>(it == NULL ? 0 : (*it).toInt());
hg->setEffects(static_cast<StyleFlag>(it == NULL ? 0 : (*it).toInt()));
it++;
hg->cab = it == NULL ? 0 : (*it).toInt();
it++;
hg->cstroke = it == NULL ? CommonStrings::None : *it;
hg->setStrokeColor(it == NULL ? CommonStrings::None : *it);
it++;
hg->cshade2 = it == NULL ? 100 : (*it).toInt();
hg->setStrokeShade(it == NULL ? 100 : (*it).toInt());
it++;
if (it == NULL)
hg->cscale = 1000;
hg->setScaleH(1000);
else
hg->cscale = QMIN(QMAX((*it).toInt(), 100), 4000);
hg->setScaleH(QMIN(QMAX((*it).toInt(), 100), 4000));
it++;
if (it == NULL)
hg->cscalev = 1000;
hg->setScaleV(1000);
else
hg->cscalev = QMIN(QMAX((*it).toInt(), 100), 4000);
hg->setScaleV(QMIN(QMAX((*it).toInt(), 100), 4000));
it++;
hg->cbase = it == NULL ? 0 : (*it).toInt();
hg->setBaselineOffset(it == NULL ? 0 : (*it).toInt());
it++;
hg->cshadowx = it == NULL ? 50 : (*it).toInt();
hg->setShadowXOffset(it == NULL ? 50 : (*it).toInt());
it++;
hg->cshadowy = it == NULL ? -50 : (*it).toInt();
hg->setShadowYOffset(it == NULL ? -50 : (*it).toInt());
it++;
hg->coutline = it == NULL ? 10 : (*it).toInt();
hg->setOutlineWidth(it == NULL ? 10 : (*it).toInt());
it++;
hg->cunderpos = it == NULL ? -1 : (*it).toInt();
hg->setUnderlineOffset(it == NULL ? -1 : (*it).toInt());
it++;
hg->cunderwidth = it == NULL ? -1 : (*it).toInt();
hg->setUnderlineWidth(it == NULL ? -1 : (*it).toInt());
it++;
hg->cstrikepos = it == NULL ? -1 : (*it).toInt();
hg->setStrikethruOffset(it == NULL ? -1 : (*it).toInt());
it++;
hg->cstrikewidth = it == NULL ? -1 : (*it).toInt();
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->setStrikethruWidth(it == NULL ? -1 : (*it).toInt());
Doc->Items->at(z)->itemText.append(hg);
}
}
9932,12 → 9926,12
if (chx == QChar(32))
continue;
}
int chs = hl->csize;
if (hl->cstyle & 64)
int chs = hl->fontSize();
if (hl->effects() & ScStyle_SmallCaps)
{
if (chx.upper() != chx)
{
chs = QMAX(static_cast<int>(hl->csize * Doc->typographicSettings.valueSmallCaps / 100), 1);
chs = QMAX(static_cast<int>(hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100), 1);
chx = chx.upper();
}
}
9947,7 → 9941,7
if (currItem->asPathText())
{
QWMatrix trafo = QWMatrix( 1, 0, 0, -1, -hl->PRot, 0 );
trafo *= QWMatrix( hl->PtransX, hl->PtransY, hl->PtransY, -hl->PtransX, hl->xp, hl->yp);
trafo *= QWMatrix( hl->PtransX, hl->PtransY, hl->PtransY, -hl->PtransX, hl->glyph.xoffset, hl->glyph.yoffset);
if (currItem->rotation() != 0)
{
QWMatrix sca;
9956,22 → 9950,22
trafo *= sca;
}
chma.scale(csi, csi);
chma2.scale(hl->cscale / 1000.0, hl->cscalev / 1000.0);
chma2.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
if (currItem->reversed())
{
if (a < currItem->itemText.count()-1)
wide = Cwidth(Doc, hl->cfont, chx, hl->csize, currItem->itemText.at(a+1)->ch);
wide = Cwidth(Doc, hl->font(), chx, hl->fontSize(), currItem->itemText.at(a+1)->ch);
else
wide = Cwidth(Doc, hl->cfont, chx, hl->csize);
wide = Cwidth(Doc, hl->font(), chx, hl->fontSize());
chma3.scale(-1, 1);
chma3.translate(-wide, 0);
chma4.translate(0, currItem->BaseOffs-((hl->csize / 10.0) * (hl->cscalev / 1000.0)));
chma4.translate(0, currItem->BaseOffs-((hl->fontSize() / 10.0) * (hl->scaleV() / 1000.0)));
}
else
chma4.translate(0, currItem->BaseOffs-((hl->csize / 10.0) * (hl->cscalev / 1000.0)));
if (hl->cbase != 0)
chma6.translate(0, -(hl->csize / 10.0) * (hl->cbase / 1000.0));
pts = currItem->itemText.at(a)->cfont->outline(chr);
chma4.translate(0, currItem->BaseOffs-((hl->fontSize() / 10.0) * (hl->scaleV() / 1000.0)));
if (hl->baselineOffset() != 0)
chma6.translate(0, -(hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
pts = currItem->itemText.at(a)->font()->outline(chr);
if (pts.size() < 4)
continue;
pts.map(chma * chma2 * chma3 * chma4 * chma6);
9986,15 → 9980,15
else
{
chma.scale(csi, csi);
pts = hl->cfont->outline(chr);
pts = hl->font()->outline(chr);
if (pts.size() < 4)
continue;
FPoint origin = hl->cfont->origin(chr);
FPoint origin = hl->font()->origin(chr);
x = origin.x() * csi;
y = origin.y() * csi;
pts.map(chma);
chma = QWMatrix();
chma.scale(hl->cscale / 1000.0, hl->cscalev / 1000.0);
chma.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
pts.map(chma);
chma = QWMatrix();
if (currItem->imageFlippedH() && (!currItem->reversed()))
10016,12 → 10010,12
bb->PoLine = pts.copy();
if (!currItem->asPathText())
bb->setRotation(currItem->rotation());
bb->setFillColor(hl->ccolor);
bb->setFillShade(hl->cshade);
if (currItem->itemText.at(a)->cstyle & 4)
bb->setFillColor(hl->fillColor());
bb->setFillShade(hl->fillShade());
if (currItem->itemText.at(a)->effects() & ScStyle_Outline)
{
bb->setLineColor(hl->cstroke);
bb->setLineShade(hl->cshade2);
bb->setLineColor(hl->strokeColor());
bb->setLineShade(hl->strokeShade());
}
else
{
10028,7 → 10022,7
bb->setLineColor(CommonStrings::None);
bb->setLineShade(100);
}
bb->setLineWidth(chs * hl->coutline / 10000.0);
bb->setLineWidth(chs * hl->outlineWidth() / 10000.0);
if (currItem->asPathText())
AdjustItemSize(bb);
else
10038,19 → 10032,19
FPoint tp(getMaxClipF(&bb->PoLine));
bb->setWidthHeight(tp.x(), tp.y());
bb->Clip = FlattenPath(bb->PoLine, bb->Segments);
double textX = hl->xp;
double textY = hl->yp;
double textX = hl->glyph.xoffset;
double textY = hl->glyph.yoffset;
chma6 = QWMatrix();
if (hl->cbase != 0)
textY -= (hl->csize / 10.0) * (hl->cbase / 1000.0);
if (hl->baselineOffset() != 0)
textY -= (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
if (a < currItem->itemText.count()-1)
wide = Cwidth(Doc, hl->cfont, chx, hl->csize, currItem->itemText.at(a+1)->ch);
wide = Cwidth(Doc, hl->font(), chx, hl->fontSize(), currItem->itemText.at(a+1)->ch);
else
wide = Cwidth(Doc, hl->cfont, chx, hl->csize);
wide = Cwidth(Doc, hl->font(), chx, hl->fontSize());
if (currItem->imageFlippedH())
textX = currItem->width() - textX - wide;
if (currItem->imageFlippedV())
textY = currItem->height() - textY+ y - (bb->height() - y);
textY = currItem->height() - textY + y - (bb->height() - y);
FPoint npo(textX+x, textY-y, 0.0, 0.0, currItem->rotation(), 1.0, 1.0);
bb->moveBy(npo.x(),npo.y());
}
/branches/Version13x/Scribus/scribus/pageitem_textframe.cpp
206,7 → 206,7
m_Doc->docParagraphStyles[xxx].setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(LineSpMode));
m_Doc->docParagraphStyles[xxx].setUseBaselineGrid(LineSpMode == ParagraphStyle::BaselineGridLineSpacing);
m_Doc->docParagraphStyles[xxx].setLineSpacing(LineSp);
m_Doc->docParagraphStyles[xxx].charStyle().csize = m_FontSize;
m_Doc->docParagraphStyles[xxx].charStyle().fontSize() = m_FontSize;
m_Doc->docParagraphStyles[xxx].setLeftMargin(0);
m_Doc->docParagraphStyles[xxx].setFirstIndent(0);
m_Doc->docParagraphStyles[xxx].setGapBefore(0);
284,8 → 284,8
chs = qRound(m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines() * 10);
}
else
chs = hl->csize;
desc2 = -hl->cfont->descent() * (chs / 10.0);
chs = hl->fontSize();
desc2 = -hl->font()->descent() * (chs / 10.0);
CurY = TExtra+lineCorr;
}
else // no dropcap:
319,7 → 319,7
chx = ExpandToken(a);
absa = hl->cab;
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
m_Doc->docParagraphStyles[absa].setLineSpacing(RealFHeight(m_Doc, hl->cfont, hl->csize));
m_Doc->docParagraphStyles[absa].setLineSpacing(RealFHeight(m_Doc, hl->font(), hl->fontSize()));
// find out about par gap and dropcap
if (a == 0)
{
363,17 → 363,22
CurY += m_Doc->docParagraphStyles[absa].gapBefore();
}
}
hl->cstyle &= ~ScStyle_DropCap;
hl->cstyle &= ~ScStyle_SmartHyphenVisible;
{
StyleFlag fl = hl->effects();
fl &= ~ScStyle_DropCap;
fl &= ~ScStyle_SmartHyphenVisible;
hl->setEffects(fl);
}
// No space at begin of line
if ( //((m_Doc->docParagraphStyles[absa].alignment() == 3) || (m_Doc->docParagraphStyles[absa].alignment() == 4)) &&
(LiList.count() == 0) && (hl->ch == " "))
{
hl->cstyle |= ScStyle_SuppressSpace;
hl->setEffects(hl->effects() | ScStyle_SuppressSpace);
continue;
}
else
hl->cstyle &= ~ScStyle_SuppressSpace;
hl->setEffects(hl->effects() & ~ScStyle_SuppressSpace);
 
if (LiList.count() == 0)
{
// more about par gap and dropcaps
394,7 → 399,7
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
CurY += m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1);
else
CurY += RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * (DropLines-1);
CurY += RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * (DropLines-1);
}
}
}
405,24 → 410,24
// dropcap active?
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
{
chsd = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
chsd = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
else
{
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
{
chsd = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
chsd = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
else
{
double currasce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chsd = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
double currasce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chsd = qRound(10 * ((currasce * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((currasce * (DropLines-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
}
hl->cstyle |= ScStyle_DropCap;
hl->setEffects(hl->effects() | ScStyle_DropCap);
}
else // ! dropCapMode
{
429,7 → 434,7
if ((hl->ch == SpecialChars::OBJECT) && (hl->cembedded != 0))
chs = qRound((hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 10);
else
chs = hl->csize;
chs = hl->fontSize();
}
// Smallcaps and such
oldCurY = SetZeichAttr(*hl, &chs, &chx);
454,10 → 459,10
chx3 = "-";
else
chx3 = itemText.at(a+1)->ch;
wide = Cwidth(m_Doc, hl->cfont, chx2, chs, chx3);
wide = Cwidth(m_Doc, hl->font(), chx2, chs, chx3);
}
else
wide = Cwidth(m_Doc, hl->cfont, chx2, chs);
wide = Cwidth(m_Doc, hl->font(), chx2, chs);
}
if (DropCmode)
{
472,15 → 477,15
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
asce = m_Doc->docParagraphStyles[absa].lineSpacing() * DropLines;
else
asce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * DropLines;
asce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * DropLines;
}
hl->cscalev = qRound(asce / (hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 1000.0);
hl->cscale = hl->cscalev;
hl->setScaleV(qRound(asce / (hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 1000.0));
hl->setScaleH(hl->scaleV());
}
else
{
wide = RealCWidth(m_Doc, hl->cfont, chx2, chsd);
asce = RealCHeight(m_Doc, hl->cfont, chx2, chsd);
wide = RealCWidth(m_Doc, hl->font(), chx2, chsd);
asce = RealCHeight(m_Doc, hl->font(), chx2, chsd);
}
desc2 = 0;
desc = 0;
488,7 → 493,7
else
{
// find ascent / descent
double hlcsize10=hl->csize / 10.0;
double hlcsize10=hl->fontSize() / 10.0;
if ((hl->ch == SpecialChars::OBJECT) && (hl->cembedded != 0))
{
desc = desc2 = 0;
495,11 → 500,11
}
else
{
desc = desc2 = -hl->cfont->descent() * hlcsize10;
desc = desc2 = -hl->font()->descent() * hlcsize10;
}
asce = hl->cfont->ascent() * hlcsize10;
asce = hl->font()->ascent() * hlcsize10;
}
wide = wide * (hl->cscale / 1000.0);
wide = wide * (hl->scaleH() / 1000.0);
fBorder = false;
// end of col reached?
if (CurY+BExtra+lineCorr > Height)
524,9 → 529,9
if (DropCmode)
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
desc2 = -hl->cfont->descent() * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->descent() * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
else
desc2 = -hl->cfont->descent() * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->descent() * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
}
if (DropCmode)
DropLines = m_Doc->docParagraphStyles[hl->cab].dropCapLines();
634,9 → 639,9
if (DropCmode)
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
desc2 = -hl->cfont->descent() * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->descent() * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
else
desc2 = -hl->cfont->descent() * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->descent() * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
}
if (DropCmode)
DropLines = m_Doc->docParagraphStyles[hl->cab].dropCapLines();
689,8 → 694,8
if (!AbsHasDrop)
CurX += m_Doc->docParagraphStyles[hl->cab].leftMargin();
if (opticalMargins) {
int chs = static_cast<int>(itemText.charStyle(a).csize * (itemText.charStyle(a).cscale / 1000.0));
double leftCorr = RealCWidth(m_Doc, itemText.charStyle(a).cfont, itemText.text(a), chs);
int chs = static_cast<int>(itemText.charStyle(a).fontSize() * (itemText.charStyle(a).scaleH() / 1000.0));
double leftCorr = RealCWidth(m_Doc, itemText.charStyle(a).font(), itemText.text(a), chs);
if (QString("'ยด`").find(itemText.text(a)) >= 0
|| itemText.text(a) == QChar(0x2018)
|| itemText.text(a) == QChar(0x2019)
711,8 → 716,8
leftCorr *= -0.5;
else {
leftCorr = 0;
// leftCorr = Cwidth(m_Doc, itemText.charStyle(a).cfont, QChar('o'), chs, itemText.text(a));
// leftCorr -= Cwidth(m_Doc, itemText.charStyle(a).cfont, QChar('o'), chs);
// leftCorr = Cwidth(m_Doc, itemText.charStyle(a).font(), QChar('o'), chs, itemText.text(a));
// leftCorr -= Cwidth(m_Doc, itemText.charStyle(a).font(), QChar('o'), chs);
}
CurX += leftCorr;
}
782,25 → 787,25
}
// remember y pos
hl->yp = CurY + oldCurY;
hl->glyph.yoffset = CurY + oldCurY;
if (DropCmode)
hl->yp -= RealCHeight(m_Doc, hl->cfont, chx2, chsd) - RealCAscent(m_Doc, hl->cfont, chx2, chsd);
hl->glyph.yoffset -= RealCHeight(m_Doc, hl->font(), chx2, chsd) - RealCAscent(m_Doc, hl->font(), chx2, chsd);
// find tracking
if (LiList.count() == 0)
{
itemText.at(a)->cstyle |= ScStyle_StartOfLine;
itemText.at(a)->setEffects(itemText.at(a)->effects() | ScStyle_StartOfLine);
kernVal = 0;
}
else
{
kernVal = chs * hl->cextra / 10000.0;
itemText.at(a)->cstyle &= ~ScStyle_StartOfLine;
kernVal = chs * hl->tracking() / 10000.0;
itemText.at(a)->setEffects(itemText.at(a)->effects() & ~ScStyle_StartOfLine);
}
// remember x pos
if (!RTab)
{
// hl->xp = QMAX(CurX+kernVal, ColBound.x());
hl->xp = CurX; // needed for left optical margin
// hl->glyph.xoffset = QMAX(CurX+kernVal, ColBound.x());
hl->glyph.xoffset = CurX; // needed for left optical margin
CurX += wide+kernVal;
// CurX = QMAX(CurX, ColBound.x());
}
807,7 → 812,7
else
{
CurX = QMAX(CurX, ColBound.x());
hl->xp = CurX;
hl->glyph.xoffset = CurX;
}
// more right tab stuff
if ((TabCode == 4) && (RTab))
816,12 → 821,12
CurX = QMAX(CurX, ColBound.x());
}
// hyphenation
if (((hl->cstyle & ScStyle_HyphenationPossible) || hl->ch == "-") && (HyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0))
if (((hl->effects() & ScStyle_HyphenationPossible) || hl->ch == "-") && (HyphenCount < m_Doc->HyCount || m_Doc->HyCount == 0))
{
if (hl->cstyle & ScStyle_HyphenationPossible)
if (hl->effects() & ScStyle_HyphenationPossible)
{
pt1 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0))), qRound(CurY+desc));
pt2 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0))), qRound(ceil(CurY-asce)));
pt1 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0))), qRound(CurY+desc));
pt2 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0))), qRound(ceil(CurY-asce)));
}
else
{
848,12 → 853,12
//Hm.
Zli = new ZZ;
Zli->Zeich = chx;
Zli->Farb = hl->ccolor;
Zli->shade = hl->cshade;
Zli->Farb2 = hl->cstroke;
Zli->shade2 = hl->cshade2;
Zli->xco = hl->xp;
Zli->yco = hl->yp;
Zli->Farb = hl->fillColor();
Zli->shade = hl->fillShade();
Zli->Farb2 = hl->strokeColor();
Zli->shade2 = hl->strokeShade();
Zli->xco = hl->glyph.xoffset;
Zli->yco = hl->glyph.yoffset;
Zli->Sele = hl->cselect;
if (DropCmode)
{
863,22 → 868,22
else
{
Zli->Siz = chs;
Zli->realSiz = hl->csize;
Zli->realSiz = hl->fontSize();
}
Zli->Style = hl->cstyle;
Zli->ZFo = hl->cfont;
Zli->Style = hl->effects();
Zli->ZFo = hl->font();
Zli->wide = wide;
Zli->kern = kernVal;
Zli->scale = hl->cscale;
Zli->scalev = hl->cscalev;
Zli->base = hl->cbase;
Zli->shadowX = hl->cshadowx;
Zli->shadowY = hl->cshadowy;
Zli->outline = hl->coutline;
Zli->underpos = hl->cunderpos;
Zli->underwidth = hl->cunderwidth;
Zli->strikepos = hl->cstrikepos;
Zli->strikewidth = hl->cstrikewidth;
Zli->scale = hl->scaleH();
Zli->scalev = hl->scaleV();
Zli->base = hl->baselineOffset();
Zli->shadowX = hl->shadowXOffset();
Zli->shadowY = hl->shadowYOffset();
Zli->outline = hl->outlineWidth();
Zli->underpos = hl->underlineOffset();
Zli->underwidth = hl->underlineWidth();
Zli->strikepos = hl->strikethruOffset();
Zli->strikewidth = hl->strikethruWidth();
Zli->embedded = hl->cembedded;
if (((hl->ch == " ") || (hl->ch == SpecialChars::TAB)) && (!outs))
{
886,17 → 891,17
{
if (itemText.at(a-1)->ch != " ")
{
LastXp = hl->xp;
LastXp = hl->glyph.xoffset;
LastSP = BuPos;
}
}
else
{
LastXp = hl->xp;
LastXp = hl->glyph.xoffset;
LastSP = BuPos;
}
}
if (((hl->cstyle & ScStyle_HyphenationPossible) || (hl->ch == "-")) && (!outs))
if (((hl->effects() & ScStyle_HyphenationPossible) || (hl->ch == "-")) && (!outs))
{
if ((HyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0))
{
903,7 → 908,7
if (hl->ch == "-")
LastXp = CurX;
else
LastXp = CurX + Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0);
LastXp = CurX + Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0);
LastSP = BuPos + 1;
}
}
917,8 → 922,8
for (uint rtx = StartRT; rtx < LiList.count(); ++rtx)
{
LiList.at(rtx)->xco = QMAX(LiList.at(rtx)->xco-(wide+kernVal) / cen, 0.0);
itemText.at(StartRT2+rtx2)->xp = QMAX(itemText.at(StartRT2+rtx2)->xp-(wide+kernVal) / cen, 0.0);
if (itemText.at(StartRT2+rtx2)->xp < RTabX)
itemText.at(StartRT2+rtx2)->glyph.xoffset = QMAX(itemText.at(StartRT2+rtx2)->glyph.xoffset-(wide+kernVal) / cen, 0.0);
if (itemText.at(StartRT2+rtx2)->glyph.xoffset < RTabX)
{
RTab = false;
TabCode = 0;
945,7 → 950,7
int ol1 = qRound((by + CurY - m_Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / m_Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * m_Doc->typographicSettings.valueBaseGrid + m_Doc->typographicSettings.offsetBaseGrid - by;
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
}
else
953,19 → 958,19
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
{
CurY -= m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
}
else
{
double currasce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
double currasce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
CurY -= currasce * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*currasce)));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*currasce)));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*currasce)));
}
}
tcli.setPoint(2, QPoint(qRound(maxDX), qRound(maxDY)));
tcli.setPoint(3, QPoint(qRound(hl->xp), qRound(maxDY)));
tcli.setPoint(3, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY)));
cm = QRegion(pf2.xForm(tcli));
cl = cl.subtract(cm);
}
986,7 → 991,7
if (m_Doc->docParagraphStyles[absa].alignment() != 0)
{
// find end of line
EndX = floor(hl->xp - 1);
EndX = floor(hl->glyph.xoffset - 1);
// qDebug(QString("endx start=%1, hl is '%2'").arg(EndX).arg(hl->ch));
do
{
1052,37 → 1057,37
hl = itemText.at(a);
//not needed any more: a++;
// Fix incorrect right flush for full lines: ? -AV
LastXp = hl->xp + Cwidth(m_Doc, hl->cfont, hl->ch, hl->csize) * (hl->cscale / 1000.0);
if (hl->cstyle & ScStyle_HyphenationPossible)
LastXp = hl->glyph.xoffset + Cwidth(m_Doc, hl->font(), hl->ch, hl->fontSize()) * (hl->scaleH() / 1000.0);
if (hl->effects() & ScStyle_HyphenationPossible)
{
// insert hyphen
HyphenCount++;
hl->cstyle |= ScStyle_SmartHyphenVisible;
hl->setEffects(hl->effects() | ScStyle_SmartHyphenVisible);
Zli = new ZZ;
Zli->Zeich = "-";
Zli->Farb = itemText.at(a)->ccolor;
Zli->Farb2 = itemText.at(a)->cstroke;
Zli->shade = itemText.at(a)->cshade;
Zli->shade2 = itemText.at(a)->cshade2;
Zli->xco = LastXp - Cwidth(m_Doc, itemText.at(a)->cfont, "-", itemText.at(a)->csize) * (itemText.at(a)->cscale / 1000.0);
Zli->yco = itemText.at(a)->yp;
Zli->Farb = itemText.at(a)->fillColor();
Zli->Farb2 = itemText.at(a)->strokeColor();
Zli->shade = itemText.at(a)->fillShade();
Zli->shade2 = itemText.at(a)->strokeShade();
Zli->xco = LastXp - Cwidth(m_Doc, itemText.at(a)->font(), "-", itemText.at(a)->fontSize()) * (itemText.at(a)->scaleH() / 1000.0);
Zli->yco = itemText.at(a)->glyph.yoffset;
Zli->Sele = itemText.at(a)->cselect;
Zli->Siz = itemText.at(a)->csize;
Zli->realSiz = itemText.at(a)->csize;
Zli->Style = itemText.at(a)->cstyle;
Zli->ZFo = itemText.at(a)->cfont;
Zli->wide = Cwidth(m_Doc, itemText.at(a)->cfont, "-", itemText.at(a)->csize) * (itemText.at(a)->cscale / 1000.0);
Zli->kern = itemText.at(a)->csize * itemText.at(a)->cextra / 10000.0;
Zli->scale = itemText.at(a)->cscale;
Zli->scalev = itemText.at(a)->cscalev;
Zli->base = itemText.at(a)->cbase;
Zli->shadowX = itemText.at(a)->cshadowx;
Zli->shadowY = itemText.at(a)->cshadowy;
Zli->outline = itemText.at(a)->coutline;
Zli->underpos = itemText.at(a)->cunderpos;
Zli->underwidth = itemText.at(a)->cunderwidth;
Zli->strikepos = itemText.at(a)->cstrikepos;
Zli->strikewidth = itemText.at(a)->cstrikewidth;
Zli->Siz = itemText.at(a)->fontSize();
Zli->realSiz = itemText.at(a)->fontSize();
Zli->Style = itemText.at(a)->effects();
Zli->ZFo = itemText.at(a)->font();
Zli->wide = Cwidth(m_Doc, itemText.at(a)->font(), "-", itemText.at(a)->fontSize()) * (itemText.at(a)->scaleH() / 1000.0);
Zli->kern = itemText.at(a)->fontSize() * itemText.at(a)->tracking() / 10000.0;
Zli->scale = itemText.at(a)->scaleH();
Zli->scalev = itemText.at(a)->scaleV();
Zli->base = itemText.at(a)->baselineOffset();
Zli->shadowX = itemText.at(a)->shadowXOffset();
Zli->shadowY = itemText.at(a)->shadowYOffset();
Zli->outline = itemText.at(a)->outlineWidth();
Zli->underpos = itemText.at(a)->underlineOffset();
Zli->underwidth = itemText.at(a)->underlineWidth();
Zli->strikepos = itemText.at(a)->strikethruOffset();
Zli->strikewidth = itemText.at(a)->strikethruWidth();
Zli->embedded = 0;
LiList.insert(LastSP+1, Zli);
LastSP += 2;
1091,7 → 1096,7
else
{
HyphenCount = 0;
hl->cstyle &= ~ScStyle_SmartHyphenVisible;
hl->setEffects(hl->effects() & ~ScStyle_SmartHyphenVisible);
}
BuPos = LastSP;
// Justification
1098,7 → 1103,7
if (m_Doc->docParagraphStyles[absa].alignment() != 0)
{
// find end of line
EndX = floor(hl->xp);
EndX = floor(hl->glyph.xoffset);
// qDebug(QString("endx start=%1, hl is '%2'").arg(EndX).arg(hl->ch));
do
{
1313,10 → 1318,10
}
}
hl->xp = CurX;
hl->yp = CurY;
LiList.at(LiList.count()-1)->xco = hl->xp;
LiList.at(LiList.count()-1)->yco = hl->yp;
hl->glyph.xoffset = CurX;
hl->glyph.yoffset = CurY;
LiList.at(LiList.count()-1)->xco = hl->glyph.xoffset;
LiList.at(LiList.count()-1)->yco = hl->glyph.yoffset;
 
if (LiList.count() != 0)
{
1391,8 → 1396,8
double wide2 = 0;
Zli2 = LiList.at(zc);
double xcoZli = Zli2->xco;
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
itemText.at(startLin+zc)->glyph.xoffset = Zli2->xco;
itemText.at(startLin+zc)->glyph.yoffset = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
1595,8 → 1600,8
Zli2 = LiList.at(zc);
double xcoZli = Zli2->xco;
 
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
itemText.at(startLin+zc)->glyph.xoffset = Zli2->xco;
itemText.at(startLin+zc)->glyph.yoffset = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
1690,7 → 1695,7
m_Doc->docParagraphStyles[xxx].setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(LineSpMode));
m_Doc->docParagraphStyles[xxx].setUseBaselineGrid(LineSpMode == ParagraphStyle::BaselineGridLineSpacing);
m_Doc->docParagraphStyles[xxx].setLineSpacing(LineSp);
m_Doc->docParagraphStyles[xxx].charStyle().csize = m_FontSize;
m_Doc->docParagraphStyles[xxx].charStyle().fontSize() = m_FontSize;
m_Doc->docParagraphStyles[xxx].setLeftMargin(0);
m_Doc->docParagraphStyles[xxx].setFirstIndent(0);
m_Doc->docParagraphStyles[xxx].setGapBefore(0);
1765,38 → 1770,38
tTabValues = TabValues;
else
tTabValues = m_Doc->docParagraphStyles[hl->cab].tabValues();
if (hl->cstyle & ScStyle_StartOfLine)
if (hl->effects() & ScStyle_StartOfLine)
tabCc = 0;
chx = hl->ch;
if (hl->yp == 0)
if (hl->glyph.yoffset == 0)
continue;
if (hl->ch == QChar(30))
chx = ExpandToken(a);
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
QColor tmp;
SetFarbe(&tmp, hl->ccolor, hl->cshade);
SetFarbe(&tmp, hl->fillColor(), hl->fillShade());
p->setBrush(tmp);
}
if (hl->cstroke != CommonStrings::None)
if (hl->strokeColor() != CommonStrings::None)
{
QColor tmp;
SetFarbe(&tmp, hl->cstroke, hl->cshade2);
SetFarbe(&tmp, hl->strokeColor(), hl->strokeShade());
p->setPen(tmp, 1, SolidLine, FlatCap, MiterJoin);
}
chs = hl->csize;
if (hl->cstyle & ScStyle_DropCap)
chs = hl->fontSize();
if (hl->effects() & ScStyle_DropCap)
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
else
{
if (m_Doc->docParagraphStyles[hl->cab].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
chs = qRound(10 * ((m_Doc->docParagraphStyles[hl->cab].lineSpacing() * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->docParagraphStyles[hl->cab].lineSpacing() * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
else
{
double currasce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chs = qRound(10 * ((currasce * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(m_Doc, hl->cfont, chx, 10)));
double currasce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chs = qRound(10 * ((currasce * (m_Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(m_Doc, hl->font(), chx, 10)));
}
}
}
1804,34 → 1809,34
if ((chx == SpecialChars::TAB) && (tTabValues.count() != 0) && (tabCc < tTabValues.count()) && (!tTabValues[tabCc].tabFillChar.isNull()))
{
QString tabFillCharQStr(tTabValues[tabCc].tabFillChar);
double wt = Cwidth(m_Doc, hl->cfont, tabFillCharQStr, chs);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
desc = hl->cfont->descent() * (-chs / 10.0);
asce = hl->cfont->ascent() * (chs / 10.0);
double wt = Cwidth(m_Doc, hl->font(), tabFillCharQStr, chs);
int coun = static_cast<int>((hl->glyph.xoffset - tabDist) / wt);
double sPos = hl->glyph.xoffset - (hl->glyph.xoffset - tabDist) + 1;
desc = hl->font()->descent() * (-chs / 10.0);
asce = hl->font()->ascent() * (chs / 10.0);
Zli3.Zeich = tabFillCharQStr;
Zli3.Farb = hl->ccolor;
Zli3.Farb2 = hl->cstroke;
Zli3.shade = hl->cshade;
Zli3.shade2 = hl->cshade2;
Zli3.yco = hl->yp;
Zli3.Farb = hl->fillColor();
Zli3.Farb2 = hl->strokeColor();
Zli3.shade = hl->fillShade();
Zli3.shade2 = hl->strokeShade();
Zli3.yco = hl->glyph.yoffset;
Zli3.Sele = hl->cselect;
Zli3.Siz = chs;
Zli3.realSiz = hl->csize;
Zli3.Style = hl->cstyle;
Zli3.ZFo = hl->cfont;
Zli3.realSiz = hl->fontSize();
Zli3.Style = hl->effects();
Zli3.ZFo = hl->font();
Zli3.wide = wt;
Zli3.kern = 0;
Zli3.scale = 1000;
Zli3.scalev = 1000;
Zli3.shadowX = hl->cshadowx;
Zli3.shadowY = hl->cshadowy;
Zli3.outline = hl->coutline;
Zli3.base = hl->cbase;
Zli3.underpos = hl->cunderpos;
Zli3.underwidth = hl->cunderwidth;
Zli3.strikepos = hl->cstrikepos;
Zli3.strikewidth = hl->cstrikewidth;
Zli3.shadowX = hl->shadowXOffset();
Zli3.shadowY = hl->shadowYOffset();
Zli3.outline = hl->outlineWidth();
Zli3.base = hl->baselineOffset();
Zli3.underpos = hl->underlineOffset();
Zli3.underwidth = hl->underlineWidth();
Zli3.strikepos = hl->strikethruOffset();
Zli3.strikewidth = hl->strikethruWidth();
for (int cx = 0; cx < coun; ++cx)
{
Zli3.xco = sPos + wt * cx;
1842,35 → 1847,35
if (chx == SpecialChars::TAB)
tabCc++;
Zli3.Zeich = chx;
Zli3.Farb = hl->ccolor;
Zli3.Farb2 = hl->cstroke;
Zli3.shade = hl->cshade;
Zli3.shade2 = hl->cshade2;
Zli3.xco = hl->xp;
Zli3.yco = hl->yp;
Zli3.Farb = hl->fillColor();
Zli3.Farb2 = hl->strokeColor();
Zli3.shade = hl->fillShade();
Zli3.shade2 = hl->strokeShade();
Zli3.xco = hl->glyph.xoffset;
Zli3.yco = hl->glyph.yoffset;
Zli3.Sele = hl->cselect;
Zli3.Siz = chs;
Zli3.realSiz = hl->csize;
Zli3.Style = hl->cstyle;
Zli3.ZFo = hl->cfont;
Zli3.realSiz = hl->fontSize();
Zli3.Style = hl->effects();
Zli3.ZFo = hl->font();
if ((hl->ch == SpecialChars::OBJECT) && (hl->cembedded != 0))
Zli3.wide = (hl->cembedded->gWidth + hl->cembedded->lineWidth()) * (hl->cscale / 1000.0);
Zli3.wide = (hl->cembedded->gWidth + hl->cembedded->lineWidth()) * (hl->scaleH() / 1000.0);
else
Zli3.wide = Cwidth(m_Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
if (hl->cstyle & ScStyle_StartOfLine)
Zli3.wide = Cwidth(m_Doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
if (hl->effects() & ScStyle_StartOfLine)
Zli3.kern = 0;
else
Zli3.kern = chs * hl->cextra / 10000.0;
Zli3.scale = hl->cscale;
Zli3.scalev = hl->cscalev;
Zli3.base = hl->cbase;
Zli3.shadowX = hl->cshadowx;
Zli3.shadowY = hl->cshadowy;
Zli3.outline = hl->coutline;
Zli3.underpos = hl->cunderpos;
Zli3.underwidth = hl->cunderwidth;
Zli3.strikepos = hl->cstrikepos;
Zli3.strikewidth = hl->cstrikewidth;
Zli3.kern = chs * hl->tracking() / 10000.0;
Zli3.scale = hl->scaleH();
Zli3.scalev = hl->scaleV();
Zli3.base = hl->baselineOffset();
Zli3.shadowX = hl->shadowXOffset();
Zli3.shadowY = hl->shadowYOffset();
Zli3.outline = hl->outlineWidth();
Zli3.underpos = hl->underlineOffset();
Zli3.underwidth = hl->underlineWidth();
Zli3.strikepos = hl->strikethruOffset();
Zli3.strikewidth = hl->strikethruWidth();
Zli3.embedded = hl->cembedded;
if (!m_Doc->RePos)
{
1886,7 → 1891,7
p->setLineWidth(0);
if ((a > 0) && (Zli3.Zeich == SpecialChars::TAB))
{
xcoZli = itemText.at(a-1)->xp+Cwidth(m_Doc, itemText.at(a-1)->cfont, itemText.at(a-1)->ch, itemText.at(a-1)->csize);
xcoZli = itemText.at(a-1)->glyph.xoffset+Cwidth(m_Doc, itemText.at(a-1)->font(), itemText.at(a-1)->ch, itemText.at(a-1)->fontSize());
wide = Zli3.xco - xcoZli + Zli3.wide;
}
if (!m_Doc->RePos)
1910,7 → 1915,7
{
points = m_Doc->symReturn.copy();
if (a > 0)
ytrans = itemText.at(a-1)->yp-((Zli3.Siz / 10.0) * 0.8);
ytrans = itemText.at(a-1)->glyph.yoffset-((Zli3.Siz / 10.0) * 0.8);
else
ytrans = Zli3.yco-m_Doc->docParagraphStyles[hl->cab].lineSpacing()-((Zli3.Siz / 10.0) * 0.8);
}
1918,16 → 1923,16
{
points = m_Doc->symNewLine.copy();
if (a > 0)
ytrans = itemText.at(a-1)->yp-((Zli3.Siz / 10.0) * 0.4);
ytrans = itemText.at(a-1)->glyph.yoffset-((Zli3.Siz / 10.0) * 0.4);
else
ytrans = Zli3.yco-m_Doc->docParagraphStyles[hl->cab].lineSpacing()-((Zli3.Siz / 10.0) * 0.4);
}
if (hl->cstyle & ScStyle_StartOfLine)
if (hl->effects() & ScStyle_StartOfLine)
xtrans = Zli3.xco;
else
{
if (a > 0)
xtrans = itemText.at(a-1)->xp+ Cwidth(m_Doc, itemText.at(a-1)->cfont, itemText.at(a-1)->ch, itemText.at(a-1)->csize);
xtrans = itemText.at(a-1)->glyph.xoffset+ Cwidth(m_Doc, itemText.at(a-1)->font(), itemText.at(a-1)->ch, itemText.at(a-1)->fontSize());
else
xtrans = Zli3.xco;
}
1949,7 → 1954,7
else
DrawZeichenS(p, &Zli3);
}
if (hl->cstyle & ScStyle_SmartHyphenVisible)
if (hl->effects() & ScStyle_SmartHyphenVisible)
{
Zli3.Zeich = "-";
Zli3.xco = Zli3.xco + Zli3.wide;
2034,8 → 2039,8
chs = qRound(m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines() * 10);
}
else
chs = hl->csize;
desc2 = -hl->cfont->numDescender * (chs / 10.0);
chs = hl->fontSize();
desc2 = -hl->font()->numDescender * (chs / 10.0);
CurY = TExtra+lineCorr;
}
else
2069,7 → 2074,7
chx = ExpandToken(a);
absa = hl->cab;
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::AutomaticLineSpacing)
m_Doc->docParagraphStyles[absa].setLineSpacing(RealFHeight(m_Doc, hl->cfont, hl->csize));
m_Doc->docParagraphStyles[absa].setLineSpacing(RealFHeight(m_Doc, hl->font(), hl->fontSize()));
if (a == 0)
{
if (BackBox != 0)
2112,7 → 2117,7
CurY += m_Doc->docParagraphStyles[absa].gapBefore();
}
}
hl->cstyle &= ~ScStyle_DropCap;
hl->effects() &= ~ScStyle_DropCap;
hl->cstyle &= ~ScStyle_SmartHyphenVisible;
if (((m_Doc->docParagraphStyles[absa].alignment() == 3) || (m_Doc->docParagraphStyles[absa].alignment() == 4)) && (LiList.count() == 0) && (hl->ch == " "))
{
2140,7 → 2145,7
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
CurY += m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1);
else
CurY += RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * (DropLines-1);
CurY += RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * (DropLines-1);
}
}
}
2149,21 → 2154,21
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
{
chsd = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
chsd = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((m_Doc->typographicSettings.valueBaseGrid * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
else
{
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
{
chsd = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
chsd = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
else
{
double currasce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chsd = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->cfont, chx, 10))));
chs = qRound(10 * ((currasce * (DropLines-1)+(hl->cfont->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->cfont, chx, 10)));
double currasce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
chsd = qRound(10 * ((currasce * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(m_Doc, hl->font(), chx, 10))));
chs = qRound(10 * ((currasce * (DropLines-1)+(hl->font()->numAscent * (m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCAscent(m_Doc, hl->font(), chx, 10)));
}
}
hl->cstyle |= ScStyle_DropCap;
2173,7 → 2178,7
if ((hl->ch == QChar(25)) && (hl->cembedded != 0))
chs = qRound((hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 10);
else
chs = hl->csize;
chs = hl->fontSize();
}
oldCurY = SetZeichAttr(*hl, &chs, &chx);
if (chx == QChar(29))
2194,10 → 2199,10
chx3 = "-";
else
chx3 = itemText.at(a+1)->ch;
wide = Cwidth(m_Doc, hl->cfont, chx2, chs, chx3);
wide = Cwidth(m_Doc, hl->font(), chx2, chs, chx3);
}
else
wide = Cwidth(m_Doc, hl->cfont, chx2, chs);
wide = Cwidth(m_Doc, hl->font(), chx2, chs);
}
if (DropCmode)
{
2211,15 → 2216,15
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
asce = m_Doc->docParagraphStyles[absa].lineSpacing() * DropLines;
else
asce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * DropLines;
asce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[absa].charStyle().fontSize()) * DropLines;
}
hl->cscalev = qRound(asce / (hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 1000.0);
hl->cscale = hl->cscalev;
hl->scaleV() = qRound(asce / (hl->cembedded->gHeight + hl->cembedded->lineWidth()) * 1000.0);
hl->scaleH() = hl->scaleV();
}
else
{
wide = RealCWidth(m_Doc, hl->cfont, chx2, chsd);
asce = RealCHeight(m_Doc, hl->cfont, chx2, chsd);
wide = RealCWidth(m_Doc, hl->font(), chx2, chsd);
asce = RealCHeight(m_Doc, hl->font(), chx2, chsd);
}
desc2 = 0;
desc = 0;
2226,7 → 2231,7
}
else
{
double hlcsize10=hl->csize / 10.0;
double hlcsize10=hl->fontSize() / 10.0;
if ((hl->ch == QChar(25)) && (hl->cembedded != 0))
{
desc = desc2 = 0;
2233,11 → 2238,11
}
else
{
desc = desc2 = -hl->cfont->numDescender * hlcsize10;
desc = desc2 = -hl->font()->numDescender * hlcsize10;
}
asce = hl->cfont->numAscent * hlcsize10;
asce = hl->font()->numAscent * hlcsize10;
}
wide = wide * (hl->cscale / 1000.0);
wide = wide * (hl->scaleH() / 1000.0);
fBorder = false;
if (CurY+BExtra+lineCorr > Height)
{
2259,9 → 2264,9
if (DropCmode)
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
desc2 = -hl->cfont->numDescender * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->numDescender * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
else
desc2 = -hl->cfont->numDescender * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->numDescender * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
}
if (DropCmode)
DropLines = m_Doc->docParagraphStyles[hl->cab].dropCapLines();
2362,9 → 2367,9
if (DropCmode)
{
if (m_Doc->docParagraphStyles[hl->cab].useBaselineGrid())
desc2 = -hl->cfont->numDescender * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->numDescender * m_Doc->typographicSettings.valueBaseGrid * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
else
desc2 = -hl->cfont->numDescender * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
desc2 = -hl->font()->numDescender * m_Doc->docParagraphStyles[hl->cab].lineSpacing() * m_Doc->docParagraphStyles[hl->cab].dropCapLines();
}
if (DropCmode)
DropLines = m_Doc->docParagraphStyles[hl->cab].dropCapLines();
2475,9 → 2480,9
StartRT2 = a;
}
}
hl->yp = CurY + oldCurY;
hl->glyph.yoffset = CurY + oldCurY;
if (DropCmode)
hl->yp -= RealCHeight(m_Doc, hl->cfont, chx2, chsd) - RealCAscent(m_Doc, hl->cfont, chx2, chsd);
hl->glyph.yoffset -= RealCHeight(m_Doc, hl->font(), chx2, chsd) - RealCAscent(m_Doc, hl->font(), chx2, chsd);
if (LiList.count() == 0)
{
itemText.at(a)->cstyle |= ScStyle_StartOfLine;
2485,12 → 2490,12
}
else
{
kernVal = chs * hl->cextra / 10000.0;
kernVal = chs * hl->tracking() / 10000.0;
itemText.at(a)->cstyle &= ~ScStyle_StartOfLine;
}
if (!RTab)
{
hl->xp = QMAX(CurX+kernVal, ColBound.x());
hl->glyph.xoffset = QMAX(CurX+kernVal, ColBound.x());
CurX += wide+kernVal;
CurX = QMAX(CurX, ColBound.x());
}
2497,7 → 2502,7
else
{
CurX = QMAX(CurX, ColBound.x());
hl->xp = CurX;
hl->glyph.xoffset = CurX;
}
if ((TabCode == 4) && (RTab))
{
2504,12 → 2509,12
CurX += (wide+kernVal) / 2;
CurX = QMAX(CurX, ColBound.x());
}
if (((hl->cstyle & ScStyle_HyphenationPossible) || (hl->ch == "-")) && ((HyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0)))
if (((hl->effects() & ScStyle_HyphenationPossible) || (hl->ch == "-")) && ((HyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0)))
{
if (hl->cstyle & ScStyle_HyphenationPossible)
if (hl->effects() & ScStyle_HyphenationPossible)
{
pt1 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0))), qRound(CurY+desc));
pt2 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0))), qRound(ceil(CurY-asce)));
pt1 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0))), qRound(CurY+desc));
pt2 = QPoint(qRound(ceil(CurX+RExtra+Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0))), qRound(ceil(CurY-asce)));
}
else
{
2532,12 → 2537,12
goNextColumn = true;
Zli = new ZZ;
Zli->Zeich = chx;
Zli->Farb = hl->ccolor;
Zli->shade = hl->cshade;
Zli->Farb2 = hl->cstroke;
Zli->shade2 = hl->cshade2;
Zli->xco = hl->xp;
Zli->yco = hl->yp;
Zli->Farb = hl->fillColor();
Zli->shade = hl->fillShade();
Zli->Farb2 = hl->strokeColor();
Zli->shade2 = hl->strokeShade();
Zli->xco = hl->glyph.xoffset;
Zli->yco = hl->glyph.yoffset;
Zli->Sele = hl->cselect;
if (DropCmode)
{
2547,22 → 2552,22
else
{
Zli->Siz = chs;
Zli->realSiz = hl->csize;
Zli->realSiz = hl->fontSize();
}
Zli->Style = hl->cstyle;
Zli->ZFo = hl->cfont;
Zli->Style = hl->effects();
Zli->ZFo = hl->font();
Zli->wide = wide;
Zli->kern = kernVal;
Zli->scale = hl->cscale;
Zli->scalev = hl->cscalev;
Zli->base = hl->cbase;
Zli->shadowX = hl->cshadowx;
Zli->shadowY = hl->cshadowy;
Zli->outline = hl->coutline;
Zli->underpos = hl->cunderpos;
Zli->underwidth = hl->cunderwidth;
Zli->strikepos = hl->cstrikepos;
Zli->strikewidth = hl->cstrikewidth;
Zli->scale = hl->scaleH();
Zli->scalev = hl->scaleV();
Zli->base = hl->baselineOffset();
Zli->shadowX = hl->shadowXOffset();
Zli->shadowY = hl->shadowYOffset();
Zli->outline = hl->outlineWidth();
Zli->underpos = hl->underlineOffset();
Zli->underwidth = hl->underlineWidth();
Zli->strikepos = hl->strikethruOffset();
Zli->strikewidth = hl->strikethruWidth();
Zli->embedded = hl->cembedded;
if (((hl->ch == " ") || (hl->ch == QChar(9))) && (!outs))
{
2570,17 → 2575,17
{
if (itemText.at(a-1)->ch != " ")
{
LastXp = hl->xp;
LastXp = hl->glyph.xoffset;
LastSP = BuPos;
}
}
else
{
LastXp = hl->xp;
LastXp = hl->glyph.xoffset;
LastSP = BuPos;
}
}
if (((hl->cstyle & ScStyle_HyphenationPossible) || (hl->ch == "-")) && (!outs))
if (((hl->effects() & ScStyle_HyphenationPossible) || (hl->ch == "-")) && (!outs))
{
if ((HyphenCount < m_Doc->HyCount) || (m_Doc->HyCount == 0))
{
2587,7 → 2592,7
if (hl->ch == "-")
LastXp = CurX;
else
LastXp = CurX + Cwidth(m_Doc, hl->cfont, "-", hl->csize) * (hl->cscale / 1000.0);
LastXp = CurX + Cwidth(m_Doc, hl->font(), "-", hl->fontSize()) * (hl->scaleH() / 1000.0);
LastSP = BuPos;
}
}
2601,8 → 2606,8
for (uint rtx = StartRT; rtx < LiList.count(); ++rtx)
{
LiList.at(rtx)->xco = QMAX(LiList.at(rtx)->xco-(wide+kernVal) / cen, 0.0);
itemText.at(StartRT2+rtx2)->xp = QMAX(itemText.at(StartRT2+rtx2)->xp-(wide+kernVal) / cen, 0.0);
if (itemText.at(StartRT2+rtx2)->xp < RTabX)
itemText.at(StartRT2+rtx2)->glyph.xoffset = QMAX(itemText.at(StartRT2+rtx2)->glyph.xoffset-(wide+kernVal) / cen, 0.0);
if (itemText.at(StartRT2+rtx2)->glyph.xoffset < RTabX)
{
RTab = false;
TabCode = 0;
2629,7 → 2634,7
int ol1 = qRound((by + CurY - m_Doc->typographicSettings.offsetBaseGrid) * 10000.0);
int ol2 = static_cast<int>(ol1 / m_Doc->typographicSettings.valueBaseGrid);
CurY = ceil( ol2 / 10000.0 ) * m_Doc->typographicSettings.valueBaseGrid + m_Doc->typographicSettings.offsetBaseGrid - by;
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*m_Doc->typographicSettings.valueBaseGrid)));
}
else
2637,19 → 2642,19
if (m_Doc->docParagraphStyles[absa].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
{
CurY -= m_Doc->docParagraphStyles[absa].lineSpacing() * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*m_Doc->docParagraphStyles[absa].lineSpacing())));
}
else
{
double currasce = RealFHeight(m_Doc, hl->cfont, m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
double currasce = RealFHeight(m_Doc, hl->font(), m_Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
CurY -= currasce * (DropLines-1);
tcli.setPoint(0, QPoint(qRound(hl->xp), qRound(maxDY-DropLines*currasce)));
tcli.setPoint(0, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY-DropLines*currasce)));
tcli.setPoint(1, QPoint(qRound(maxDX), qRound(maxDY-DropLines*currasce)));
}
}
tcli.setPoint(2, QPoint(qRound(maxDX), qRound(maxDY)));
tcli.setPoint(3, QPoint(qRound(hl->xp), qRound(maxDY)));
tcli.setPoint(3, QPoint(qRound(hl->glyph.xoffset), qRound(maxDY)));
cm = QRegion(pf2.xForm(tcli));
cl = cl.subtract(cm);
}
2711,35 → 2716,35
{
a -= BuPos - LastSP;
a++;
if (itemText.at(a)->cstyle & ScStyle_HyphenationPossible)
if (itemText.at(a)->effects() & ScStyle_HyphenationPossible)
{
HyphenCount++;
itemText.at(a)->cstyle |= ScStyle_SmartHyphenVisible;
Zli = new ZZ;
Zli->Zeich = "-";
Zli->Farb = itemText.at(a)->ccolor;
Zli->Farb2 = itemText.at(a)->cstroke;
Zli->shade = itemText.at(a)->cshade;
Zli->shade2 = itemText.at(a)->cshade2;
Zli->xco = LastXp - Cwidth(m_Doc, itemText.at(a)->cfont, "-", itemText.at(a)->csize) * (itemText.at(a)->cscale / 1000.0);
Zli->yco = itemText.at(a)->yp;
Zli->Farb = itemText.at(a)->fillColor();
Zli->Farb2 = itemText.at(a)->strokeColor();
Zli->shade = itemText.at(a)->fillShade();
Zli->shade2 = itemText.at(a)->strokeShade();
Zli->xco = LastXp - Cwidth(m_Doc, itemText.at(a)->font(), "-", itemText.at(a)->fontSize()) * (itemText.at(a)->scaleH() / 1000.0);
Zli->yco = itemText.at(a)->glyph.yoffset;
Zli->Sele = itemText.at(a)->cselect;
Zli->Siz = itemText.at(a)->csize;
Zli->realSiz = itemText.at(a)->csize;
Zli->Style = itemText.at(a)->cstyle;
Zli->ZFo = itemText.at(a)->cfont;
Zli->wide = Cwidth(m_Doc, itemText.at(a)->cfont, "-", itemText.at(a)->csize) * (itemText.at(a)->cscale / 1000.0);
Zli->kern = itemText.at(a)->csize * itemText.at(a)->cextra / 10000.0;
Zli->scale = itemText.at(a)->cscale;
Zli->scalev = itemText.at(a)->cscalev;
Zli->base = itemText.at(a)->cbase;
Zli->shadowX = itemText.at(a)->cshadowx;
Zli->shadowY = itemText.at(a)->cshadowy;
Zli->outline = itemText.at(a)->coutline;
Zli->underpos = itemText.at(a)->cunderpos;
Zli->underwidth = itemText.at(a)->cunderwidth;
Zli->strikepos = itemText.at(a)->cstrikepos;
Zli->strikewidth = itemText.at(a)->cstrikewidth;
Zli->Siz = itemText.at(a)->fontSize();
Zli->realSiz = itemText.at(a)->fontSize();
Zli->Style = itemText.at(a)->effects();
Zli->ZFo = itemText.at(a)->font();
Zli->wide = Cwidth(m_Doc, itemText.at(a)->font(), "-", itemText.at(a)->fontSize()) * (itemText.at(a)->scaleH() / 1000.0);
Zli->kern = itemText.at(a)->fontSize() * itemText.at(a)->tracking() / 10000.0;
Zli->scale = itemText.at(a)->scaleH();
Zli->scalev = itemText.at(a)->scaleV();
Zli->base = itemText.at(a)->baselineOffset();
Zli->shadowX = itemText.at(a)->shadowXOffset();
Zli->shadowY = itemText.at(a)->shadowYOffset();
Zli->outline = itemText.at(a)->outlineWidth();
Zli->underpos = itemText.at(a)->underlineOffset();
Zli->underwidth = itemText.at(a)->underlineWidth();
Zli->strikepos = itemText.at(a)->strikethruOffset();
Zli->strikewidth = itemText.at(a)->strikethruWidth();
Zli->embedded = 0;
LiList.insert(LastSP+1, Zli);
LastSP += 1;
2912,10 → 2917,10
}
}
}
hl->xp = CurX;
hl->yp = CurY;
LiList.at(LiList.count()-1)->xco = hl->xp;
LiList.at(LiList.count()-1)->yco = hl->yp;
hl->glyph.xoffset = CurX;
hl->glyph.yoffset = CurY;
LiList.at(LiList.count()-1)->xco = hl->glyph.xoffset;
LiList.at(LiList.count()-1)->yco = hl->glyph.yoffset;
if (LiList.count() != 0)
{
if ((!AbsHasDrop) && (StartOfCol) && (!m_Doc->docParagraphStyles[hl->cab].useBaselineGrid()))
2990,8 → 2995,8
double wide2 = 0;
Zli2 = LiList.at(zc);
double xcoZli = Zli2->xco;
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
itemText.at(startLin+zc)->glyph.xoffset = Zli2->xco;
itemText.at(startLin+zc)->glyph.yoffset = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
3099,7 → 3104,7
else
{
if (startLin > 0)
xtrans = itemText.at(startLin-1)->xp + Cwidth(m_Doc, itemText.at(startLin-1)->cfont, itemText.at(startLin-1)->ch, itemText.at(startLin-1)->csize);
xtrans = itemText.at(startLin-1)->glyph.xoffset + Cwidth(m_Doc, itemText.at(startLin-1)->font(), itemText.at(startLin-1)->ch, itemText.at(startLin-1)->fontSize());
else
xtrans = Zli2->xco;
}
3275,8 → 3280,8
double wide2 = 0;
Zli2 = LiList.at(zc);
double xcoZli = Zli2->xco;
itemText.at(startLin+zc)->xp = Zli2->xco;
itemText.at(startLin+zc)->yp = Zli2->yco;
itemText.at(startLin+zc)->glyph.xoffset = Zli2->xco;
itemText.at(startLin+zc)->glyph.yoffset = Zli2->yco;
if (itemText.at(startLin+zc)->cab < 5)
tTabValues = TabValues;
else
3384,7 → 3389,7
else
{
if (startLin > 0)
xtrans = itemText.at(startLin-1)->xp + Cwidth(m_Doc, itemText.at(startLin-1)->cfont, itemText.at(startLin-1)->ch, itemText.at(startLin-1)->csize);
xtrans = itemText.at(startLin-1)->glyph.xoffset + Cwidth(m_Doc, itemText.at(startLin-1)->font(), itemText.at(startLin-1)->ch, itemText.at(startLin-1)->fontSize());
else
xtrans = Zli2->xco;
}
3706,13 → 3711,7
hg->ch = QString(QChar(conv));
m_Doc->setScTextDefaultsFromDoc(hg);
hg->cselect = false;
hg->cextra = 0;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setTracking(0);
itemText.insert(CPos, hg);
CPos += 1;
Tinput = true;
3746,15 → 3745,15
pos--;
if ( (buttonState & ControlButton) == 0 )
{
alty = itemText.at(pos)->yp;
alty = itemText.at(pos)->glyph.yoffset;
c = itemText.at(pos)->ch.at(0).latin1();
if ( c == 13 ) // new line, position is wrong
if ( --pos > 0 )
alty = itemText.at(pos)->yp;
alty = itemText.at(pos)->glyph.yoffset;
// check for yp at actual position
if ( pos < len )
{
altx = itemText.at(pos)->yp;
altx = itemText.at(pos)->glyph.yoffset;
if ( altx > alty )
{
// we were at begin of line
3761,7 → 3760,7
break;
}
}
while ( pos > 0 && itemText.at(pos-1)->yp == alty )
while ( pos > 0 && itemText.at(pos-1)->glyph.yoffset == alty )
--pos;
if ( itemText.at(pos)->ch.at(0).latin1() == 13 )
++pos;
3791,14 → 3790,14
break;
}
QString nextCh = itemText.at(CPos)->ch;
int nextChs = itemText.at(CPos)->csize;
alty = itemText.at(CPos)->yp - SetZeichAttr(itemText.charStyle(CPos), &nextChs, &nextCh);
int nextChs = itemText.at(CPos)->fontSize();
alty = itemText.at(CPos)->glyph.yoffset - SetZeichAttr(itemText.charStyle(CPos), &nextChs, &nextCh);
double nextY;
while (CPos < len-1)
{
nextCh = itemText.at(CPos+1)->ch;
nextChs = itemText.at(CPos+1)->csize;
nextY = itemText.at(CPos+1)->yp - SetZeichAttr(itemText.charStyle(CPos+1), &nextChs, &nextCh);
nextChs = itemText.at(CPos+1)->fontSize();
nextY = itemText.at(CPos+1)->glyph.yoffset - SetZeichAttr(itemText.charStyle(CPos+1), &nextChs, &nextCh);
if (fabs(nextY - alty) > 1.0)
break;
CPos++;
3860,8 → 3859,8
{
bool down1=false;
double newy;
newy = alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
newy = alty = itemText.at(CPos)->glyph.yoffset;
altx = itemText.at(CPos)->glyph.xoffset;
do
{
++CPos;
3868,28 → 3867,28
if (CPos == static_cast<int>(itemText.count()))
break;
//CB #3088 Catch some funny empty lines. still testing, currently causes to go to start/end of lines incorrectly
//if ((CPos < static_cast<int>(itemText.count())-1) && itemText.at(CPos+1)->ch[0].digitValue()==-1 && itemText.at(CPos)->ch[0].digitValue()==-1 && itemText.at(CPos)->xp == altx && itemText.at(CPos)->yp == alty)
//if ((CPos < static_cast<int>(itemText.count())-1) && itemText.at(CPos+1)->ch[0].digitValue()==-1 && itemText.at(CPos)->ch[0].digitValue()==-1 && itemText.at(CPos)->glyph.xoffset == altx && itemText.at(CPos)->glyph.yoffset == alty)
// break;
if (itemText.at(CPos)->yp > alty)
if (itemText.at(CPos)->glyph.yoffset > alty)
{
if (down1 && itemText.at(CPos)->yp > newy)
if (down1 && itemText.at(CPos)->glyph.yoffset > newy)
{
--CPos;
break;
}
if (itemText.at(CPos)->xp >= altx)
if (itemText.at(CPos)->glyph.xoffset >= altx)
break;
down1=true;
}
//CB Make the cursor move forward a column
if (itemText.at(CPos)->yp < alty)
if (itemText.at(CPos)->glyph.yoffset < alty)
{
double newX=altx+columnWidth();
while (itemText.at(CPos)->xp<newX && CPos < static_cast<int>(itemText.count())-1)
while (itemText.at(CPos)->glyph.xoffset<newX && CPos < static_cast<int>(itemText.count())-1)
++CPos;
break;
}
newy=itemText.at(CPos)->yp;
newy=itemText.at(CPos)->glyph.yoffset;
}
while (CPos < static_cast<int>(itemText.count()));
if ( buttonState & ShiftButton )
3959,8 → 3958,8
{
if (CPos == static_cast<int>(itemText.count()))
--CPos;
alty = itemText.at(CPos)->yp;
altx = itemText.at(CPos)->xp;
alty = itemText.at(CPos)->glyph.yoffset;
altx = itemText.at(CPos)->glyph.xoffset;
if (CPos > 0)
{
do
3970,16 → 3969,16
break;
if ( itemText.at(CPos)->ch.at(0).latin1() == 13 )
break;
if (itemText.at(CPos)->yp < alty)
if (itemText.at(CPos)->glyph.yoffset < alty)
{
if (itemText.at(CPos)->xp <= altx)
if (itemText.at(CPos)->glyph.xoffset <= altx)
break;
}
//CB Make the cursor move back a column
if (itemText.at(CPos)->yp > alty)
if (itemText.at(CPos)->glyph.yoffset > alty)
{
double newX=altx-columnWidth();
while (itemText.at(CPos)->xp>newX && CPos > 0)
while (itemText.at(CPos)->glyph.xoffset>newX && CPos > 0)
--CPos;
break;
}
4064,10 → 4063,10
}
if ((CPos > 0) && (CPos == static_cast<int>(itemText.count())))
{
if (itemText.at(CPos-1)->cstyle & ScStyle_SuppressSpace)
if (itemText.at(CPos-1)->effects() & ScStyle_SuppressSpace)
{
--CPos;
while ((CPos > 0) && (itemText.at(CPos)->cstyle & ScStyle_SuppressSpace))
while ((CPos > 0) && (itemText.at(CPos)->effects() & ScStyle_SuppressSpace))
{
--CPos;
if (CPos == 0)
4077,7 → 4076,7
}
else
{
while ((CPos > 0) && (itemText.at(CPos)->cstyle & ScStyle_SuppressSpace))
while ((CPos > 0) && (itemText.at(CPos)->effects() & ScStyle_SuppressSpace))
{
--CPos;
if (CPos == 0)
4197,13 → 4196,7
hg->ch = QString(SpecialChars::TAB);
m_Doc->setScTextDefaultsFromDoc(hg);
hg->cselect = false;
hg->cextra = 0;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setTracking(0);
itemText.insert(CPos, hg);
CPos += 1;
Tinput = true;
4215,14 → 4208,7
hg = new ScText;
hg->ch = uc;
m_Doc->setScTextDefaultsFromDoc(hg);
hg->cextra = 0;
hg->cselect = false;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setTracking(0);
// should go when hyphenator respects charstyle settings
QString Language = CPos < itemText.length()?
itemText.charStyle(CPos).language() : m_Doc->currentStyle.charStyle().language();
/branches/Version13x/Scribus/scribus/text/storytext.cpp
114,7 → 114,7
return;
const CharStyle style = pos == 0 ? defaultStyle().charStyle() : charStyle(pos - 1);
assert(style.cfont != NULL);
assert(style.font() != NULL);
const int paraStyle = pos == 0 ? 0 : at(pos - 1)->cab;
123,13 → 123,6
item->ch= txt.mid(i, 1);
*static_cast<CharStyle *>(item) = style;
item->cab = paraStyle;
item->cselect = false;
item->xp = 0;
item->yp = 0;
item->PtransX = 0;
item->PtransY = 0;
item->PRot = 0;
item->cembedded = NULL;
insert(pos + i, item);
}
 
152,13 → 145,13
void StoryText::hyphenateWord(int pos, uint len, char* hyphens)
{
assert(pos >= 0);
assert(pos + len <= length());
assert(pos + signed(len) <= length());
for (int i=pos; i < pos+len; ++i)
for (int i=pos; i < pos+signed(len); ++i)
if(hyphens && hyphens[i] & 1)
at(i)->cstyle = (at(i)->cstyle | ScStyle_HyphenationPossible);
at(i)->setEffects(at(i)->effects() | ScStyle_HyphenationPossible);
else
at(i)->cstyle = (at(i)->cstyle & ~ScStyle_HyphenationPossible);
at(i)->setEffects(at(i)->effects() & ~ScStyle_HyphenationPossible);
 
invalidate(pos, pos + len);
}
272,7 → 265,7
return;
 
for (uint i=pos; i < pos+len; ++i)
at(i)->applyStyle(style);
at(i)->applyCharStyle(style);
 
invalidate(pos, pos + len);
}
/branches/Version13x/Scribus/scribus/style.h
45,7 → 45,7
protected:
Style& operator=(const Style& o)
{ //assert(typeinfo() == o.typeinfo());
name_ = o.name_; parent_ = o.parent_;
name_ = o.name_; parent_ = o.parent_; return *this;
}
Style(const Style& o) : name_(o.name_), parent_(o.parent_) {}
};
199,8 → 199,8
private:
// shorthand:
const CharStyle& inh() const { return *dynamic_cast<CharStyle*>(parent()); };
// shorthand:
const CharStyle& inh() const { return *dynamic_cast<const CharStyle*>(parent()); };
int csize;
short cshade;
short cshade2;
396,8 → 396,8
};
private:
// shorthand
const ParagraphStyle& inh() const { return *dynamic_cast<ParagraphStyle*>(parent()); }
// shorthand
const ParagraphStyle& inh() const { return *dynamic_cast<const ParagraphStyle*>(parent()); }
LineSpacingMode LineSpaMode;
double LineSpa;
int textAlignment;
426,7 → 426,7
bool hasDropCap() const { return Drop==NOVALUE && parent()? inh().hasDropCap() : Drop > 0; }
int dropCapLines() const { return DropLin==NOVALUE && parent()? inh().dropCapLines() : DropLin; }
double dropCapOffset() const { return DropDist<=NOVALUE && parent()? inh().dropCapOffset() : DropDist; }
bool useBaselineGrid() const { return BaseAdj==NOVALUE && parent()? inh().useBaselineGrid : BaseAdj > 0; }
bool useBaselineGrid() const { return BaseAdj==NOVALUE && parent()? inh().useBaselineGrid() : BaseAdj > 0; }
void setLineSpacingMode(LineSpacingMode p) {
LineSpaMode = p;
/branches/Version13x/Scribus/scribus/scribus.cpp
1062,7 → 1062,9
if (currItem->CPos-1>0)
{
#ifndef NLS_PROTO
currItem->itemText.at(QMAX(currItem->CPos-1,0))->cstyle |= ScStyle_HyphenationPossible;
StyleFlag fl = currItem->itemText.at(QMAX(currItem->CPos-1,0))->effects();
fl |= ScStyle_HyphenationPossible;
currItem->itemText.at(QMAX(currItem->CPos-1,0))->setEffects(fl);
#else
currItem->itemText.insertChars(currItem->CPos, QString(SpecialChars::SHYPHEN));
currItem->CPos += 1;
4247,7 → 4249,7
 
void ScribusMainWindow::slotEditCut()
{
uint a;
int a;
NoFrameEdit();
QString BufferI = "";
uint docSelectionCount=doc->m_Selection->count();
4309,25 → 4311,25
BufferI += nextItem->itemText.text(a);
}
Buffer2 += "\t";
Buffer2 += nextItem->itemText.charStyle(a).cfont->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).csize)+"\t";
Buffer2 += nextItem->itemText.charStyle(a).ccolor+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cextra)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshade)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstyle)+'\t';
Buffer2 += nextItem->itemText.charStyle(a).font()->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).fontSize())+"\t";
Buffer2 += nextItem->itemText.charStyle(a).fillColor()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).tracking())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).fillShade())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).effects())+'\t';
Buffer2 += QString::number(findParagraphStyle(doc, nextItem->itemText.paragraphStyle(a)))+'\t';
Buffer2 += nextItem->itemText.charStyle(a).cstroke+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshade2)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cscale)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cscalev)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cbase)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshadowx)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshadowy)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).coutline)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cunderpos)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cunderwidth)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstrikepos)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstrikewidth)+'\n';
Buffer2 += nextItem->itemText.charStyle(a).strokeColor()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strokeShade())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).scaleH())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).scaleV())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).baselineOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).shadowXOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).shadowYOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).outlineWidth())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).underlineOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).underlineWidth())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strikethruOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strikethruWidth())+'\n';
}
}
dynamic_cast<PageItem_TextFrame*>(nextItem)->deleteSelectedTextFromFrame();
4396,25 → 4398,25
BufferI += nextItem->itemText.text(a);
}
Buffer2 += "\t";
Buffer2 += nextItem->itemText.charStyle(a).cfont->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).csize)+"\t";
Buffer2 += nextItem->itemText.charStyle(a).ccolor+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cextra)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshade)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstyle)+"\t";
Buffer2 += nextItem->itemText.charStyle(a).font()->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).fontSize())+"\t";
Buffer2 += nextItem->itemText.charStyle(a).fillColor()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).tracking())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).fillShade())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).effects())+"\t";
Buffer2 += QString::number(findParagraphStyle(doc, nextItem->itemText.paragraphStyle(a)))+"\t";
Buffer2 += nextItem->itemText.charStyle(a).cstroke+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshade2)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cscale)+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cscalev)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cbase)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshadowx)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cshadowy)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).coutline)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cunderpos)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cunderwidth)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstrikepos)+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).cstrikewidth)+'\n';
Buffer2 += nextItem->itemText.charStyle(a).strokeColor()+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strokeShade())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).scaleH())+"\t";
Buffer2 += QString::number(nextItem->itemText.charStyle(a).scaleV())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).baselineOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).shadowXOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).shadowYOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).outlineWidth())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).underlineOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).underlineWidth())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strikethruOffset())+'\t';
Buffer2 += QString::number(nextItem->itemText.charStyle(a).strikethruWidth())+'\n';
}
}
nextItem = nextItem->NextBox;
4474,56 → 4476,55
if (hg->ch == QChar(25))
hg->ch = QChar(32);
it++;
hg->cfont = (*doc->AllFonts)[*it];
hg->setFont((*doc->AllFonts)[*it]);
it++;
hg->csize = (*it).toInt();
hg->setFontSize((*it).toInt());
it++;
hg->ccolor = *it;
hg->setFillColor(*it);
it++;
hg->cextra = (*it).toInt();
hg->setTracking((*it).toInt());
it++;
hg->cshade = (*it).toInt();
hg->cselect = false;
hg->setFillShade((*it).toInt());
it++;
hg->cstyle = static_cast<StyleFlag>((*it).toInt());
hg->setEffects(static_cast<StyleFlag>((*it).toInt()));
it++;
hg->cab = (*it).toInt();
it++;
if (it == NULL)
hg->cstroke = CommonStrings::None;
hg->setStrokeColor(CommonStrings::None);
else
hg->cstroke = *it;
hg->setStrokeColor(*it);
it++;
if (it == NULL)
hg->cshade2 = 100;
hg->setStrokeShade(100);
else
hg->cshade2 = (*it).toInt();
hg->setStrokeShade((*it).toInt());
it++;
if (it == NULL)
hg->cscale = 1000;
hg->setScaleH(1000);
else
hg->cscale = (*it).toInt();
hg->setScaleH((*it).toInt());
it++;
if (it == NULL)
hg->cscalev = 1000;
hg->setScaleV(1000);
else
hg->cscalev = QMIN(QMAX((*it).toInt(), 100), 4000);
hg->setScaleV(QMIN(QMAX((*it).toInt(), 100), 4000));
it++;
hg->cbase = it == NULL ? 0 : (*it).toInt();
hg->setBaselineOffset(it == NULL ? 0 : (*it).toInt());
it++;
hg->cshadowx = it == NULL ? 50 : (*it).toInt();
hg->setShadowXOffset(it == NULL ? 50 : (*it).toInt());
it++;
hg->cshadowy = it == NULL ? -50 : (*it).toInt();
hg->setShadowYOffset(it == NULL ? -50 : (*it).toInt());
it++;
hg->coutline = it == NULL ? 10 : (*it).toInt();
hg->setOutlineWidth(it == NULL ? 10 : (*it).toInt());
it++;
hg->cunderpos = it == NULL ? -1 : (*it).toInt();
hg->setUnderlineOffset(it == NULL ? -1 : (*it).toInt());
it++;
hg->cunderwidth = it == NULL ? -1 : (*it).toInt();
hg->setUnderlineWidth(it == NULL ? -1 : (*it).toInt());
it++;
hg->cstrikepos = it == NULL ? -1 : (*it).toInt();
hg->setStrikethruOffset(it == NULL ? -1 : (*it).toInt());
it++;
hg->cstrikewidth = it == NULL ? -1 : (*it).toInt();
hg->setStrikethruWidth(it == NULL ? -1 : (*it).toInt());
currItem->itemText.insert(currItem->CPos, hg);
currItem->CPos += 1;
hg->PRot = 0;
5643,7 → 5644,7
void ScribusMainWindow::setStilvalue(int s)
{
int c = s & 1919;
doc->currentStyle.charStyle().cstyle = static_cast<StyleFlag>(c);
doc->currentStyle.charStyle().setEffects(static_cast<StyleFlag>(c));
scrActions["typeEffectNormal"]->setOn(c==0);
scrActions["typeEffectSuperscript"]->setOn(c & 1);
scrActions["typeEffectSubscript"]->setOn(c & 2);
5661,7 → 5662,7
{
if (doc->m_Selection->count() != 0)
{
doc->currentStyle.charStyle().cstyle = static_cast<StyleFlag>(h);
doc->currentStyle.charStyle().setEffects(static_cast<StyleFlag>(h));
setStilvalue(h);
doc->chTyStyle(h);
}
5941,7 → 5942,7
}
AdjustFontMenu(nf2);
doc->ItemFont(nf2);
doc->currentStyle.charStyle().cfont = (*doc->AllFonts)[nf2];
doc->currentStyle.charStyle().setFont((*doc->AllFonts)[nf2]);
slotDocCh();
}
 
6046,8 → 6047,8
{
if ((doc->appMode == modeEdit) && (currItem->itemText.length() != 0))
{
la = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).ccolor;
lb = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).cshade;
la = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillColor();
lb = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillShade();
}
else
{
6252,45 → 6253,46
{
if (cabneu > 0)
{
if (ite->itemText.charStyle(e).cfont == doc->docParagraphStyles[cabori].charStyle().font())
newStyle.cfont = dia->TempVorl[cabneu].charStyle().font();
if (ite->itemText.charStyle(e).csize == doc->docParagraphStyles[cabori].charStyle().fontSize())
newStyle.csize = dia->TempVorl[cabneu].charStyle().fontSize();
if ((ite->itemText.charStyle(e).cstyle & 1919 ) == doc->docParagraphStyles[cabori].charStyle().effects())
if (ite->itemText.charStyle(e).font() == doc->docParagraphStyles[cabori].charStyle().font())
newStyle.setFont(dia->TempVorl[cabneu].charStyle().font());
if (ite->itemText.charStyle(e).fontSize() == doc->docParagraphStyles[cabori].charStyle().fontSize())
newStyle.setFontSize(dia->TempVorl[cabneu].charStyle().fontSize());
if ((ite->itemText.charStyle(e).effects() & 1919 ) == doc->docParagraphStyles[cabori].charStyle().effects())
{
newStyle.cstyle = static_cast<StyleFlag>(ite->itemText.charStyle(e).cstyle & ~1919);
newStyle.cstyle |= dia->TempVorl[cabneu].charStyle().effects();
StyleFlag fl = static_cast<StyleFlag>(ite->itemText.charStyle(e).effects() & ~1919);
fl |= dia->TempVorl[cabneu].charStyle().effects();
newStyle.setEffects(fl);
}
if (ite->itemText.charStyle(e).ccolor == doc->docParagraphStyles[cabori].charStyle().ccolor)
newStyle.ccolor = dia->TempVorl[cabneu].charStyle().ccolor;
if (ite->itemText.charStyle(e).cshade == doc->docParagraphStyles[cabori].charStyle().cshade)
newStyle.cshade = dia->TempVorl[cabneu].charStyle().cshade;
if (ite->itemText.charStyle(e).cstroke == doc->docParagraphStyles[cabori].charStyle().cstroke)
newStyle.cstroke = dia->TempVorl[cabneu].charStyle().cstroke;
if (ite->itemText.charStyle(e).cshade2 == doc->docParagraphStyles[cabori].charStyle().cshade2)
newStyle.cshade2 = dia->TempVorl[cabneu].charStyle().cshade2;
if (ite->itemText.charStyle(e).cshadowx == doc->docParagraphStyles[cabori].charStyle().cshadowx)
newStyle.cshadowx = dia->TempVorl[cabneu].charStyle().cshadowx;
if (ite->itemText.charStyle(e).cshadowy == doc->docParagraphStyles[cabori].charStyle().cshadowy)
newStyle.cshadowy = dia->TempVorl[cabneu].charStyle().cshadowy;
if (ite->itemText.charStyle(e).coutline == doc->docParagraphStyles[cabori].charStyle().coutline)
newStyle.coutline = dia->TempVorl[cabneu].charStyle().coutline;
if (ite->itemText.charStyle(e).cunderpos == doc->docParagraphStyles[cabori].charStyle().cunderpos)
newStyle.cunderpos = dia->TempVorl[cabneu].charStyle().cunderpos;
if (ite->itemText.charStyle(e).cunderwidth == doc->docParagraphStyles[cabori].charStyle().cunderwidth)
newStyle.cunderwidth = dia->TempVorl[cabneu].charStyle().cunderwidth;
if (ite->itemText.charStyle(e).cstrikepos == doc->docParagraphStyles[cabori].charStyle().cstrikepos)
newStyle.cstrikepos = dia->TempVorl[cabneu].charStyle().cstrikepos;
if (ite->itemText.charStyle(e).cstrikewidth == doc->docParagraphStyles[cabori].charStyle().cstrikewidth)
newStyle.cstrikewidth = dia->TempVorl[cabneu].charStyle().cstrikewidth;
if (ite->itemText.charStyle(e).cscale == doc->docParagraphStyles[cabori].charStyle().cscale)
newStyle.cscale = dia->TempVorl[cabneu].charStyle().cscale;
if (ite->itemText.charStyle(e).cscalev == doc->docParagraphStyles[cabori].charStyle().cscalev)
newStyle.cscalev = dia->TempVorl[cabneu].charStyle().cscalev;
if (ite->itemText.charStyle(e).cbase == doc->docParagraphStyles[cabori].charStyle().cbase)
newStyle.cbase = dia->TempVorl[cabneu].charStyle().cbase;
if (ite->itemText.charStyle(e).cextra == doc->docParagraphStyles[cabori].charStyle().cextra)
newStyle.cextra = dia->TempVorl[cabneu].charStyle().cextra;
if (ite->itemText.charStyle(e).fillColor() == doc->docParagraphStyles[cabori].charStyle().fillColor())
newStyle.setFillColor(dia->TempVorl[cabneu].charStyle().fillColor());
if (ite->itemText.charStyle(e).fillShade() == doc->docParagraphStyles[cabori].charStyle().fillShade())
newStyle.setFillShade(dia->TempVorl[cabneu].charStyle().fillShade());
if (ite->itemText.charStyle(e).strokeColor() == doc->docParagraphStyles[cabori].charStyle().strokeColor())
newStyle.setStrokeColor(dia->TempVorl[cabneu].charStyle().strokeColor());
if (ite->itemText.charStyle(e).strokeShade() == doc->docParagraphStyles[cabori].charStyle().strokeShade())
newStyle.setStrokeShade(dia->TempVorl[cabneu].charStyle().strokeShade());
if (ite->itemText.charStyle(e).shadowXOffset() == doc->docParagraphStyles[cabori].charStyle().shadowXOffset())
newStyle.setShadowXOffset(dia->TempVorl[cabneu].charStyle().shadowXOffset());
if (ite->itemText.charStyle(e).shadowYOffset() == doc->docParagraphStyles[cabori].charStyle().shadowYOffset())
newStyle.setShadowYOffset(dia->TempVorl[cabneu].charStyle().shadowYOffset());
if (ite->itemText.charStyle(e).outlineWidth() == doc->docParagraphStyles[cabori].charStyle().outlineWidth())
newStyle.setOutlineWidth(dia->TempVorl[cabneu].charStyle().outlineWidth());
if (ite->itemText.charStyle(e).underlineOffset() == doc->docParagraphStyles[cabori].charStyle().underlineOffset())
newStyle.setUnderlineOffset(dia->TempVorl[cabneu].charStyle().underlineOffset());
if (ite->itemText.charStyle(e).underlineWidth() == doc->docParagraphStyles[cabori].charStyle().underlineWidth())
newStyle.setUnderlineWidth(dia->TempVorl[cabneu].charStyle().underlineWidth());
if (ite->itemText.charStyle(e).strikethruOffset() == doc->docParagraphStyles[cabori].charStyle().strikethruOffset())
newStyle.setStrikethruOffset(dia->TempVorl[cabneu].charStyle().strikethruOffset());
if (ite->itemText.charStyle(e).strikethruWidth() == doc->docParagraphStyles[cabori].charStyle().strikethruWidth())
newStyle.setStrikethruWidth(dia->TempVorl[cabneu].charStyle().strikethruWidth());
if (ite->itemText.charStyle(e).scaleH() == doc->docParagraphStyles[cabori].charStyle().scaleH())
newStyle.setScaleH(dia->TempVorl[cabneu].charStyle().scaleH());
if (ite->itemText.charStyle(e).scaleV() == doc->docParagraphStyles[cabori].charStyle().scaleV())
newStyle.setScaleV(dia->TempVorl[cabneu].charStyle().scaleV());
if (ite->itemText.charStyle(e).baselineOffset() == doc->docParagraphStyles[cabori].charStyle().baselineOffset())
newStyle.setBaselineOffset(dia->TempVorl[cabneu].charStyle().baselineOffset());
if (ite->itemText.charStyle(e).tracking() == doc->docParagraphStyles[cabori].charStyle().tracking())
newStyle.setTracking(dia->TempVorl[cabneu].charStyle().tracking());
}
else
{
6341,45 → 6343,47
{
if (cabneu > 0)
{
if (chars->at(e)->charStyle.cfont->scName() == doc->docParagraphStyles[cabori].charStyle().font()->scName())
chars->at(e)->charStyle.cfont = dia->TempVorl[cabneu].charStyle().font();
if (chars->at(e)->charStyle.csize == doc->docParagraphStyles[cabori].charStyle().fontSize())
chars->at(e)->charStyle.csize = dia->TempVorl[cabneu].charStyle().fontSize();
if ((chars->at(e)->charStyle.cstyle & static_cast<StyleFlag>(1919) ) == doc->docParagraphStyles[cabori].charStyle().effects())
if (chars->at(e)->charStyle.font()->scName() == doc->docParagraphStyles[cabori].charStyle().font()->scName())
chars->at(e)->charStyle.setFont(dia->TempVorl[cabneu].charStyle().font());
if (chars->at(e)->charStyle.fontSize() == doc->docParagraphStyles[cabori].charStyle().fontSize())
chars->at(e)->charStyle.setFontSize(dia->TempVorl[cabneu].charStyle().fontSize());
if ((chars->at(e)->charStyle.effects() & static_cast<StyleFlag>(1919) ) == doc->docParagraphStyles[cabori].charStyle().effects())
{
chars->at(e)->charStyle.cstyle &= static_cast<StyleFlag>(~1919);
chars->at(e)->charStyle.cstyle |= dia->TempVorl[cabneu].charStyle().effects();
StyleFlag fl = chars->at(e)->charStyle.effects();
fl&= static_cast<StyleFlag>(~1919);
fl |= dia->TempVorl[cabneu].charStyle().effects();
chars->at(e)->charStyle.setEffects(fl);
}
if (chars->at(e)->charStyle.ccolor == doc->docParagraphStyles[cabori].charStyle().ccolor)
chars->at(e)->charStyle.ccolor = dia->TempVorl[cabneu].charStyle().ccolor;
if (chars->at(e)->charStyle.cshade == doc->docParagraphStyles[cabori].charStyle().cshade)
chars->at(e)->charStyle.cshade = dia->TempVorl[cabneu].charStyle().cshade;
if (chars->at(e)->charStyle.cstroke == doc->docParagraphStyles[cabori].charStyle().cstroke)
chars->at(e)->charStyle.cstroke = dia->TempVorl[cabneu].charStyle().cstroke;
if (chars->at(e)->charStyle.cshade2 == doc->docParagraphStyles[cabori].charStyle().cshade2)
chars->at(e)->charStyle.cshade2 = dia->TempVorl[cabneu].charStyle().cshade2;
if (chars->at(e)->charStyle.cshadowx == doc->docParagraphStyles[cabori].charStyle().cshadowx)
chars->at(e)->charStyle.cshadowx = dia->TempVorl[cabneu].charStyle().cshadowx;
if (chars->at(e)->charStyle.cshadowy == doc->docParagraphStyles[cabori].charStyle().cshadowy)
chars->at(e)->charStyle.cshadowy = dia->TempVorl[cabneu].charStyle().cshadowy;
if (chars->at(e)->charStyle.coutline == doc->docParagraphStyles[cabori].charStyle().coutline)
chars->at(e)->charStyle.coutline = dia->TempVorl[cabneu].charStyle().coutline;
if (chars->at(e)->charStyle.cunderpos == doc->docParagraphStyles[cabori].charStyle().cunderpos)
chars->at(e)->charStyle.cunderpos = dia->TempVorl[cabneu].charStyle().cunderpos;
if (chars->at(e)->charStyle.cunderwidth == doc->docParagraphStyles[cabori].charStyle().cunderwidth)
chars->at(e)->charStyle.cunderwidth = dia->TempVorl[cabneu].charStyle().cunderwidth;
if (chars->at(e)->charStyle.cstrikepos == doc->docParagraphStyles[cabori].charStyle().cstrikepos)
chars->at(e)->charStyle.cstrikepos = dia->TempVorl[cabneu].charStyle().cstrikepos;
if (chars->at(e)->charStyle.cstrikewidth == doc->docParagraphStyles[cabori].charStyle().cstrikewidth)
chars->at(e)->charStyle.cstrikewidth = dia->TempVorl[cabneu].charStyle().cstrikewidth;
if (chars->at(e)->charStyle.cscale == doc->docParagraphStyles[cabori].charStyle().cscale)
chars->at(e)->charStyle.cscale = dia->TempVorl[cabneu].charStyle().cscale;
if (chars->at(e)->charStyle.cscalev == doc->docParagraphStyles[cabori].charStyle().cscalev)
chars->at(e)->charStyle.cscalev = dia->TempVorl[cabneu].charStyle().cscalev;
if (chars->at(e)->charStyle.cbase == doc->docParagraphStyles[cabori].charStyle().cbase)
chars->at(e)->charStyle.cbase = dia->TempVorl[cabneu].charStyle().cbase;
if (chars->at(e)->charStyle.cextra == doc->docParagraphStyles[cabori].charStyle().cextra)
chars->at(e)->charStyle.cextra = dia->TempVorl[cabneu].charStyle().cextra;
if (chars->at(e)->charStyle.fillColor() == doc->docParagraphStyles[cabori].charStyle().fillColor())
chars->at(e)->charStyle.setFillColor(dia->TempVorl[cabneu].charStyle().fillColor());
if (chars->at(e)->charStyle.fillShade() == doc->docParagraphStyles[cabori].charStyle().fillShade())
chars->at(e)->charStyle.setFillShade(dia->TempVorl[cabneu].charStyle().fillShade());
if (chars->at(e)->charStyle.strokeColor() == doc->docParagraphStyles[cabori].charStyle().strokeColor())
chars->at(e)->charStyle.setStrokeColor(dia->TempVorl[cabneu].charStyle().strokeColor());
if (chars->at(e)->charStyle.strokeShade() == doc->docParagraphStyles[cabori].charStyle().strokeShade())
chars->at(e)->charStyle.setStrokeShade(dia->TempVorl[cabneu].charStyle().strokeShade());
if (chars->at(e)->charStyle.shadowXOffset() == doc->docParagraphStyles[cabori].charStyle().shadowXOffset())
chars->at(e)->charStyle.setShadowXOffset(dia->TempVorl[cabneu].charStyle().shadowXOffset());
if (chars->at(e)->charStyle.shadowYOffset() == doc->docParagraphStyles[cabori].charStyle().shadowYOffset())
chars->at(e)->charStyle.setShadowYOffset(dia->TempVorl[cabneu].charStyle().shadowYOffset());
if (chars->at(e)->charStyle.outlineWidth() == doc->docParagraphStyles[cabori].charStyle().outlineWidth())
chars->at(e)->charStyle.setOutlineWidth(dia->TempVorl[cabneu].charStyle().outlineWidth());
if (chars->at(e)->charStyle.underlineOffset() == doc->docParagraphStyles[cabori].charStyle().underlineOffset())
chars->at(e)->charStyle.setUnderlineOffset(dia->TempVorl[cabneu].charStyle().underlineOffset());
if (chars->at(e)->charStyle.underlineWidth() == doc->docParagraphStyles[cabori].charStyle().underlineWidth())
chars->at(e)->charStyle.setUnderlineWidth(dia->TempVorl[cabneu].charStyle().underlineWidth());
if (chars->at(e)->charStyle.strikethruOffset() == doc->docParagraphStyles[cabori].charStyle().strikethruOffset())
chars->at(e)->charStyle.setStrikethruOffset(dia->TempVorl[cabneu].charStyle().strikethruOffset());
if (chars->at(e)->charStyle.strikethruWidth() == doc->docParagraphStyles[cabori].charStyle().strikethruWidth())
chars->at(e)->charStyle.setStrikethruWidth(dia->TempVorl[cabneu].charStyle().strikethruWidth());
if (chars->at(e)->charStyle.scaleH() == doc->docParagraphStyles[cabori].charStyle().scaleH())
chars->at(e)->charStyle.setScaleH(dia->TempVorl[cabneu].charStyle().scaleH());
if (chars->at(e)->charStyle.scaleV() == doc->docParagraphStyles[cabori].charStyle().scaleV())
chars->at(e)->charStyle.setScaleV(dia->TempVorl[cabneu].charStyle().scaleV());
if (chars->at(e)->charStyle.baselineOffset() == doc->docParagraphStyles[cabori].charStyle().baselineOffset())
chars->at(e)->charStyle.setBaselineOffset(dia->TempVorl[cabneu].charStyle().baselineOffset());
if (chars->at(e)->charStyle.tracking() == doc->docParagraphStyles[cabori].charStyle().tracking())
chars->at(e)->charStyle.setTracking(dia->TempVorl[cabneu].charStyle().tracking());
}
else
{
6411,7 → 6415,7
FontID.insert(ff, prefsManager->appPrefs.AvailFonts[nf]->scName());
}
else
doc->docParagraphStyles[a].charStyle().cfont = (prefsManager->appPrefs.AvailFonts[doc->toolSettings.defFont]);
doc->docParagraphStyles[a].charStyle().setFont((prefsManager->appPrefs.AvailFonts[doc->toolSettings.defFont]));
}
}
}
6482,9 → 6486,9
for (it = ers.begin(); it != ers.end(); ++it)
{
if (it.key() == doc->currentStyle.charStyle().fillColor())
doc->currentStyle.charStyle().ccolor = it.data();
doc->currentStyle.charStyle().setFillColor(it.data());
if (it.key() == doc->currentStyle.charStyle().strokeColor())
doc->currentStyle.charStyle().cstroke = it.data();
doc->currentStyle.charStyle().setStrokeColor(it.data());
for (c=0; c<doc->DocItems.count(); ++c)
{
ite = doc->DocItems.at(c);
6495,10 → 6499,10
for (d=0; d<ite->itemText.length(); ++d)
{
CharStyle newStyle;
if (it.key() == ite->itemText.charStyle(d).ccolor)
newStyle.ccolor = it.data();
if (it.key() == ite->itemText.charStyle(d).cstroke)
newStyle.cstroke = it.data();
if (it.key() == ite->itemText.charStyle(d).fillColor())
newStyle.setFillColor(it.data());
if (it.key() == ite->itemText.charStyle(d).strokeColor())
newStyle.setStrokeColor(it.data());
if (newStyle != lastStyle) {
ite->itemText.applyStyle(lastStyleStart, d-lastStyleStart, lastStyle);
lastStyle = newStyle;
6535,10 → 6539,10
for (d=0; d<ite->itemText.length(); ++d)
{
CharStyle newStyle;
if (it.key() == ite->itemText.charStyle(d).ccolor)
newStyle.ccolor = it.data();
if (it.key() == ite->itemText.charStyle(d).cstroke)
newStyle.cstroke = it.data();
if (it.key() == ite->itemText.charStyle(d).fillColor())
newStyle.setFillColor(it.data());
if (it.key() == ite->itemText.charStyle(d).strokeColor())
newStyle.setStrokeColor(it.data());
if (newStyle != lastStyle) {
ite->itemText.applyStyle(lastStyleStart, d-lastStyleStart, lastStyle);
lastStyle = newStyle;
6575,10 → 6579,10
for (d=0; d<ite->itemText.length(); ++d)
{
CharStyle newStyle;
if (it.key() == ite->itemText.charStyle(d).ccolor)
newStyle.ccolor = it.data();
if (it.key() == ite->itemText.charStyle(d).cstroke)
newStyle.cstroke = it.data();
if (it.key() == ite->itemText.charStyle(d).fillColor())
newStyle.setFillColor(it.data());
if (it.key() == ite->itemText.charStyle(d).strokeColor())
newStyle.setStrokeColor(it.data());
if (newStyle != lastStyle) {
ite->itemText.applyStyle(lastStyleStart, d-lastStyleStart, lastStyle);
lastStyle = newStyle;
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
79,10 → 79,10
{
for (uint d = 0; d < ite->itemText.count(); d++)
{
if (col == ite->itemText.at(d)->ccolor)
ite->itemText.at(d)->ccolor = rep;
if (col == ite->itemText.at(d)->cstroke)
ite->itemText.at(d)->cstroke = rep;
if (col == ite->itemText.at(d)->fillColor())
ite->itemText.at(d)->setFillColor(rep);
if (col == ite->itemText.at(d)->strokeColor())
ite->itemText.at(d)->setStrokeColor(rep);
}
}
if (col == ite->fillColor())
107,10 → 107,10
{
for (uint d = 0; d < ite->itemText.count(); d++)
{
if (col == ite->itemText.at(d)->ccolor)
ite->itemText.at(d)->ccolor = rep;
if (col == ite->itemText.at(d)->cstroke)
ite->itemText.at(d)->cstroke = rep;
if (col == ite->itemText.at(d)->fillColor())
ite->itemText.at(d)->setFillColor(rep);
if (col == ite->itemText.at(d)->strokeColor())
ite->itemText.at(d)->setStrokeColor(rep);
}
}
if (col == ite->fillColor())
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdgetprop.cpp
34,7 → 34,7
for (uint b = 0; b < it->itemText.count(); ++b)
{
if (it->itemText.at(b)->cselect)
return PyString_FromString(it->itemText.at(b)->ccolor.utf8());
return PyString_FromString(it->itemText.at(b)->fillColor().utf8());
}
}
else
70,7 → 70,7
for (uint b = 0; b < it->itemText.count(); ++b)
{
if (it->itemText.at(b)->cselect)
return PyInt_FromLong(static_cast<long>(it->itemText.at(b)->cshade));
return PyInt_FromLong(static_cast<long>(it->itemText.at(b)->fillShade()));
}
}
else
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
30,7 → 30,7
{
for (uint b = 0; b < it->itemText.count(); b++)
if (it->itemText.at(b)->cselect)
return PyFloat_FromDouble(static_cast<double>(it->itemText.at(b)->csize / 10.0));
return PyFloat_FromDouble(static_cast<double>(it->itemText.at(b)->fontSize() / 10.0));
return NULL;
}
else
56,7 → 56,7
{
for (uint b = 0; b < it->itemText.count(); b++)
if (it->itemText.at(b)->cselect)
return PyString_FromString(it->itemText.at(b)->cfont->scName().utf8());
return PyString_FromString(it->itemText.at(b)->font()->scName().utf8());
return NULL;
}
else
301,8 → 301,8
*dynamic_cast<CharStyle*>(hg) = currItem->currentCharStyle();
hg->cselect = false;
hg->cab = findParagraphStyle(ScMW->doc, ScMW->doc->currentStyle);
hg->xp = 0;
hg->yp = 0;
hg->glyph.xoffset = 0;
hg->glyph.yoffset = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
681,10 → 681,10
if (it->HasSel)
{
if (it->itemText.at(b)->cselect)
it->itemText.at(b)->ccolor = QString::fromUtf8(Color);
it->itemText.at(b)->setFillColor(QString::fromUtf8(Color));
}
else
it->itemText.at(b)->ccolor = QString::fromUtf8(Color);
it->itemText.at(b)->setFillColor(QString::fromUtf8(Color));
}
// it->TxtFill = QString::fromUtf8(Color);
}
715,10 → 715,10
if (it->HasSel)
{
if (it->itemText.at(b)->cselect)
it->itemText.at(b)->cstroke = QString::fromUtf8(Color);
it->itemText.at(b)->setStrokeColor(QString::fromUtf8(Color));
}
else
it->itemText.at(b)->cstroke = QString::fromUtf8(Color);
it->itemText.at(b)->setStrokeColor(QString::fromUtf8(Color));
}
// it->TxtStroke = QString::fromUtf8(Color);
}
754,10 → 754,10
if (it->HasSel)
{
if (it->itemText.at(b)->cselect)
it->itemText.at(b)->cshade = w;
it->itemText.at(b)->setFillShade(w);
}
else
it->itemText.at(b)->cshade = w;
it->itemText.at(b)->setFillShade(w);
}
// it->ShTxtFill = w;
}
/branches/Version13x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
23,7 → 23,7
APPLY
};
 
enum Style {
enum MatchStyle {
ALL_PARAGRAPHS,
STARTS_WITH,
LESS_THAN,
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
1643,7 → 1643,7
gradhelper.gradient.setRepeatMethod( VGradient::none );
 
QString href = e.attribute("xlink:href").mid(1);
double x1, y1, x2, y2;
double x1=0, y1=0, x2=0, y2=0;
if (!href.isEmpty())
{
if (m_gradients.contains(href))
1829,38 → 1829,30
{
hg = new ScText;
hg->ch = Text.at(tt);
hg->cfont = (*currDoc->AllFonts)[gc->Family];
hg->csize = gc->FontSize;
hg->ccolor = gc->FillCol;
hg->cextra = 0;
hg->cshade = 100;
hg->cstroke = gc->StrokeCol;
hg->cshade2 = 100;
hg->cscale = 1000;
hg->cscalev = 1000;
hg->cbase = 0;
hg->cshadowx = 50;
hg->cshadowy = -50;
hg->coutline = 10;
hg->cunderpos = -1;
hg->cunderwidth = -1;
hg->cstrikepos = -1;
hg->cstrikewidth = -1;
hg->cselect = false;
hg->setFont((*currDoc->AllFonts)[gc->Family]);
hg->setFontSize(gc->FontSize);
hg->setFillColor(gc->FillCol);
hg->setTracking(0);
hg->setFillShade(100);
hg->setStrokeColor(gc->StrokeCol);
hg->setStrokeShade(100);
hg->setScaleH(1000);
hg->setScaleV(1000);
hg->setBaselineOffset(0);
hg->setShadowXOffset(50);
hg->setShadowYOffset(-50);
hg->setOutlineWidth(10);
hg->setUnderlineOffset(-1);
hg->setUnderlineWidth(-1);
hg->setStrikethruOffset(-1);
hg->setStrikethruWidth(-1);
if( !tspan.attribute( "stroke" ).isEmpty() )
hg->cstyle = ScStyle_Outline;
hg->setEffects(ScStyle_Outline);
else
hg->cstyle = ScStyle_Default;
hg->cab = 0;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setEffects(ScStyle_Default);
ite->itemText.append(hg);
tempW += RealCWidth(currDoc, hg->cfont, hg->ch, hg->csize)+1;
if (hg->ch == QChar(13))
tempW += RealCWidth(currDoc, hg->font(), hg->ch, hg->fontSize())+1;
if (hg->ch == SpecialChars::PARSEP)
{
ite->setWidthHeight(QMAX(ite->width(), tempW), ite->height() + lineSpacing+desc);
tempW = 0;
1930,37 → 1922,29
{
hg = new ScText;
hg->ch = Text.at(cc);
hg->cfont = (*currDoc->AllFonts)[gc->Family];
hg->csize = gc->FontSize;
hg->ccolor = gc->FillCol;
hg->cextra = 0;
hg->cshade = 100;
hg->cstroke = gc->StrokeCol;
hg->cshade2 = 100;
hg->cscalev = 1000;
hg->cscale = 1000;
hg->cbase = 0;
hg->cshadowx = 50;
hg->cshadowy = -50;
hg->coutline = 10;
hg->cunderpos = -1;
hg->cunderwidth = -1;
hg->cstrikepos = -1;
hg->cstrikewidth = -1;
hg->cselect = false;
hg->setFont((*currDoc->AllFonts)[gc->Family]);
hg->setFontSize(gc->FontSize);
hg->setFillColor(gc->FillCol);
hg->setTracking(0);
hg->setFillShade(100);
hg->setStrokeColor(gc->StrokeCol);
hg->setStrokeShade(100);
hg->setScaleH(1000);
hg->setScaleV(1000);
hg->setBaselineOffset(0);
hg->setShadowXOffset(50);
hg->setShadowYOffset(-50);
hg->setOutlineWidth(10);
hg->setUnderlineOffset(-1);
hg->setUnderlineWidth(-1);
hg->setStrikethruOffset(-1);
hg->setStrikethruWidth(-1);
if( !e.attribute( "stroke" ).isEmpty() )
hg->cstyle = ScStyle_Outline;
hg->setEffects(ScStyle_Outline);
else
hg->cstyle = ScStyle_Default;
hg->cab = 0;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setEffects(ScStyle_Default);
ite->itemText.append(hg);
ite->setWidth(ite->width() + RealCWidth(currDoc, hg->cfont, hg->ch, hg->csize)+1);
ite->setWidth(ite->width() + RealCWidth(currDoc, hg->font(), hg->ch, hg->fontSize())+1);
ite->setHeight(gc->FontSize / 10.0 + 2 +desc+2);
}
ite->SetRectFrame();
/branches/Version13x/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
461,28 → 461,28
m_Doc->AddFont(tmpf);
}
}
vg.charStyle().cfont = (*m_AvailableFonts)[tmpf];
vg.charStyle().csize = qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0);
vg.charStyle().setFont((*m_AvailableFonts)[tmpf]);
vg.charStyle().setFontSize(qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0));
vg.setHasDropCap(static_cast<bool>(pg.attribute("DROP", "0").toInt()));
vg.setDropCapLines(pg.attribute("DROPLIN", "2").toInt());
vg.setDropCapOffset(pg.attribute("DROPDIST", "0").toDouble());
vg.charStyle().cstyle = static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt());
vg.charStyle().ccolor = pg.attribute("FCOLOR", m_Doc->toolSettings.dBrush);
vg.charStyle().cshade = pg.attribute("FSHADE", "100").toInt();
vg.charStyle().cstroke = pg.attribute("SCOLOR", m_Doc->toolSettings.dPen);
vg.charStyle().cshade2 = pg.attribute("SSHADE", "100").toInt();
vg.charStyle().setEffects(static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt()));
vg.charStyle().setFillColor(pg.attribute("FCOLOR", m_Doc->toolSettings.dBrush));
vg.charStyle().setFillShade(pg.attribute("FSHADE", "100").toInt());
vg.charStyle().setStrokeColor(pg.attribute("SCOLOR", m_Doc->toolSettings.dPen));
vg.charStyle().setStrokeShade(pg.attribute("SSHADE", "100").toInt());
vg.setUseBaselineGrid(static_cast<bool>(pg.attribute("BASE", "0").toInt()));
vg.charStyle().cshadowx = 50;
vg.charStyle().cshadowy = -50;
vg.charStyle().coutline = 10;
vg.charStyle().cunderpos = m_Doc->typographicSettings.valueUnderlinePos;
vg.charStyle().cunderwidth = m_Doc->typographicSettings.valueUnderlineWidth;
vg.charStyle().cstrikepos = m_Doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().cstrikewidth = m_Doc->typographicSettings.valueStrikeThruPos;
vg.charStyle().cscale = 1000;
vg.charStyle().cscalev = 1000;
vg.charStyle().cbase = 0;
vg.charStyle().cextra = 0;
vg.charStyle().setShadowXOffset(50);
vg.charStyle().setShadowYOffset(-50);
vg.charStyle().setOutlineWidth(10);
vg.charStyle().setUnderlineOffset(m_Doc->typographicSettings.valueUnderlinePos);
vg.charStyle().setUnderlineWidth(m_Doc->typographicSettings.valueUnderlineWidth);
vg.charStyle().setStrikethruOffset(m_Doc->typographicSettings.valueStrikeThruPos);
vg.charStyle().setStrikethruWidth(m_Doc->typographicSettings.valueStrikeThruPos);
vg.charStyle().setScaleH(1000);
vg.charStyle().setScaleV(1000);
vg.charStyle().setBaselineOffset(0);
vg.charStyle().setTracking(0);
if ((pg.hasAttribute("NUMTAB")) && (pg.attribute("NUMTAB", "0").toInt() != 0))
{
tmp = pg.attribute("TABS");
1002,15 → 1002,14
if (hg->ch == QChar(4))
hg->ch = QChar(9);
if (unknown)
hg->cfont = dummy;
hg->setFont(dummy);
else
hg->cfont = (*doc->AllFonts)[tmpf];
hg->csize = size;
hg->ccolor = fcolor;
hg->cextra = extra;
hg->cshade = shade;
hg->cselect = false;
hg->cstyle = static_cast<StyleFlag>(cstyle);
hg->setFont((*doc->AllFonts)[tmpf]);
hg->setFontSize(size);
hg->setFillColor(fcolor);
hg->setTracking(extra);
hg->setFillShade(shade);
hg->setEffects(static_cast<StyleFlag>(cstyle));
if (impo)
{
if (VorLFound)
1025,24 → 1024,18
}
else
hg->cab = ab;
hg->cstroke = stroke;
hg->cshade2 = shade2;
hg->cscale = QMIN(QMAX(scale, 100), 4000);
hg->cscalev = QMIN(QMAX(scalev, 100), 4000);
hg->cbase = base;
hg->cshadowx = shX;
hg->cshadowy = shY;
hg->coutline = outL;
hg->cunderpos = ulp;
hg->cunderwidth = ulw;
hg->cstrikepos = stp;
hg->cstrikewidth = stw;
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->cembedded = 0;
hg->setStrokeColor(stroke);
hg->setStrokeShade(shade2);
hg->setScaleH(QMIN(QMAX(scale, 100), 4000));
hg->setScaleV(QMIN(QMAX(scalev, 100), 4000));
hg->setBaselineOffset(base);
hg->setShadowXOffset(shX);
hg->setShadowYOffset(shY);
hg->setOutlineWidth(outL);
hg->setUnderlineOffset(ulp);
hg->setUnderlineWidth(ulw);
hg->setStrikethruOffset(stp);
hg->setStrikethruWidth(stw);
obj->itemText.append(hg);
}
#else
1493,28 → 1486,28
tmpf = AskForFont(prefsManager->appPrefs.AvailFonts, tmpf, doc);
else
tmpf = DoFonts[tmf];
vg->charStyle().cfont = prefsManager->appPrefs.AvailFonts[tmpf];
vg->charStyle().csize = qRound(pg->attribute("FONTSIZE", "12").toDouble() * 10.0);
vg->charStyle().setFont(prefsManager->appPrefs.AvailFonts[tmpf]);
vg->charStyle().setFontSize(qRound(pg->attribute("FONTSIZE", "12").toDouble() * 10.0));
vg->setHasDropCap(static_cast<bool>(pg->attribute("DROP", "0").toInt()));
vg->setDropCapLines(pg->attribute("DROPLIN", "2").toInt());
vg->setDropCapOffset(pg->attribute("DROPDIST", "0").toDouble());
vg->charStyle().cstyle = static_cast<StyleFlag>(pg->attribute("EFFECT", "0").toInt());
vg->charStyle().ccolor = pg->attribute("FCOLOR", doc->toolSettings.dBrush);
vg->charStyle().cshade = pg->attribute("FSHADE", "100").toInt();
vg->charStyle().cstroke = pg->attribute("SCOLOR", doc->toolSettings.dPen);
vg->charStyle().cshade2 = pg->attribute("SSHADE", "100").toInt();
vg->charStyle().setEffects(static_cast<StyleFlag>((pg->attribute("EFFECT", "0").toInt())));
vg->charStyle().setFillColor(pg->attribute("FCOLOR", doc->toolSettings.dBrush));
vg->charStyle().setFillShade(pg->attribute("FSHADE", "100").toInt());
vg->charStyle().setStrokeColor(pg->attribute("SCOLOR", doc->toolSettings.dPen));
vg->charStyle().setStrokeShade(pg->attribute("SSHADE", "100").toInt());
vg->setUseBaselineGrid(static_cast<bool>(pg->attribute("BASE", "0").toInt()));
vg->charStyle().cshadowx = qRound(pg->attribute("TXTSHX", "5").toDouble() * 10);
vg->charStyle().cshadowy = qRound(pg->attribute("TXTSHY", "-5").toDouble() * 10);
vg->charStyle().coutline = qRound(pg->attribute("TXTOUT", "1").toDouble() * 10);
vg->charStyle().cunderpos = qRound(pg->attribute("TXTULP", "-0.1").toDouble() * 10);
vg->charStyle().cunderwidth = qRound(pg->attribute("TXTULW", "-0.1").toDouble() * 10);
vg->charStyle().cstrikepos = qRound(pg->attribute("TXTSTP", "-0.1").toDouble() * 10);
vg->charStyle().cstrikewidth = qRound(pg->attribute("TXTSTW", "-0.1").toDouble() * 10);
vg->charStyle().cscale = qRound(pg->attribute("SCALEH", "100").toDouble() * 10);
vg->charStyle().cscalev = qRound(pg->attribute("SCALEV", "100").toDouble() * 10);
vg->charStyle().cbase = qRound(pg->attribute("BASEO", "0").toDouble() * 10);
vg->charStyle().cextra = qRound(pg->attribute("KERN", "0").toDouble() * 10);
vg->charStyle().setShadowXOffset(qRound(pg->attribute("TXTSHX", "5").toDouble() * 10));
vg->charStyle().setShadowYOffset(qRound(pg->attribute("TXTSHY", "-5").toDouble() * 10));
vg->charStyle().setOutlineWidth(qRound(pg->attribute("TXTOUT", "1").toDouble() * 10));
vg->charStyle().setUnderlineOffset(qRound(pg->attribute("TXTULP", "-0.1").toDouble() * 10));
vg->charStyle().setUnderlineWidth(qRound(pg->attribute("TXTULW", "-0.1").toDouble() * 10));
vg->charStyle().setStrikethruOffset(qRound(pg->attribute("TXTSTP", "-0.1").toDouble() * 10));
vg->charStyle().setStrikethruWidth(qRound(pg->attribute("TXTSTW", "-0.1").toDouble() * 10));
vg->charStyle().setScaleH(qRound(pg->attribute("SCALEH", "100").toDouble() * 10));
vg->charStyle().setScaleV(qRound(pg->attribute("SCALEV", "100").toDouble() * 10));
vg->charStyle().setBaselineOffset(qRound(pg->attribute("BASEO", "0").toDouble() * 10));
vg->charStyle().setTracking(qRound(pg->attribute("KERN", "0").toDouble() * 10));
vg->tabValues().clear();
if ((pg->hasAttribute("NUMTAB")) && (pg->attribute("NUMTAB", "0").toInt() != 0))
{
/branches/Version13x/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
1420,8 → 1420,8
fo.setAttribute("FIRST",m_Doc->docParagraphStyles[ff].firstIndent());
fo.setAttribute("VOR",m_Doc->docParagraphStyles[ff].gapBefore());
fo.setAttribute("NACH",m_Doc->docParagraphStyles[ff].gapAfter());
fo.setAttribute("FONT",m_Doc->docParagraphStyles[ff].charStyle().cfont->scName());
fo.setAttribute("FONTSIZE",m_Doc->docParagraphStyles[ff].charStyle().csize / 10.0);
fo.setAttribute("FONT",m_Doc->docParagraphStyles[ff].charStyle().font()->scName());
fo.setAttribute("FONTSIZE",m_Doc->docParagraphStyles[ff].charStyle().fontSize() / 10.0);
fo.setAttribute("DROP", static_cast<int>(m_Doc->docParagraphStyles[ff].hasDropCap()));
fo.setAttribute("DROPLIN", m_Doc->docParagraphStyles[ff].dropCapLines());
fo.setAttribute("DROPDIST", m_Doc->docParagraphStyles[ff].dropCapOffset());
1440,22 → 1440,22
fo.appendChild(tabs);
}
}
fo.setAttribute("FCOLOR",m_Doc->docParagraphStyles[ff].charStyle().ccolor);
fo.setAttribute("FSHADE",m_Doc->docParagraphStyles[ff].charStyle().cshade);
fo.setAttribute("SCOLOR",m_Doc->docParagraphStyles[ff].charStyle().cstroke);
fo.setAttribute("SSHADE",m_Doc->docParagraphStyles[ff].charStyle().cshade2);
fo.setAttribute("FCOLOR",m_Doc->docParagraphStyles[ff].charStyle().fillColor());
fo.setAttribute("FSHADE",m_Doc->docParagraphStyles[ff].charStyle().fillShade());
fo.setAttribute("SCOLOR",m_Doc->docParagraphStyles[ff].charStyle().strokeColor());
fo.setAttribute("SSHADE",m_Doc->docParagraphStyles[ff].charStyle().strokeShade());
fo.setAttribute("BASE", static_cast<int>(m_Doc->docParagraphStyles[ff].useBaselineGrid()));
fo.setAttribute("TXTSHX",m_Doc->docParagraphStyles[ff].charStyle().cshadowx / 10.0);
fo.setAttribute("TXTSHY",m_Doc->docParagraphStyles[ff].charStyle().cshadowy / 10.0);
fo.setAttribute("TXTOUT",m_Doc->docParagraphStyles[ff].charStyle().coutline / 10.0);
fo.setAttribute("TXTULP",m_Doc->docParagraphStyles[ff].charStyle().cunderpos / 10.0);
fo.setAttribute("TXTULW",m_Doc->docParagraphStyles[ff].charStyle().cunderwidth / 10.0);
fo.setAttribute("TXTSTP",m_Doc->docParagraphStyles[ff].charStyle().cstrikepos / 10.0);
fo.setAttribute("TXTSTW",m_Doc->docParagraphStyles[ff].charStyle().cstrikewidth / 10.0);
fo.setAttribute("SCALEH",m_Doc->docParagraphStyles[ff].charStyle().cscale / 10.0);
fo.setAttribute("SCALEV",m_Doc->docParagraphStyles[ff].charStyle().cscalev / 10.0);
fo.setAttribute("BASEO",m_Doc->docParagraphStyles[ff].charStyle().cbase / 10.0);
fo.setAttribute("KERN",m_Doc->docParagraphStyles[ff].charStyle().cextra / 10.0);
fo.setAttribute("TXTSHX",m_Doc->docParagraphStyles[ff].charStyle().shadowXOffset() / 10.0);
fo.setAttribute("TXTSHY",m_Doc->docParagraphStyles[ff].charStyle().shadowYOffset() / 10.0);
fo.setAttribute("TXTOUT",m_Doc->docParagraphStyles[ff].charStyle().outlineWidth() / 10.0);
fo.setAttribute("TXTULP",m_Doc->docParagraphStyles[ff].charStyle().underlineOffset() / 10.0);
fo.setAttribute("TXTULW",m_Doc->docParagraphStyles[ff].charStyle().underlineWidth() / 10.0);
fo.setAttribute("TXTSTP",m_Doc->docParagraphStyles[ff].charStyle().strikethruOffset() / 10.0);
fo.setAttribute("TXTSTW",m_Doc->docParagraphStyles[ff].charStyle().strikethruWidth() / 10.0);
fo.setAttribute("SCALEH",m_Doc->docParagraphStyles[ff].charStyle().scaleH() / 10.0);
fo.setAttribute("SCALEV",m_Doc->docParagraphStyles[ff].charStyle().scaleV() / 10.0);
fo.setAttribute("BASEO",m_Doc->docParagraphStyles[ff].charStyle().baselineOffset() / 10.0);
fo.setAttribute("KERN",m_Doc->docParagraphStyles[ff].charStyle().tracking() / 10.0);
dc.appendChild(fo);
}
}
1728,7 → 1728,7
 
void Scribus13Format::GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo, bool VorLFound)
{
Foi* dummy;
Foi* dummy = NULL;
bool unknown = false;
QString tmp2, tmpf;
tmp2 = it->attribute("CH");
1798,18 → 1798,18
CharStyle newStyle;
QChar ch = tmp2.at(cxx);
if (ch == QChar(5))
ch = QChar(13);
ch = SpecialChars::PARSEP;
if (ch == QChar(4))
ch = QChar(9);
ch = SpecialChars::TAB;
if (unknown)
newStyle.cfont = dummy;
newStyle.setFont(dummy);
else
newStyle.cfont = (*doc->AllFonts)[tmpf];
newStyle.csize = size;
newStyle.ccolor = fcolor;
newStyle.cextra = extra;
newStyle.cshade = shade;
newStyle.cstyle = static_cast<StyleFlag>(style);
newStyle.setFont((*doc->AllFonts)[tmpf]);
newStyle.setFontSize(size);
newStyle.setFillColor(fcolor);
newStyle.setTracking(extra);
newStyle.setFillShade(shade);
newStyle.setEffects(static_cast<StyleFlag>(style));
if (ab >= 5) breakPoint();
if (impo)
{
1825,18 → 1825,18
}
else
last->ParaStyle = ab;
newStyle.cstroke = stroke;
newStyle.cshade2 = shade2;
newStyle.cscale = QMIN(QMAX(scale, 100), 4000);
newStyle.cscalev = QMIN(QMAX(scalev, 100), 4000);
newStyle.cbase = base;
newStyle.cshadowx = shX;
newStyle.cshadowy = shY;
newStyle.coutline = outL;
newStyle.cunderpos = ulp;
newStyle.cunderwidth = ulw;
newStyle.cstrikepos = stp;
newStyle.cstrikewidth = stw;
newStyle.setStrokeColor(stroke);
newStyle.setStrokeShade(shade2);
newStyle.setScaleH(QMIN(QMAX(scale, 100), 4000));
newStyle.setScaleV(QMIN(QMAX(scalev, 100), 4000));
newStyle.setBaselineOffset(base);
newStyle.setShadowXOffset(shX);
newStyle.setShadowYOffset(shY);
newStyle.setOutlineWidth(outL);
newStyle.setUnderlineOffset(ulp);
newStyle.setUnderlineWidth(ulw);
newStyle.setStrikethruOffset(stp);
newStyle.setStrikethruWidth(stw);
int pos = obj->itemText.length();
if (ch == SpecialChars::OBJECT) {
if (iobj != -1) {
1898,28 → 1898,28
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
vg.charStyle().cfont = (*m_Doc->AllFonts)[tmpf];
vg.charStyle().csize = qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0);
vg.charStyle().setFont((*m_Doc->AllFonts)[tmpf]);
vg.charStyle().setFontSize(qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0));
vg.setHasDropCap(static_cast<bool>(pg.attribute("DROP", "0").toInt()));
vg.setDropCapLines(pg.attribute("DROPLIN", "2").toInt());
vg.setDropCapOffset(pg.attribute("DROPDIST", "0").toDouble());
vg.charStyle().cstyle = static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt());
vg.charStyle().ccolor = pg.attribute("FCOLOR", doc->toolSettings.dBrush);
vg.charStyle().cshade = pg.attribute("FSHADE", "100").toInt();
vg.charStyle().cstroke = pg.attribute("SCOLOR", doc->toolSettings.dPen);
vg.charStyle().cshade2 = pg.attribute("SSHADE", "100").toInt();
vg.charStyle().setEffects(static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt()));
vg.charStyle().setFillColor(pg.attribute("FCOLOR", doc->toolSettings.dBrush));
vg.charStyle().setFillShade(pg.attribute("FSHADE", "100").toInt());
vg.charStyle().setStrokeColor(pg.attribute("SCOLOR", doc->toolSettings.dPen));
vg.charStyle().setStrokeShade(pg.attribute("SSHADE", "100").toInt());
vg.setUseBaselineGrid(static_cast<bool>(pg.attribute("BASE", "0").toInt()));
vg.charStyle().cshadowx = qRound(pg.attribute("TXTSHX", "5").toDouble() * 10);
vg.charStyle().cshadowy = qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10);
vg.charStyle().coutline = qRound(pg.attribute("TXTOUT", "1").toDouble() * 10);
vg.charStyle().cunderpos = qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10);
vg.charStyle().cunderwidth = qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10);
vg.charStyle().cstrikepos = qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10);
vg.charStyle().cstrikewidth = qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10);
vg.charStyle().cscale = qRound(pg.attribute("SCALEH", "100").toDouble() * 10);
vg.charStyle().cscalev = qRound(pg.attribute("SCALEV", "100").toDouble() * 10);
vg.charStyle().cbase = qRound(pg.attribute("BASEO", "0").toDouble() * 10);
vg.charStyle().cextra = qRound(pg.attribute("KERN", "0").toDouble() * 10);
vg.charStyle().setShadowXOffset(qRound(pg.attribute("TXTSHX", "5").toDouble() * 10));
vg.charStyle().setShadowYOffset(qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10));
vg.charStyle().setOutlineWidth(qRound(pg.attribute("TXTOUT", "1").toDouble() * 10));
vg.charStyle().setUnderlineOffset(qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10));
vg.charStyle().setUnderlineWidth(qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruOffset(qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruWidth(qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10));
vg.charStyle().setScaleH(qRound(pg.attribute("SCALEH", "100").toDouble() * 10));
vg.charStyle().setScaleV(qRound(pg.attribute("SCALEV", "100").toDouble() * 10));
vg.charStyle().setBaselineOffset(qRound(pg.attribute("BASEO", "0").toDouble() * 10));
vg.charStyle().setTracking(qRound(pg.attribute("KERN", "0").toDouble() * 10));
vg.tabValues().clear();
if ((pg.hasAttribute("NUMTAB")) && (pg.attribute("NUMTAB", "0").toInt() != 0))
{
2145,10 → 2145,10
currItem->setFillShade(obj->attribute("SHADE").toInt());
currItem->setLineShade(obj->attribute("SHADE2").toInt());
ParagraphStyle pstyle;
// for some reason IFONT is set later, check at the place where PasteItem() is called.
pstyle.setLineSpacing(obj->attribute("LINESP").toDouble());
pstyle.setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(obj->attribute("LINESPMode", "0").toInt()));
pstyle.setAlignment(obj->attribute("ALIGN", "0").toInt());
/* sigh
pstyle.charStyle().setFontSize(qRound(obj->attribute("ISIZE", "12").toDouble() * 10));
pstyle.charStyle().setStrokeColor(obj->attribute("TXTSTROKE", CommonStrings::None));
pstyle.charStyle().setFillColor(obj->attribute("TXTFILL", "Black"));
2164,24 → 2164,7
pstyle.charStyle().setUnderlineWidth(qRound(obj->attribute("TXTULW", "-0.1").toDouble() * 10));
pstyle.charStyle().setStrikethruOffset(qRound(obj->attribute("TXTSTP", "-0.1").toDouble() * 10));
pstyle.charStyle().setStrikethruWidth(qRound(obj->attribute("TXTSTW", "-0.1").toDouble() * 10));
pstyle.charStyle().setEffects(obj->attribute("TXTSTYLE", "0").toInt());
*/
pstyle.charStyle().csize = (qRound(obj->attribute("ISIZE", "12").toDouble() * 10));
pstyle.charStyle().cstroke = (obj->attribute("TXTSTROKE", CommonStrings::None));
pstyle.charStyle().ccolor = (obj->attribute("TXTFILL", "Black"));
pstyle.charStyle().cshade2 = (obj->attribute("TXTSTRSH", "100").toInt());
pstyle.charStyle().cshade = (obj->attribute("TXTFILLSH", "100").toInt());
pstyle.charStyle().cscale = (qRound(obj->attribute("TXTSCALE", "100").toDouble() * 10));
pstyle.charStyle().cscalev = (qRound(obj->attribute("TXTSCALEV", "100").toDouble() * 10));
pstyle.charStyle().cbase = (qRound(obj->attribute("TXTBASE", "0").toDouble() * 10));
pstyle.charStyle().cshadowx = (qRound(obj->attribute("TXTSHX", "5").toDouble() * 10));
pstyle.charStyle().cshadowy = (qRound(obj->attribute("TXTSHY", "-5").toDouble() * 10));
pstyle.charStyle().coutline = (qRound(obj->attribute("TXTOUT", "1").toDouble() * 10));
pstyle.charStyle().cunderpos = (qRound(obj->attribute("TXTULP", "-0.1").toDouble() * 10));
pstyle.charStyle().cunderwidth = (qRound(obj->attribute("TXTULW", "-0.1").toDouble() * 10));
pstyle.charStyle().cstrikepos = (qRound(obj->attribute("TXTSTP", "-0.1").toDouble() * 10));
pstyle.charStyle().cstrikewidth = (qRound(obj->attribute("TXTSTW", "-0.1").toDouble() * 10));
pstyle.charStyle().cstyle = static_cast<StyleFlag>(obj->attribute("TXTSTYLE", "0").toInt());
pstyle.charStyle().setEffects(static_cast<StyleFlag>(obj->attribute("TXTSTYLE", "0").toInt()));
currItem->itemText.setDefaultStyle(pstyle);
currItem->setRotation(obj->attribute("ROT").toDouble());
currItem->setTextToFrameDist(obj->attribute("EXTRA").toDouble(),
3310,38 → 3293,38
const CharStyle& style1(item->itemText.charStyle(k));
QChar ch = item->itemText.text(k);
QDomElement it=docu->createElement("ITEXT");
ts = style1.csize / 10.0;
tf = style1.cfont->scName();
tc = style1.ccolor;
te = style1.cextra;
tsh = style1.cshade;
tst = style1.cstyle & 2047;
ts = style1.fontSize() / 10.0;
tf = style1.font()->scName();
tc = style1.fillColor();
te = style1.tracking();
tsh = style1.fillShade();
tst = style1.effects() & ScStyle_UserStyles;
#ifndef NLS_PROTO
tsb = item->itemText.at(k)->cab;
#else
tsb = 0;
#endif
tcs = style1.cstroke;
tshs = style1.cshade2;
tsc = style1.cscale / 10.0;
tscv = style1.cscalev / 10.0;
tb = style1.cbase / 10.0;
tsx = style1.cshadowx / 10.0;
tsy = style1.cshadowy / 10.0;
tout = style1.coutline / 10.0;
tulp = style1.cunderpos / 10.0;
tulw = style1.cunderwidth / 10.0;
tstp = style1.cstrikepos / 10.0;
tstw = style1.cstrikewidth / 10.0;
tcs = style1.strokeColor();
tshs = style1.strokeShade();
tsc = style1.scaleH() / 10.0;
tscv = style1.scaleV() / 10.0;
tb = style1.baselineOffset() / 10.0;
tsx = style1.shadowXOffset() / 10.0;
tsy = style1.shadowYOffset() / 10.0;
tout = style1.outlineWidth() / 10.0;
tulp = style1.underlineOffset() / 10.0;
tulw = style1.underlineWidth() / 10.0;
tstp = style1.strikethruOffset() / 10.0;
tstw = style1.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
if ((ch == SpecialChars::OBJECT) && (item->itemText.at(k)->cembedded != 0))
tobj = item->itemText.at(k)->cembedded->ItemNr;
else
#endif
tobj = -1;
if (ch == QChar(13))
if (ch == SpecialChars::PARSEP)
text = QChar(5);
else if (ch == QChar(9))
else if (ch == SpecialChars::TAB)
text = QChar(4);
else
text = ch;
3375,31 → 3358,31
}
const CharStyle& style2(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style2.csize / 10.0;
tf2 = style2.cfont->scName();
tc2 = style2.ccolor;
te2 = style2.cextra;
tsh2 = style2.cshade;
tst2 = style2.cstyle & 2047;
ts2 = style2.fontSize() / 10.0;
tf2 = style2.font()->scName();
tc2 = style2.fillColor();
te2 = style2.tracking();
tsh2 = style2.fillShade();
tst2 = style2.effects() & ScStyle_UserStyles;
#ifndef NLS_PROTO
tsb2 = item->itemText.at(k)->cab;
#else
tsb2 = 0;
#endif
tcs2 = style2.cstroke;
tshs2 = style2.cshade2;
tsc2 = style2.cscale / 10.0;
tscv2 = style2.cscalev / 10.0;
tb2 = style2.cbase / 10.0;
tsx2 = style2.cshadowx / 10.0;
tsy2 = style2.cshadowy / 10.0;
tout2 = style2.coutline / 10.0;
tulp2 = style2.cunderpos / 10.0;
tulw2 = style2.cunderwidth / 10.0;
tstp2 = style2.cstrikepos / 10.0;
tstw2 = style2.cstrikewidth / 10.0;
tcs2 = style2.strokeColor();
tshs2 = style2.strokeShade();
tsc2 = style2.scaleH() / 10.0;
tscv2 = style2.scaleV() / 10.0;
tb2 = style2.baselineOffset() / 10.0;
tsx2 = style2.shadowXOffset() / 10.0;
tsy2 = style2.shadowYOffset() / 10.0;
tout2 = style2.outlineWidth() / 10.0;
tulp2 = style2.underlineOffset() / 10.0;
tulw2 = style2.underlineWidth() / 10.0;
tstp2 = style2.strikethruOffset() / 10.0;
tstw2 = style2.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
if ((ch == SpecialChars::OBJECT) && (item->itemText.at(k)->cembedded != 0))
tobj2 = item->itemText.at(k)->cembedded->ItemNr;
else
#endif
3425,9 → 3408,9
&& (tobj2 == tobj)
&& (tst2 == tst))
{
if (ch == QChar(13))
if (ch == SpecialChars::PARSEP)
text += QChar(5);
else if (ch == QChar(9))
else if (ch == SpecialChars::TAB)
text += QChar(4);
else
text += ch;
3436,31 → 3419,31
break;
const CharStyle& style3(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style3.csize / 10.0;
tf2 = style3.cfont->scName();
tc2 = style3.ccolor;
te2 = style3.cextra;
tsh2 = style3.cshade;
tst2 = style3.cstyle & 2047;
ts2 = style3.fontSize() / 10.0;
tf2 = style3.font()->scName();
tc2 = style3.fillColor();
te2 = style3.tracking();
tsh2 = style3.fillShade();
tst2 = style3.effects() & ScStyle_UserStyles;
#ifndef NLS_PROTO
tsb2 = item->itemText.at(k)->cab;
#else
tsb2 = 0;
#endif
tcs2 = style3.cstroke;
tshs2 = style3.cshade2;
tsc2 = style3.cscale / 10.0;
tscv2 = style3.cscalev / 10.0;
tb2 = style3.cbase / 10.0;
tsx2 = style3.cshadowx / 10.0;
tsy2 = style3.cshadowy / 10.0;
tout2 = style3.coutline / 10.0;
tulp2 = style3.cunderpos / 10.0;
tulw2 = style3.cunderwidth / 10.0;
tstp2 = style3.cstrikepos / 10.0;
tstw2 = style3.cstrikewidth / 10.0;
tcs2 = style3.strokeColor();
tshs2 = style3.strokeShade();
tsc2 = style3.scaleH() / 10.0;
tscv2 = style3.scaleV() / 10.0;
tb2 = style3.baselineOffset() / 10.0;
tsx2 = style3.shadowXOffset() / 10.0;
tsy2 = style3.shadowYOffset() / 10.0;
tout2 = style3.outlineWidth() / 10.0;
tulp2 = style3.underlineOffset() / 10.0;
tulw2 = style3.underlineWidth() / 10.0;
tstp2 = style3.strikethruOffset() / 10.0;
tstw2 = style3.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
if ((ch == SpecialChars::OBJECT) && (item->itemText.at(k)->cembedded != 0))
tobj2 = item->itemText.at(k)->cembedded->ItemNr;
else
#endif
/branches/Version13x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
1420,8 → 1420,8
fo.setAttribute("FIRST",m_Doc->docParagraphStyles[ff].firstIndent());
fo.setAttribute("VOR",m_Doc->docParagraphStyles[ff].gapBefore());
fo.setAttribute("NACH",m_Doc->docParagraphStyles[ff].gapAfter());
fo.setAttribute("FONT",m_Doc->docParagraphStyles[ff].charStyle().cfont->scName());
fo.setAttribute("FONTSIZE",m_Doc->docParagraphStyles[ff].charStyle().csize / 10.0);
fo.setAttribute("FONT",m_Doc->docParagraphStyles[ff].charStyle().font()->scName());
fo.setAttribute("FONTSIZE",m_Doc->docParagraphStyles[ff].charStyle().fontSize() / 10.0);
fo.setAttribute("DROP", static_cast<int>(m_Doc->docParagraphStyles[ff].hasDropCap()));
fo.setAttribute("DROPLIN", m_Doc->docParagraphStyles[ff].dropCapLines());
fo.setAttribute("DROPDIST", m_Doc->docParagraphStyles[ff].dropCapOffset());
1440,22 → 1440,22
fo.appendChild(tabs);
}
}
fo.setAttribute("FCOLOR",m_Doc->docParagraphStyles[ff].charStyle().ccolor);
fo.setAttribute("FSHADE",m_Doc->docParagraphStyles[ff].charStyle().cshade);
fo.setAttribute("SCOLOR",m_Doc->docParagraphStyles[ff].charStyle().cstroke);
fo.setAttribute("SSHADE",m_Doc->docParagraphStyles[ff].charStyle().cshade2);
fo.setAttribute("FCOLOR",m_Doc->docParagraphStyles[ff].charStyle().fillColor());
fo.setAttribute("FSHADE",m_Doc->docParagraphStyles[ff].charStyle().fillShade());
fo.setAttribute("SCOLOR",m_Doc->docParagraphStyles[ff].charStyle().strokeColor());
fo.setAttribute("SSHADE",m_Doc->docParagraphStyles[ff].charStyle().strokeShade());
fo.setAttribute("BASE", static_cast<int>(m_Doc->docParagraphStyles[ff].useBaselineGrid()));
fo.setAttribute("TXTSHX",m_Doc->docParagraphStyles[ff].charStyle().cshadowx / 10.0);
fo.setAttribute("TXTSHY",m_Doc->docParagraphStyles[ff].charStyle().cshadowy / 10.0);
fo.setAttribute("TXTOUT",m_Doc->docParagraphStyles[ff].charStyle().coutline / 10.0);
fo.setAttribute("TXTULP",m_Doc->docParagraphStyles[ff].charStyle().cunderpos / 10.0);
fo.setAttribute("TXTULW",m_Doc->docParagraphStyles[ff].charStyle().cunderwidth / 10.0);
fo.setAttribute("TXTSTP",m_Doc->docParagraphStyles[ff].charStyle().cstrikepos / 10.0);
fo.setAttribute("TXTSTW",m_Doc->docParagraphStyles[ff].charStyle().cstrikewidth / 10.0);
fo.setAttribute("SCALEH",m_Doc->docParagraphStyles[ff].charStyle().cscale / 10.0);
fo.setAttribute("SCALEV",m_Doc->docParagraphStyles[ff].charStyle().cscalev / 10.0);
fo.setAttribute("BASEO",m_Doc->docParagraphStyles[ff].charStyle().cbase / 10.0);
fo.setAttribute("KERN",m_Doc->docParagraphStyles[ff].charStyle().cextra / 10.0);
fo.setAttribute("TXTSHX",m_Doc->docParagraphStyles[ff].charStyle().shadowXOffset() / 10.0);
fo.setAttribute("TXTSHY",m_Doc->docParagraphStyles[ff].charStyle().shadowYOffset() / 10.0);
fo.setAttribute("TXTOUT",m_Doc->docParagraphStyles[ff].charStyle().outlineWidth() / 10.0);
fo.setAttribute("TXTULP",m_Doc->docParagraphStyles[ff].charStyle().underlineOffset() / 10.0);
fo.setAttribute("TXTULW",m_Doc->docParagraphStyles[ff].charStyle().underlineWidth() / 10.0);
fo.setAttribute("TXTSTP",m_Doc->docParagraphStyles[ff].charStyle().strikethruOffset() / 10.0);
fo.setAttribute("TXTSTW",m_Doc->docParagraphStyles[ff].charStyle().strikethruWidth() / 10.0);
fo.setAttribute("SCALEH",m_Doc->docParagraphStyles[ff].charStyle().scaleH() / 10.0);
fo.setAttribute("SCALEV",m_Doc->docParagraphStyles[ff].charStyle().scaleV() / 10.0);
fo.setAttribute("BASEO",m_Doc->docParagraphStyles[ff].charStyle().baselineOffset() / 10.0);
fo.setAttribute("KERN",m_Doc->docParagraphStyles[ff].charStyle().tracking() / 10.0);
dc.appendChild(fo);
}
}
1728,7 → 1728,7
 
void Scribus134Format::GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo, bool VorLFound)
{
Foi* dummy;
Foi* dummy = NULL;
bool unknown = false;
QString tmp2, tmpf;
tmp2 = it->attribute("CH");
1802,14 → 1802,14
if (ch == QChar(4))
ch = QChar(9);
if (unknown)
newStyle.cfont = dummy;
newStyle.setFont(dummy);
else
newStyle.cfont = (*doc->AllFonts)[tmpf];
newStyle.csize = size;
newStyle.ccolor = fcolor;
newStyle.cextra = extra;
newStyle.cshade = shade;
newStyle.cstyle = static_cast<StyleFlag>(style);
newStyle.setFont((*doc->AllFonts)[tmpf]);
newStyle.setFontSize(size);
newStyle.setFillColor(fcolor);
newStyle.setTracking(extra);
newStyle.setFillShade(shade);
newStyle.setEffects(static_cast<StyleFlag>(style));
if (ab >= 5) breakPoint();
if (impo)
{
1825,18 → 1825,18
}
else
last->ParaStyle = ab;
newStyle.cstroke = stroke;
newStyle.cshade2 = shade2;
newStyle.cscale = QMIN(QMAX(scale, 100), 4000);
newStyle.cscalev = QMIN(QMAX(scalev, 100), 4000);
newStyle.cbase = base;
newStyle.cshadowx = shX;
newStyle.cshadowy = shY;
newStyle.coutline = outL;
newStyle.cunderpos = ulp;
newStyle.cunderwidth = ulw;
newStyle.cstrikepos = stp;
newStyle.cstrikewidth = stw;
newStyle.setStrokeColor(stroke);
newStyle.setStrokeShade(shade2);
newStyle.setScaleH(QMIN(QMAX(scale, 100), 4000));
newStyle.setScaleV(QMIN(QMAX(scalev, 100), 4000));
newStyle.setBaselineOffset(base);
newStyle.setShadowXOffset(shX);
newStyle.setShadowYOffset(shY);
newStyle.setOutlineWidth(outL);
newStyle.setUnderlineOffset(ulp);
newStyle.setUnderlineWidth(ulw);
newStyle.setStrikethruOffset(stp);
newStyle.setStrikethruWidth(stw);
int pos = obj->itemText.length();
if (ch == SpecialChars::OBJECT) {
if (iobj != -1) {
1898,28 → 1898,28
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
vg.charStyle().cfont = (*m_Doc->AllFonts)[tmpf];
vg.charStyle().csize = qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0);
vg.charStyle().setFont((*m_Doc->AllFonts)[tmpf]);
vg.charStyle().setFontSize(qRound(pg.attribute("FONTSIZE", "12").toDouble() * 10.0));
vg.setHasDropCap(static_cast<bool>(pg.attribute("DROP", "0").toInt()));
vg.setDropCapLines(pg.attribute("DROPLIN", "2").toInt());
vg.setDropCapOffset(pg.attribute("DROPDIST", "0").toDouble());
vg.charStyle().cstyle = static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt());
vg.charStyle().ccolor = pg.attribute("FCOLOR", doc->toolSettings.dBrush);
vg.charStyle().cshade = pg.attribute("FSHADE", "100").toInt();
vg.charStyle().cstroke = pg.attribute("SCOLOR", doc->toolSettings.dPen);
vg.charStyle().cshade2 = pg.attribute("SSHADE", "100").toInt();
vg.charStyle().setEffects(static_cast<StyleFlag>(pg.attribute("EFFECT", "0").toInt()));
vg.charStyle().setFillColor(pg.attribute("FCOLOR", doc->toolSettings.dBrush));
vg.charStyle().setFillShade(pg.attribute("FSHADE", "100").toInt());
vg.charStyle().setStrokeColor(pg.attribute("SCOLOR", doc->toolSettings.dPen));
vg.charStyle().setStrokeShade(pg.attribute("SSHADE", "100").toInt());
vg.setUseBaselineGrid(static_cast<bool>(pg.attribute("BASE", "0").toInt()));
vg.charStyle().cshadowx = qRound(pg.attribute("TXTSHX", "5").toDouble() * 10);
vg.charStyle().cshadowy = qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10);
vg.charStyle().coutline = qRound(pg.attribute("TXTOUT", "1").toDouble() * 10);
vg.charStyle().cunderpos = qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10);
vg.charStyle().cunderwidth = qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10);
vg.charStyle().cstrikepos = qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10);
vg.charStyle().cstrikewidth = qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10);
vg.charStyle().cscale = qRound(pg.attribute("SCALEH", "100").toDouble() * 10);
vg.charStyle().cscalev = qRound(pg.attribute("SCALEV", "100").toDouble() * 10);
vg.charStyle().cbase = qRound(pg.attribute("BASEO", "0").toDouble() * 10);
vg.charStyle().cextra = qRound(pg.attribute("KERN", "0").toDouble() * 10);
vg.charStyle().setShadowXOffset(qRound(pg.attribute("TXTSHX", "5").toDouble() * 10));
vg.charStyle().setShadowYOffset(qRound(pg.attribute("TXTSHY", "-5").toDouble() * 10));
vg.charStyle().setOutlineWidth(qRound(pg.attribute("TXTOUT", "1").toDouble() * 10));
vg.charStyle().setUnderlineOffset(qRound(pg.attribute("TXTULP", "-0.1").toDouble() * 10));
vg.charStyle().setUnderlineWidth(qRound(pg.attribute("TXTULW", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruOffset(qRound(pg.attribute("TXTSTP", "-0.1").toDouble() * 10));
vg.charStyle().setStrikethruWidth(qRound(pg.attribute("TXTSTW", "-0.1").toDouble() * 10));
vg.charStyle().setScaleH(qRound(pg.attribute("SCALEH", "100").toDouble() * 10));
vg.charStyle().setScaleV(qRound(pg.attribute("SCALEV", "100").toDouble() * 10));
vg.charStyle().setBaselineOffset(qRound(pg.attribute("BASEO", "0").toDouble() * 10));
vg.charStyle().setTracking(qRound(pg.attribute("KERN", "0").toDouble() * 10));
vg.tabValues().clear();
if ((pg.hasAttribute("NUMTAB")) && (pg.attribute("NUMTAB", "0").toInt() != 0))
{
2148,7 → 2148,6
pstyle.setLineSpacing(obj->attribute("LINESP").toDouble());
pstyle.setLineSpacingMode(static_cast<ParagraphStyle::LineSpacingMode>(obj->attribute("LINESPMode", "0").toInt()));
pstyle.setAlignment(obj->attribute("ALIGN", "0").toInt());
/* sigh
pstyle.charStyle().setFontSize(qRound(obj->attribute("ISIZE", "12").toDouble() * 10));
pstyle.charStyle().setStrokeColor(obj->attribute("TXTSTROKE", CommonStrings::None));
pstyle.charStyle().setFillColor(obj->attribute("TXTFILL", "Black"));
2164,24 → 2163,7
pstyle.charStyle().setUnderlineWidth(qRound(obj->attribute("TXTULW", "-0.1").toDouble() * 10));
pstyle.charStyle().setStrikethruOffset(qRound(obj->attribute("TXTSTP", "-0.1").toDouble() * 10));
pstyle.charStyle().setStrikethruWidth(qRound(obj->attribute("TXTSTW", "-0.1").toDouble() * 10));
pstyle.charStyle().setEffects(obj->attribute("TXTSTYLE", "0").toInt());
*/
pstyle.charStyle().csize = (qRound(obj->attribute("ISIZE", "12").toDouble() * 10));
pstyle.charStyle().cstroke = (obj->attribute("TXTSTROKE", CommonStrings::None));
pstyle.charStyle().ccolor = (obj->attribute("TXTFILL", "Black"));
pstyle.charStyle().cshade2 = (obj->attribute("TXTSTRSH", "100").toInt());
pstyle.charStyle().cshade = (obj->attribute("TXTFILLSH", "100").toInt());
pstyle.charStyle().cscale = (qRound(obj->attribute("TXTSCALE", "100").toDouble() * 10));
pstyle.charStyle().cscalev = (qRound(obj->attribute("TXTSCALEV", "100").toDouble() * 10));
pstyle.charStyle().cbase = (qRound(obj->attribute("TXTBASE", "0").toDouble() * 10));
pstyle.charStyle().cshadowx = (qRound(obj->attribute("TXTSHX", "5").toDouble() * 10));
pstyle.charStyle().cshadowy = (qRound(obj->attribute("TXTSHY", "-5").toDouble() * 10));
pstyle.charStyle().coutline = (qRound(obj->attribute("TXTOUT", "1").toDouble() * 10));
pstyle.charStyle().cunderpos = (qRound(obj->attribute("TXTULP", "-0.1").toDouble() * 10));
pstyle.charStyle().cunderwidth = (qRound(obj->attribute("TXTULW", "-0.1").toDouble() * 10));
pstyle.charStyle().cstrikepos = (qRound(obj->attribute("TXTSTP", "-0.1").toDouble() * 10));
pstyle.charStyle().cstrikewidth = (qRound(obj->attribute("TXTSTW", "-0.1").toDouble() * 10));
pstyle.charStyle().cstyle = static_cast<StyleFlag>(obj->attribute("TXTSTYLE", "0").toInt());
pstyle.charStyle().setEffects(static_cast<StyleFlag>(obj->attribute("TXTSTYLE", "0").toInt()));
currItem->itemText.setDefaultStyle(pstyle);
currItem->setRotation(obj->attribute("ROT").toDouble());
currItem->setTextToFrameDist(obj->attribute("EXTRA").toDouble(),
3310,29 → 3292,29
const CharStyle& style1(item->itemText.charStyle(k));
QChar ch = item->itemText.text(k);
QDomElement it=docu->createElement("ITEXT");
ts = style1.csize / 10.0;
tf = style1.cfont->scName();
tc = style1.ccolor;
te = style1.cextra;
tsh = style1.cshade;
tst = style1.cstyle & 2047;
ts = style1.fontSize() / 10.0;
tf = style1.font()->scName();
tc = style1.fillColor();
te = style1.tracking();
tsh = style1.fillShade();
tst = style1.effects() & 2047;
#ifndef NLS_PROTO
tsb = item->itemText.at(k)->cab;
#else
tsb = 0;
#endif
tcs = style1.cstroke;
tshs = style1.cshade2;
tsc = style1.cscale / 10.0;
tscv = style1.cscalev / 10.0;
tb = style1.cbase / 10.0;
tsx = style1.cshadowx / 10.0;
tsy = style1.cshadowy / 10.0;
tout = style1.coutline / 10.0;
tulp = style1.cunderpos / 10.0;
tulw = style1.cunderwidth / 10.0;
tstp = style1.cstrikepos / 10.0;
tstw = style1.cstrikewidth / 10.0;
tcs = style1.strokeColor();
tshs = style1.strokeShade();
tsc = style1.scaleH() / 10.0;
tscv = style1.scaleV() / 10.0;
tb = style1.baselineOffset() / 10.0;
tsx = style1.shadowXOffset() / 10.0;
tsy = style1.shadowYOffset() / 10.0;
tout = style1.outlineWidth() / 10.0;
tulp = style1.underlineOffset() / 10.0;
tulw = style1.underlineWidth() / 10.0;
tstp = style1.strikethruOffset() / 10.0;
tstw = style1.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
tobj = item->itemText.at(k)->cembedded->ItemNr;
3375,29 → 3357,29
}
const CharStyle& style2(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style2.csize / 10.0;
tf2 = style2.cfont->scName();
tc2 = style2.ccolor;
te2 = style2.cextra;
tsh2 = style2.cshade;
tst2 = style2.cstyle & 2047;
ts2 = style2.fontSize() / 10.0;
tf2 = style2.font()->scName();
tc2 = style2.fillColor();
te2 = style2.tracking();
tsh2 = style2.fillShade();
tst2 = style2.effects() & 2047;
#ifndef NLS_PROTO
tsb2 = item->itemText.at(k)->cab;
#else
tsb2 = 0;
#endif
tcs2 = style2.cstroke;
tshs2 = style2.cshade2;
tsc2 = style2.cscale / 10.0;
tscv2 = style2.cscalev / 10.0;
tb2 = style2.cbase / 10.0;
tsx2 = style2.cshadowx / 10.0;
tsy2 = style2.cshadowy / 10.0;
tout2 = style2.coutline / 10.0;
tulp2 = style2.cunderpos / 10.0;
tulw2 = style2.cunderwidth / 10.0;
tstp2 = style2.cstrikepos / 10.0;
tstw2 = style2.cstrikewidth / 10.0;
tcs2 = style2.strokeColor();
tshs2 = style2.strokeShade();
tsc2 = style2.scaleH() / 10.0;
tscv2 = style2.scaleV() / 10.0;
tb2 = style2.baselineOffset() / 10.0;
tsx2 = style2.shadowXOffset() / 10.0;
tsy2 = style2.shadowYOffset() / 10.0;
tout2 = style2.outlineWidth() / 10.0;
tulp2 = style2.underlineOffset() / 10.0;
tulw2 = style2.underlineWidth() / 10.0;
tstp2 = style2.strikethruOffset() / 10.0;
tstw2 = style2.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
tobj2 = item->itemText.at(k)->cembedded->ItemNr;
3436,29 → 3418,29
break;
const CharStyle& style3(item->itemText.charStyle(k));
ch = item->itemText.text(k);
ts2 = style3.csize / 10.0;
tf2 = style3.cfont->scName();
tc2 = style3.ccolor;
te2 = style3.cextra;
tsh2 = style3.cshade;
tst2 = style3.cstyle & 2047;
ts2 = style3.fontSize() / 10.0;
tf2 = style3.font()->scName();
tc2 = style3.fillColor();
te2 = style3.tracking();
tsh2 = style3.fillShade();
tst2 = style3.effects() & 2047;
#ifndef NLS_PROTO
tsb2 = item->itemText.at(k)->cab;
#else
tsb2 = 0;
#endif
tcs2 = style3.cstroke;
tshs2 = style3.cshade2;
tsc2 = style3.cscale / 10.0;
tscv2 = style3.cscalev / 10.0;
tb2 = style3.cbase / 10.0;
tsx2 = style3.cshadowx / 10.0;
tsy2 = style3.cshadowy / 10.0;
tout2 = style3.coutline / 10.0;
tulp2 = style3.cunderpos / 10.0;
tulw2 = style3.cunderwidth / 10.0;
tstp2 = style3.cstrikepos / 10.0;
tstw2 = style3.cstrikewidth / 10.0;
tcs2 = style3.strokeColor();
tshs2 = style3.strokeShade();
tsc2 = style3.scaleH() / 10.0;
tscv2 = style3.scaleV() / 10.0;
tb2 = style3.baselineOffset() / 10.0;
tsx2 = style3.shadowXOffset() / 10.0;
tsy2 = style3.shadowYOffset() / 10.0;
tout2 = style3.outlineWidth() / 10.0;
tulp2 = style3.underlineOffset() / 10.0;
tulw2 = style3.underlineWidth() / 10.0;
tstp2 = style3.strikethruOffset() / 10.0;
tstw2 = style3.strikethruWidth() / 10.0;
#ifndef NLS_PROTO
if ((ch == QChar(25)) && (item->itemText.at(k)->cembedded != 0))
tobj2 = item->itemText.at(k)->cembedded->ItemNr;
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
570,7 → 570,7
hl = Item->itemText.at(d);
if ((hl->ch == QChar(13)) || (hl->ch == QChar(10)) || (hl->ch == QChar(9)) || (hl->ch == QChar(28)))
continue;
if (hl->yp == 0)
if (hl->glyph.yoffset == 0)
break;
if (hl->ch == QChar(29))
chx = " ";
577,8 → 577,8
else
chx = hl->ch;
tp = docu->createElement("tspan");
tp.setAttribute("x", FToStr(hl->xp)+"pt");
tp.setAttribute("y", FToStr(hl->yp)+"pt");
tp.setAttribute("x", FToStr(hl->glyph.xoffset)+"pt");
tp.setAttribute("y", FToStr(hl->glyph.yoffset)+"pt");
SetTextProps(&tp, hl);
tp1 = docu->createTextNode(chx);
tp.appendChild(tp1);
641,8 → 641,8
tp.setAttribute("y", FToStr(hl->PtransY)+"pt");
tp.setAttribute("rotate", hl->PRot);
tp2 = docu->createElement("tspan");
tp2.setAttribute("dx", FToStr(hl->xp)+"pt");
tp2.setAttribute("dy", FToStr(hl->yp)+"pt");
tp2.setAttribute("dx", FToStr(hl->glyph.xoffset)+"pt");
tp2.setAttribute("dy", FToStr(hl->glyph.yoffset)+"pt");
SetTextProps(&tp2, hl);
tp1 = docu->createTextNode(chx);
tp2.appendChild(tp1);
742,20 → 742,20
 
void SVGExPlug::SetTextProps(QDomElement *tp, ScText *hl)
{
int chst = hl->cstyle & 127;
if (hl->ccolor != CommonStrings::None)
tp->setAttribute("fill", SetFarbe(hl->ccolor, hl->cshade));
int chst = hl->effects() & 127;
if (hl->fillColor() != CommonStrings::None)
tp->setAttribute("fill", SetFarbe(hl->fillColor(), hl->fillShade()));
else
tp->setAttribute("fill", "none");
if ((hl->cstroke != CommonStrings::None) && (chst & 4))
if ((hl->strokeColor() != CommonStrings::None) && (chst & 4))
{
tp->setAttribute("stroke", SetFarbe(hl->cstroke, hl->cshade2));
tp->setAttribute("stroke-width", FToStr((*ScMW->doc->AllFonts)[hl->cfont->scName()]->strokeWidth() * (hl->csize / 10.0))+"pt");
tp->setAttribute("stroke", SetFarbe(hl->strokeColor(), hl->strokeShade()));
tp->setAttribute("stroke-width", FToStr((*ScMW->doc->AllFonts)[hl->font()->scName()]->strokeWidth() * (hl->fontSize() / 10.0))+"pt");
}
else
tp->setAttribute("stroke", "none");
tp->setAttribute("font-size", (hl->csize / 10.0));
tp->setAttribute("font-family", (*ScMW->doc->AllFonts)[hl->cfont->scName()]->family());
tp->setAttribute("font-size", (hl->fontSize() / 10.0));
tp->setAttribute("font-family", (*ScMW->doc->AllFonts)[hl->font()->scName()]->family());
if (chst != 0)
{
if (chst & 64)
/branches/Version13x/Scribus/scribus/scpreview.cpp
375,21 → 375,20
if (hg->ch == QChar(5))
hg->ch = QChar(13);
it++;
hg->cfont = prefsManager->appPrefs.AvailFonts[*it];
hg->setFont(prefsManager->appPrefs.AvailFonts[*it]);
it++;
hg->csize = qRound((*it).toDouble() * 10.0);
hg->setFontSize(qRound((*it).toDouble() * 10.0));
it++;
hg->ccolor = *it;
hg->setFillColor(*it);
it++;
hg->cextra = (*it).toInt();
hg->setTracking((*it).toInt());
it++;
hg->cshade = (*it).toInt();
hg->cselect = false;
hg->setFillShade((*it).toInt());
it++;
if (it == NULL)
hg->cstyle = ScStyle_Default;
hg->setEffects(ScStyle_Default);
else
hg->cstyle = static_cast<StyleFlag>((*it).toInt());
hg->setEffects(static_cast<StyleFlag>((*it).toInt()));
it++;
if (it == NULL)
hg->cab = 0;
397,24 → 396,20
hg->cab = (*it).toInt();
it++;
if (it == NULL)
hg->cstroke = CommonStrings::None;
hg->setStrokeColor(CommonStrings::None);
else
hg->cstroke = *it;
hg->setStrokeColor(*it);
it++;
if (it == NULL)
hg->cshade2 = 100;
hg->setStrokeShade(100);
else
hg->cshade2 = (*it).toInt();
hg->setStrokeShade((*it).toInt());
it++;
if (it == NULL)
hg->cscale = 100;
hg->setScaleH(100);
else
hg->cscale = (*it).toInt();
hg->xp = 0;
hg->yp = 0;
hg->PRot = 0;
hg->PtransX = 0;
hg->PtransY = 0;
hg->setScaleH((*it).toInt());
 
Ptexti.append(hg);
}
#endif
424,8 → 419,8
for (uint ct=0; ct<GetAttr(&pg, "NUMTEXT","0").toUInt(); ct++)
{
#ifndef NLS_PROTO
ft >> Ptexti.at(ct)->xp;
ft >> Ptexti.at(ct)->yp;
ft >> Ptexti.at(ct)->glyph.xoffset;
ft >> Ptexti.at(ct)->glyph.yoffset;
#endif
}
tmpx = "";
596,38 → 591,38
if (hl->ch == QChar(13))
continue;
chx = hl->ch;
chs = hl->csize;
chs = hl->fontSize();
if (chs < 10)
continue;
if (hl->cstyle != 0)
if (hl->effects() != ScStyle_Default)
{
if (hl->cstyle & 1)
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.scalingSuperScript / 100);
if (hl->cstyle & 2)
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.scalingSubScript / 100);
if (hl->cstyle & 64)
if (hl->effects() & 1)
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.scalingSuperScript / 100);
if (hl->effects() & 2)
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.scalingSubScript / 100);
if (hl->effects() & 64)
{
if (chx.upper() != chx)
{
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.valueSmallCaps / 100);
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.valueSmallCaps / 100);
chx = chx.upper();
}
}
}
mode = 0;
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(&tmpfa, hl->ccolor, hl->cshade);
SetFarbe(&tmpfa, hl->fillColor(), hl->fillShade());
pS->setBrush(tmpfa);
mode = 2;
}
if (hl->cstroke != CommonStrings::None)
if (hl->strokeColor() != CommonStrings::None)
{
SetFarbe(&tmpfa, hl->cstroke, hl->cshade2);
SetFarbe(&tmpfa, hl->strokeColor(), hl->strokeShade());
pS->setPen(tmpfa, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
mode += 1;
}
DrawZeichenS(pS, hl->xp, hl->yp, chx, hl->cfont->scName(), OB.Reverse, hl->cstyle, mode, chs);
DrawZeichenS(pS, hl->glyph.xoffset, hl->glyph.yoffset, chx, hl->font()->scName(), OB.Reverse, hl->effects(), mode, chs);
}
pS->restore();
}
801,7 → 796,7
cl = FlattenPath(OB.PoLine, Segments);
CurX = OB.Extra;
if (Ptexti.count() != 0)
CurX += Ptexti.at(0)->csize * Ptexti.at(0)->cextra / 10000.0;
CurX += Ptexti.at(0)->fontSize() * Ptexti.at(0)->tracking() / 10000.0;
zae = 0;
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2.0)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2.0));
while (wid < 1)
819,37 → 814,37
chx = hl->ch;
if ((chx == QChar(30)) || (chx == QChar(13)))
continue;
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(&tmpfa, hl->ccolor, hl->cshade);
SetFarbe(&tmpfa, hl->fillColor(), hl->fillShade());
pS->setPen(tmpfa);
}
chs = hl->csize;
asce = prefsManager->appPrefs.AvailFonts[hl->cfont->scName()]->ascent() * (hl->csize / 10.0);
int chst = hl->cstyle & 127;
chs = hl->fontSize();
asce = prefsManager->appPrefs.AvailFonts[hl->font()->scName()]->ascent() * (hl->fontSize() / 10.0);
int chst = hl->effects() & 127;
if (chst != 0)
{
if (chst & 1)
{
CurY -= asce * prefsManager->appPrefs.typographicSettings.valueSuperScript / 100;
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.scalingSuperScript / 100);
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.scalingSuperScript / 100);
}
if (chst & 2)
{
CurY += asce * prefsManager->appPrefs.typographicSettings.valueSubScript / 100;
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.scalingSubScript / 100);
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.scalingSubScript / 100);
}
if (chst & 64)
{
if (chx.upper() != chx)
{
chs = static_cast<int>(hl->csize * prefsManager->appPrefs.typographicSettings.valueSmallCaps / 100);
chs = static_cast<int>(hl->fontSize() * prefsManager->appPrefs.typographicSettings.valueSmallCaps / 100);
chx = chx.upper();
}
}
}
wide = prefsManager->appPrefs.AvailFonts[hl->cfont->scName()]->charWidth(chx[0])*(chs / 10.0);
if ((CurX+(wide+chs * hl->cextra / 10000.0)/2) >= wid)
wide = prefsManager->appPrefs.AvailFonts[hl->font()->scName()]->charWidth(chx[0])*(chs / 10.0);
if ((CurX+(wide+chs * hl->tracking() / 10000.0)/2) >= wid)
{
if (zae < cl.size()-1)
{
878,9 → 873,9
pS->save();
pS->translate(cl.point(zae).x(), cl.point(zae).y());
pS->rotate(rota);
DrawZeichenS(pS, CurX+chs * hl->cextra / 10000.0, CurY+OB.BaseOffs, chx, hl->cfont->scName(), OB.Reverse, hl->cstyle, 2, chs);
DrawZeichenS(pS, CurX+chs * hl->tracking() / 10000.0, CurY+OB.BaseOffs, chx, hl->font()->scName(), OB.Reverse, hl->effects(), 2, chs);
pS->restore();
CurX += wide+chs * hl->cextra / 10000.0;
CurX += wide+chs * hl->tracking() / 10000.0;
}
#endif
PfadEnd: break;
/branches/Version13x/Scribus/scribus/pslib.cpp
1925,70 → 1925,70
hl = c->itemText.at(d);
if ((hl->ch == QChar(13)) || (hl->ch == QChar(30)) || (hl->ch == QChar(9)) || (hl->ch == QChar(28)))
continue;
tsz = hl->csize;
tsz = hl->fontSize();
chx = hl->ch;
if (hl->ch == QChar(29))
chx = " ";
if (hl->ch == QChar(0xA0))
chx = " ";
if (hl->cstyle & 32)
if (hl->effects() & 32)
{
if (chx.upper() != chx)
chx = chx.upper();
}
if (hl->cstyle & 64)
if (hl->effects() & 64)
{
if (chx.upper() != chx)
{
tsz = hl->csize * Doc->typographicSettings.valueSmallCaps / 100;
tsz = hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100;
chx = chx.upper();
}
}
if (hl->cstyle & 1)
tsz = hl->csize * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->cstyle & 2)
tsz = hl->csize * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->ccolor != CommonStrings::None)
if (hl->effects() & 1)
tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->effects() & 2)
tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
/* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
Foi::FontType type = hl->cfont->type();
if ((type == Foi::TTF) || (hl->cfont->isOTF()) || (hl->cfont->subset()))
Foi::FontType type = hl->font()->type();
if ((type == Foi::TTF) || (hl->font()->isOTF()) || (hl->font()->subset()))
{
uint chr = chx[0].unicode();
if ((hl->cfont->canRender(chx[0])) && (chr != 32))
if ((hl->font()->canRender(chx[0])) && (chr != 32))
{
PS_save();
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
PutSeite("["+ToStr(1) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(-1) + " " + ToStr(-hl->PRot) + " " + ToStr(0) + "]\n");
PutSeite("["+ToStr(hl->PtransX) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransX) + " " + ToStr(hl->xp) + " " + ToStr(-hl->yp) + "]\n");
PutSeite("["+ToStr(hl->PtransX) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransX) + " " + ToStr(hl->glyph.xoffset) + " " + ToStr(-hl->glyph.yoffset) + "]\n");
PutSeite("["+ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + "] concatmatrix\nconcat\n");
PS_translate(0, (tsz / 10.0));
if (c->BaseOffs != 0)
PS_translate(0, -c->BaseOffs);
if (hl->cscale != 1000)
PS_scale(hl->cscale / 1000.0, 1);
if ((colorsToUse[hl->ccolor].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->cshade / 100.0)+" "+spotMap[hl->ccolor]);
if (hl->scaleH() != 1000)
PS_scale(hl->scaleH() / 1000.0, 1);
if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
else
PutSeite(FillColor + " cmyk");
PS_showSub(chr, hl->cfont->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
if ((hl->cstroke != CommonStrings::None) && ((tsz * hl->coutline / 10000.0) != 0))
PS_showSub(chr, hl->font()->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
if ((hl->strokeColor() != CommonStrings::None) && ((tsz * hl->outlineWidth() / 10000.0) != 0))
{
PS_save();
PS_setlinewidth(tsz * hl->coutline / 10000.0);
SetFarbe(hl->cstroke, hl->cshade2, &h, &s, &v, &k, gcr);
PS_setlinewidth(tsz * hl->outlineWidth() / 10000.0);
SetFarbe(hl->strokeColor(), hl->strokeShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
if ((colorsToUse[hl->cstroke].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->cshade2 / 100.0)+" "+spotMap[hl->cstroke]);
if ((colorsToUse[hl->strokeColor()].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->strokeShade() / 100.0)+" "+spotMap[hl->strokeColor()]);
else
PutSeite(StrokeColor + " cmyk");
PS_showSub(chr, hl->cfont->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, true);
PS_showSub(chr, hl->font()->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, true);
PS_restore();
}
}
1997,34 → 1997,34
}
else
{
PS_selectfont(hl->cfont->scName(), tsz / 10.0);
PS_selectfont(hl->font()->scName(), tsz / 10.0);
PS_save();
PutSeite("["+ToStr(1) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(-1) + " " + ToStr(-hl->PRot) + " " + ToStr(0) + "]\n");
PutSeite("["+ToStr(hl->PtransX) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransX) + " " + ToStr(hl->xp) + " " + ToStr(-hl->yp) + "]\n");
PutSeite("["+ToStr(hl->PtransX) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransY) + " " + ToStr(-hl->PtransX) + " " + ToStr(hl->glyph.xoffset) + " " + ToStr(-hl->glyph.yoffset) + "]\n");
PutSeite("["+ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + " " + ToStr(0) + "] concatmatrix\nconcat\n");
if (c->BaseOffs != 0)
PS_translate(0, -c->BaseOffs);
if ((colorsToUse[hl->ccolor].isSpotColor()) && (!DoSep))
if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
{
PutSeite(ToStr(hl->cshade / 100.0)+" "+spotMap[hl->ccolor]);
PS_show_xyG(hl->cfont->scName(), chx, 0, 0, true);
PutSeite(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
PS_show_xyG(hl->font()->scName(), chx, 0, 0, true);
}
else
PS_show_xyG(hl->cfont->scName(), chx, 0, 0, false);
if ((hl->cstroke != CommonStrings::None) && ((tsz * hl->coutline / 10000.0) != 0))
PS_show_xyG(hl->font()->scName(), chx, 0, 0, false);
if ((hl->strokeColor() != CommonStrings::None) && ((tsz * hl->outlineWidth() / 10000.0) != 0))
{
FPointArray gly = hl->cfont->outline(chx[0]);
FPointArray gly = hl->font()->outline(chx[0]);
QWMatrix chma;
chma.scale(tsz / 100.0, tsz / 100.0);
gly.map(chma);
PS_save();
PS_setlinewidth(tsz * hl->coutline / 10000.0);
PS_setlinewidth(tsz * hl->outlineWidth() / 10000.0);
PS_translate(0, tsz / 10.0);
SetFarbe(hl->cstroke, hl->cshade2, &h, &s, &v, &k, gcr);
SetFarbe(hl->strokeColor(), hl->strokeShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetClipPath(&gly);
PS_closepath();
putColor(hl->cstroke, hl->cshade2, false);
putColor(hl->strokeColor(), hl->strokeShade(), false);
PS_restore();
}
PS_restore();
2294,15 → 2294,15
hl = ite->itemText.at(d);
if ((hl->ch == QChar(13)) || (hl->ch == QChar(10)) || (hl->ch == QChar(28)) || (hl->ch == QChar(27)) || (hl->ch == QChar(26)))
continue;
if (hl->cstyle & 4096)
if (hl->effects() & 4096)
continue;
if (hl->yp == 0)
if (hl->glyph.yoffset == 0)
continue;
if (hl->cab < 5)
tTabValues = ite->TabValues;
else
tTabValues = Doc->docParagraphStyles[hl->cab].tabValues();
if (hl->cstyle & 16384)
if (hl->effects() & 16384)
tabCc = 0;
if ((hl->ch == QChar(9)) && (tTabValues.count() != 0))
{
2309,54 → 2309,30
if ((!tTabValues[tabCc].tabFillChar.isNull()) && (tabCc < tTabValues.count()))
{
ScText hl2;
double wt = Cwidth(Doc, hl->cfont, QString(tTabValues[tabCc].tabFillChar), hl->csize);
int coun = static_cast<int>((hl->xp - tabDist) / wt);
double sPos = hl->xp - (hl->xp - tabDist) + 1;
double wt = Cwidth(Doc, hl->font(), QString(tTabValues[tabCc].tabFillChar), hl->fontSize());
int coun = static_cast<int>((hl->glyph.xoffset - tabDist) / wt);
double sPos = hl->glyph.xoffset - (hl->glyph.xoffset - tabDist) + 1;
hl2.ch = QString(tTabValues[tabCc].tabFillChar);
hl2.ccolor = hl->ccolor;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade;
hl2.cshade2 = hl->cshade2;
hl2.yp = hl->yp;
hl2.csize = hl->csize;
hl2.cstyle = hl->cstyle;
hl2.cfont = hl->cfont;
hl2.cextra = 0;
hl2.cscale = 1000;
hl2.cscalev = 1000;
hl2.cbase = hl->cbase;
hl2.cshadowx = hl->cshadowx;
hl2.cshadowy = hl->cshadowy;
hl2.coutline = hl->coutline;
hl2.cunderpos = hl->cunderpos;
hl2.cunderwidth = hl->cunderwidth;
hl2.cstrikepos = hl->cstrikepos;
hl2.cstrikewidth = hl->cstrikewidth;
static_cast<CharStyle&>(hl2) = static_cast<const CharStyle&>(*hl);
 
hl2.glyph.yoffset = hl->glyph.yoffset;
 
hl2.setTracking(0);
hl2.setScaleH(1000);
hl2.setScaleV(1000);
 
for (int cx = 0; cx < coun; ++cx)
{
hl2.xp = sPos + wt * cx;
if ((hl2.cstyle & 256) && (hl2.cstroke != CommonStrings::None))
hl2.glyph.xoffset = sPos + wt * cx;
if ((hl2.effects() & 256) && (hl2.strokeColor() != CommonStrings::None))
{
ScText hl3;
static_cast<CharStyle&>(hl3) = static_cast<const CharStyle&>(hl2);
hl3.ch = hl2.ch;
hl3.ccolor = hl2.cstroke;
hl3.cstroke = hl2.cstroke;
hl3.cshade = hl2.cshade2;
hl3.cshade2 = hl2.cshade2;
hl3.yp = hl2.yp - (hl2.csize * hl2.cshadowy / 10000.0);
hl3.xp = hl2.xp + (hl2.csize * hl2.cshadowx / 10000.0);
hl3.csize = hl2.csize;
hl3.cstyle = hl2.cstyle;
hl3.cfont = hl2.cfont;
hl3.cscale = hl2.cscale;
hl3.cscalev = hl2.cscalev;
hl3.cextra = hl2.cextra;
hl3.cbase = hl2.cbase;
hl3.coutline = hl2.coutline;
hl3.cunderpos = hl2.cunderpos;
hl3.cunderwidth = hl2.cunderwidth;
hl3.cstrikepos = hl2.cstrikepos;
hl3.cstrikewidth = hl2.cstrikewidth;
 
hl3.glyph.yoffset = hl2.glyph.yoffset - (hl2.fontSize() * hl2.shadowYOffset() / 10000.0);
hl3.glyph.xoffset = hl2.glyph.xoffset + (hl2.fontSize() * hl2.shadowXOffset() / 10000.0);
 
setTextCh(Doc, ite, gcr, a, d, &hl3, pg, sep, farb, ic, master);
}
setTextCh(Doc, ite, gcr, a, d, &hl2, pg, sep, farb, ic, master);
2372,34 → 2348,19
}
if (hl->ch == QChar(9))
continue;
if ((hl->cstyle & 256) && (hl->cstroke != CommonStrings::None))
if ((hl->effects() & 256) && (hl->strokeColor() != CommonStrings::None))
{
ScText hl2;
hl2.ch = hl->ch;
hl2.ccolor = hl->cstroke;
hl2.cstroke = hl->cstroke;
hl2.cshade = hl->cshade2;
hl2.cshade2 = hl->cshade2;
hl2.yp = hl->yp - (hl->csize * hl->cshadowy / 10000.0);
hl2.xp = hl->xp + (hl->csize * hl->cshadowx / 10000.0);
hl2.csize = hl->csize;
hl2.cstyle = hl->cstyle;
hl2.cfont = hl->cfont;
hl2.cscale = hl->cscale;
hl2.cscalev = hl->cscalev;
hl2.cextra = hl->cextra;
hl2.cbase = hl->cbase;
hl2.cshadowx = hl->cshadowx;
hl2.cshadowy = hl->cshadowy;
hl2.coutline = hl->coutline;
hl2.cunderpos = hl->cunderpos;
hl2.cunderwidth = hl->cunderwidth;
hl2.cstrikepos = hl->cstrikepos;
hl2.cstrikewidth = hl->cstrikewidth;
static_cast<CharStyle&>(hl2) = static_cast<const CharStyle&>(*hl);
 
hl2.glyph.yoffset = hl->glyph.yoffset - (hl->fontSize() * hl->shadowYOffset() / 10000.0);
hl2.glyph.xoffset = hl->glyph.xoffset + (hl->fontSize() * hl->shadowXOffset() / 10000.0);
 
setTextCh(Doc, ite, gcr, a, d, &hl2, pg, sep, farb, ic, master);
}
setTextCh(Doc, ite, gcr, a, d, hl, pg, sep, farb, ic, master);
tabDist = hl->xp + Cwidth(Doc, hl->cfont, hl->ch, hl->csize) * (hl->cscale / 1000.0);
tabDist = hl->glyph.xoffset + Cwidth(Doc, hl->font(), hl->ch, hl->fontSize()) * (hl->scaleH() / 1000.0);
}
#endif
}
2413,19 → 2374,19
QValueList<double> dum;
dum.clear();
chx = hl->ch;
tsz = hl->csize;
if (hl->cstyle & 2048)
tsz = hl->fontSize();
if (hl->effects() & 2048)
{
if (Doc->docParagraphStyles[hl->cab].useBaselineGrid())
tsz = qRound(10 * ((Doc->typographicSettings.valueBaseGrid * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
tsz = qRound(10 * ((Doc->typographicSettings.valueBaseGrid * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(Doc, hl->font(), chx, 10))));
else
{
if (Doc->docParagraphStyles[hl->cab].lineSpacingMode() == ParagraphStyle::FixedLineSpacing)
tsz = qRound(10 * ((Doc->docParagraphStyles[hl->cab].lineSpacing() * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(Doc, hl->cfont, chx, 10))));
tsz = qRound(10 * ((Doc->docParagraphStyles[hl->cab].lineSpacing() * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / (RealCHeight(Doc, hl->font(), chx, 10))));
else
{
double currasce = RealFHeight(Doc, hl->cfont, Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
tsz = qRound(10 * ((currasce * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->cfont->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(Doc, hl->cfont, chx, 10)));
double currasce = RealFHeight(Doc, hl->font(), Doc->docParagraphStyles[hl->cab].charStyle().fontSize());
tsz = qRound(10 * ((currasce * (Doc->docParagraphStyles[hl->cab].dropCapLines()-1)+(hl->font()->ascent() * (Doc->docParagraphStyles[hl->cab].charStyle().fontSize() / 10.0))) / RealCHeight(Doc, hl->font(), chx, 10)));
}
}
}
2455,13 → 2416,13
{
PageItem* embedded = emG.at(em);
PS_save();
PS_translate(hl->xp + embedded->gXpos * (hl->cscale / 1000.0), (hl->yp - (embedded->gHeight * (hl->cscalev / 1000.0)) + embedded->gYpos * (hl->cscalev / 1000.0)) * -1);
if (hl->cbase != 0)
PS_translate(0, embedded->gHeight * (hl->cbase / 1000.0));
if (hl->cscale != 1000)
PS_scale(hl->cscale / 1000.0, 1);
if (hl->cscalev != 1000)
PS_scale(1, hl->cscalev / 1000.0);
PS_translate(hl->glyph.xoffset + embedded->gXpos * (hl->scaleH() / 1000.0), (hl->glyph.yoffset - (embedded->gHeight * (hl->scaleV() / 1000.0)) + embedded->gYpos * (hl->scaleV() / 1000.0)) * -1);
if (hl->baselineOffset() != 0)
PS_translate(0, embedded->gHeight * (hl->baselineOffset() / 1000.0));
if (hl->scaleH() != 1000)
PS_scale(hl->scaleH() / 1000.0, 1);
if (hl->scaleV() != 1000)
PS_scale(1, hl->scaleV() / 1000.0);
ProcessItem(Doc, pg, embedded, a, sep, farb, ic, gcr, master, true);
PS_restore();
}
2505,34 → 2466,34
chx = out2.mid(d-za2, 1);
}
}
if (hl->cstyle & 32)
if (hl->effects() & 32)
{
if (chx.upper() != chx)
chx = chx.upper();
}
if (hl->cstyle & 64)
if (hl->effects() & 64)
{
if (chx.upper() != chx)
{
tsz = hl->csize * Doc->typographicSettings.valueSmallCaps / 100;
tsz = hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100;
chx = chx.upper();
}
}
if (hl->cstyle & 1)
tsz = hl->csize * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->cstyle & 2)
tsz = hl->csize * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->effects() & 1)
tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
if (hl->effects() & 2)
tsz = hl->fontSize() * Doc->typographicSettings.scalingSuperScript / 100;
/* Subset all TTF Fonts until the bug in the TTF-Embedding Code is fixed */
Foi::FontType ftype = hl->cfont->type();
if ((ftype == Foi::TTF) || (hl->cfont->isOTF()) || (hl->cfont->subset()))
Foi::FontType ftype = hl->font()->type();
if ((ftype == Foi::TTF) || (hl->font()->isOTF()) || (hl->font()->subset()))
{
uint chr = chx[0].unicode();
if ((hl->cfont->canRender(chx[0])) && (chr != 32))
if ((hl->font()->canRender(chx[0])) && (chr != 32))
{
PS_save();
if (ite->reversed())
{
PS_translate(hl->xp, (hl->yp - (tsz / 10.0)) * -1);
PS_translate(hl->glyph.xoffset, (hl->glyph.yoffset - (tsz / 10.0)) * -1);
PS_scale(-1, 1);
if (ite->frameDisplays(d+1))
{
2541,32 → 2502,32
ctx = " ";
if (ctx == QChar(0xA0))
ctx = " ";
wideR = -Cwidth(Doc, hl->cfont, chx, tsz, ctx) * (hl->cscale / 1000.0);
wideR = -Cwidth(Doc, hl->font(), chx, tsz, ctx) * (hl->scaleH() / 1000.0);
}
else
wideR = -Cwidth(Doc, hl->cfont, chx, tsz) * (hl->cscale / 1000.0);
wideR = -Cwidth(Doc, hl->font(), chx, tsz) * (hl->scaleH() / 1000.0);
PS_translate(wideR, 0);
}
else
PS_translate(hl->xp, (hl->yp - (tsz / 10.0)) * -1);
if (hl->cbase != 0)
PS_translate(0, (hl->csize / 10.0) * (hl->cbase / 1000.0));
if (hl->cscale != 100)
PS_scale(hl->cscale / 1000.0, 1);
if (hl->cscalev != 100)
PS_translate(hl->glyph.xoffset, (hl->glyph.yoffset - (tsz / 10.0)) * -1);
if (hl->baselineOffset() != 0)
PS_translate(0, (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
if (hl->scaleH() != 100)
PS_scale(hl->scaleH() / 1000.0, 1);
if (hl->scaleV() != 100)
{
PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->cscalev / 1000.0)));
PS_scale(1, hl->cscalev / 1000.0);
PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->scaleV() / 1000.0)));
PS_scale(1, hl->scaleV() / 1000.0);
}
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
if ((colorsToUse[hl->ccolor].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->cshade / 100.0)+" "+spotMap[hl->ccolor]);
if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
PutSeite(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
else
PutSeite(FillColor + " cmyk");
PS_showSub(chr, hl->cfont->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
PS_showSub(chr, hl->font()->RealName().simplifyWhiteSpace().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ), tsz / 10.0, false);
}
PS_restore();
}
2573,12 → 2534,12
}
else
{
PS_selectfont(hl->cfont->scName(), tsz / 10.0);
PS_selectfont(hl->font()->scName(), tsz / 10.0);
PS_save();
PS_translate(hl->xp, -hl->yp);
PS_translate(hl->glyph.xoffset, -hl->glyph.yoffset);
if (ite->reversed())
{
int chs = hl->csize;
int chs = hl->fontSize();
ite->SetZeichAttr(*hl, &chs, &chx);
PS_scale(-1, 1);
if (ite->frameDisplays(d+1))
2588,45 → 2549,45
ctx = " ";
if (ctx == QChar(0xA0))
ctx = " ";
wideR = -Cwidth(Doc, hl->cfont, chx, chs, ctx) * (hl->cscale / 1000.0);
wideR = -Cwidth(Doc, hl->font(), chx, chs, ctx) * (hl->scaleH() / 1000.0);
PS_translate(wideR, 0);
}
else
{
wideR = -Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 1000.0);
wideR = -Cwidth(Doc, hl->font(), chx, chs) * (hl->scaleH() / 1000.0);
PS_translate(wideR, 0);
}
}
if (hl->cbase != 0)
PS_translate(0, (hl->csize / 10.0) * (hl->cbase / 1000.0));
if (hl->cscale != 1000)
PS_scale(hl->cscale / 1000.0, 1);
if (hl->cscalev != 1000)
PS_scale(1, hl->cscalev / 1000.0);
if (hl->ccolor != CommonStrings::None)
if (hl->baselineOffset() != 0)
PS_translate(0, (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
if (hl->scaleH() != 1000)
PS_scale(hl->scaleH() / 1000.0, 1);
if (hl->scaleV() != 1000)
PS_scale(1, hl->scaleV() / 1000.0);
if (hl->fillColor() != CommonStrings::None)
{
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
if ((colorsToUse[hl->ccolor].isSpotColor()) && (!DoSep))
if ((colorsToUse[hl->fillColor()].isSpotColor()) && (!DoSep))
{
PutSeite(ToStr(hl->cshade / 100.0)+" "+spotMap[hl->ccolor]);
PS_show_xyG(hl->cfont->scName(), chx, 0, 0, true);
PutSeite(ToStr(hl->fillShade() / 100.0)+" "+spotMap[hl->fillColor()]);
PS_show_xyG(hl->font()->scName(), chx, 0, 0, true);
}
else
PS_show_xyG(hl->cfont->scName(), chx, 0, 0, false);
PS_show_xyG(hl->font()->scName(), chx, 0, 0, false);
}
PS_restore();
}
if ((hl->cstyle & 4) && (chx != QChar(13)))
if ((hl->effects() & 4) && (chx != QChar(13)))
{
if (hl->cfont->canRender(chx[0]))
if (hl->font()->canRender(chx[0]))
{
FPointArray gly = hl->cfont->outline(chx[0]);
FPointArray gly = hl->font()->outline(chx[0]);
QWMatrix chma, chma2, chma3;
chma.scale(tsz / 100.0, tsz / 100.0);
chma2.scale(hl->cscale / 1000.0, hl->cscalev / 1000.0);
if (hl->cbase != 0)
chma3.translate(0, -(hl->csize / 10.0) * (hl->cbase / 1000.0));
chma2.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
if (hl->baselineOffset() != 0)
chma3.translate(0, -(hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0));
gly.map(chma * chma2 * chma3);
if (ite->reversed())
{
2635,125 → 2596,125
chma.translate(wideR, 0);
gly.map(chma);
}
if ((hl->cstroke != CommonStrings::None) && ((tsz * hl->coutline / 10000.0) != 0))
if ((hl->strokeColor() != CommonStrings::None) && ((tsz * hl->outlineWidth() / 10000.0) != 0))
{
PS_save();
PS_setlinewidth(tsz * hl->coutline / 10000.0);
PS_setlinewidth(tsz * hl->outlineWidth() / 10000.0);
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
PS_setdash(Qt::SolidLine, 0, dum);
PS_translate(hl->xp, (hl->yp - (tsz / 10.0)) * -1);
if (hl->cscalev != 1000)
PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->cscalev / 1000.0)));
SetFarbe(hl->cstroke, hl->cshade2, &h, &s, &v, &k, gcr);
PS_translate(hl->glyph.xoffset, (hl->glyph.yoffset - (tsz / 10.0)) * -1);
if (hl->scaleV() != 1000)
PS_translate(0, -((tsz / 10.0) - (tsz / 10.0) * (hl->scaleV() / 1000.0)));
SetFarbe(hl->strokeColor(), hl->strokeShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetClipPath(&gly);
PS_closepath();
putColor(hl->cstroke, hl->cshade2, false);
putColor(hl->strokeColor(), hl->strokeShade(), false);
PS_restore();
}
}
}
if ((hl->cstyle & 16) && (chx != QChar(13)))
if ((hl->effects() & 16) && (chx != QChar(13)))
{
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
double Ulen = Cwidth(Doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
double Upos, lw, kern;
if (hl->cstyle & 16384)
if (hl->effects() & 16384)
kern = 0;
else
kern = hl->csize * hl->cextra / 10000.0;
if ((hl->cstrikepos != -1) || (hl->cstrikewidth != -1))
kern = hl->fontSize() * hl->tracking() / 10000.0;
if ((hl->strikethruOffset() != -1) || (hl->strikethruWidth() != -1))
{
if (hl->cstrikepos != -1)
Upos = (hl->cstrikepos / 1000.0) * (hl->cfont->ascent() * (hl->csize / 10.0));
if (hl->strikethruOffset() != -1)
Upos = (hl->strikethruOffset() / 1000.0) * (hl->font()->ascent() * (hl->fontSize() / 10.0));
else
Upos = hl->cfont->strikeoutPos() * (hl->csize / 10.0);
if (hl->cstrikewidth != -1)
lw = (hl->cstrikewidth / 1000.0) * (hl->csize / 10.0);
Upos = hl->font()->strikeoutPos() * (hl->fontSize() / 10.0);
if (hl->strikethruWidth() != -1)
lw = (hl->strikethruWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
lw = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
lw = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->cfont->strikeoutPos() * (hl->csize / 10.0);
lw = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Upos = hl->font()->strikeoutPos() * (hl->fontSize() / 10.0);
lw = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
if (hl->cbase != 0)
Upos += (hl->csize / 10.0) * (hl->cbase / 1000.0);
if (hl->ccolor != CommonStrings::None)
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
if (hl->fillColor() != CommonStrings::None)
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
PS_setdash(Qt::SolidLine, 0, dum);
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_setlinewidth(lw);
PS_moveto(hl->xp-kern, -hl->yp+Upos);
PS_lineto(hl->xp+Ulen, -hl->yp+Upos);
putColor(hl->ccolor, hl->cshade, false);
PS_moveto(hl->glyph.xoffset-kern, -hl->glyph.yoffset+Upos);
PS_lineto(hl->glyph.xoffset+Ulen, -hl->glyph.yoffset+Upos);
putColor(hl->fillColor(), hl->fillShade(), false);
}
if (((hl->cstyle & 8) && (chx != QChar(13))) || ((hl->cstyle & 512) && (!chx[0].isSpace())))
if (((hl->effects() & 8) && (chx != QChar(13))) || ((hl->effects() & 512) && (!chx[0].isSpace())))
{
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 1000.0);
double Ulen = Cwidth(Doc, hl->font(), chx, hl->fontSize()) * (hl->scaleH() / 1000.0);
double Upos, lw, kern;
if (hl->cstyle & 16384)
if (hl->effects() & 16384)
kern = 0;
else
kern = hl->csize * hl->cextra / 10000.0;
if ((hl->cunderpos != -1) || (hl->cunderwidth != -1))
kern = hl->fontSize() * hl->tracking() / 10000.0;
if ((hl->underlineOffset() != -1) || (hl->underlineWidth() != -1))
{
if (hl->cunderpos != -1)
Upos = (hl->cunderpos / 1000.0) * (hl->cfont->descent() * (hl->csize / 10.0));
if (hl->underlineOffset() != -1)
Upos = (hl->underlineOffset() / 1000.0) * (hl->font()->descent() * (hl->fontSize() / 10.0));
else
Upos = hl->cfont->underlinePos() * (hl->csize / 10.0);
if (hl->cunderwidth != -1)
lw = (hl->cunderwidth / 1000.0) * (hl->csize / 10.0);
Upos = hl->font()->underlinePos() * (hl->fontSize() / 10.0);
if (hl->underlineWidth() != -1)
lw = (hl->underlineWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
lw = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
lw = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->cfont->underlinePos() * (hl->csize / 10.0);
lw = QMAX(hl->cfont->strokeWidth() * (hl->csize / 10.0), 1);
Upos = hl->font()->underlinePos() * (hl->fontSize() / 10.0);
lw = QMAX(hl->font()->strokeWidth() * (hl->fontSize() / 10.0), 1);
}
if (hl->cbase != 0)
Upos += (hl->csize / 10.0) * (hl->cbase / 1000.0);
if (hl->ccolor != CommonStrings::None)
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
if (hl->fillColor() != CommonStrings::None)
{
PS_setcapjoin(Qt::FlatCap, Qt::MiterJoin);
PS_setdash(Qt::SolidLine, 0, dum);
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
PS_setlinewidth(lw);
PS_moveto(hl->xp-kern, -hl->yp+Upos);
PS_lineto(hl->xp+Ulen, -hl->yp+Upos);
putColor(hl->ccolor, hl->cshade, false);
PS_moveto(hl->glyph.xoffset-kern, -hl->glyph.yoffset+Upos);
PS_lineto(hl->glyph.xoffset+Ulen, -hl->glyph.yoffset+Upos);
putColor(hl->fillColor(), hl->fillShade(), false);
}
if (hl->cstyle & 8192)
if (hl->effects() & 8192)
{
int chs = hl->csize;
int chs = hl->fontSize();
ite->SetZeichAttr(*hl, &chs, &chx);
double wide = Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 1000.0);
double wide = Cwidth(Doc, hl->font(), chx, chs) * (hl->scaleH() / 1000.0);
chx = "-";
if (hl->cfont->canRender(chx[0]))
if (hl->font()->canRender(chx[0]))
{
FPointArray gly = hl->cfont->outline(chx[0]);
FPointArray gly = hl->font()->outline(chx[0]);
QWMatrix chma;
chma.scale(tsz / 100.0, tsz / 100.0);
gly.map(chma);
chma = QWMatrix();
chma.scale(hl->cscale / 1000.0, hl->cscalev / 1000.0);
chma.scale(hl->scaleH() / 1000.0, hl->scaleV() / 1000.0);
gly.map(chma);
if (hl->ccolor != CommonStrings::None)
if (hl->fillColor() != CommonStrings::None)
{
PS_save();
PS_newpath();
PS_translate(hl->xp+wide, (hl->yp - (tsz / 10.0)) * -1);
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
PS_translate(hl->glyph.xoffset+wide, (hl->glyph.yoffset - (tsz / 10.0)) * -1);
SetFarbe(hl->fillColor(), hl->fillShade(), &h, &s, &v, &k, gcr);
PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetClipPath(&gly);
PS_closepath();
putColor(hl->ccolor, hl->cshade, true);
putColor(hl->fillColor(), hl->fillShade(), true);
PS_restore();
}
}
/branches/Version13x/Scribus/scribus/desaxe/desaxe_conf.h
11,6 → 11,10
#define DESAXE_CONF_H
 
 
// disable lots of diagnostic messages
#undef DESAXE_DEBUG
 
 
// choose datatypes for element tags and attributes
#define DESAXE_QT
 
39,7 → 43,4
 
#endif
 
 
#undef DESAXE_DEBUG
 
#endif
/branches/Version13x/Scribus/scribus/colorm.cpp
606,9 → 606,9
{
for (uint d=0; d<ite->itemText.length(); ++d)
{
if (it.key() == ite->itemText.charStyle(d).ccolor)
if (it.key() == ite->itemText.charStyle(d).fillColor())
found = true;
if (it.key() == ite->itemText.charStyle(d).cstroke)
if (it.key() == ite->itemText.charStyle(d).strokeColor())
found = true;
if (found)
break;
640,9 → 640,9
{
for (uint d=0; d<ite->itemText.length(); ++d)
{
if (it.key() == ite->itemText.charStyle(d).ccolor)
if (it.key() == ite->itemText.charStyle(d).fillColor())
found = true;
if (it.key() == ite->itemText.charStyle(d).cstroke)
if (it.key() == ite->itemText.charStyle(d).strokeColor())
found = true;
if (found)
break;
678,8 → 678,8
for (uint d=0; d<ite->itemText.length(); ++d)
{
/* PFJ - 29.02.04 - Merged if's */
if ((it.key() == ite->itemText.charStyle(d).ccolor) ||
(it.key() == ite->itemText.charStyle(d).cstroke))
if ((it.key() == ite->itemText.charStyle(d).fillColor()) ||
(it.key() == ite->itemText.charStyle(d).strokeColor()))
found = true;
if (found)
break;
/branches/Version13x/Scribus/scribus/CMakeLists.txt
16,6 → 16,7
ADD_SUBDIRECTORY(swatches)
ADD_SUBDIRECTORY(templates)
ADD_SUBDIRECTORY(text)
ADD_SUBDIRECTORY(desaxe)
 
 
SET(SCRIBUS_UI_SRC
418,6 → 419,7
ENDIF(QT_WRAP_CPP)
 
LINK_DIRECTORIES(
desaxe
text
pixbuf
)
429,14 → 431,17
SET(SCRIBUS_LIBART_LIB "scribus_libart_lib")
SET(SCRIBUS_PIXBUF_LIB "scribus_pixbuf_lib")
SET(SCRIBUS_TEXT_LIB "scribus_text_lib")
SET(SCRIBUS_DESAXE_LIB "scribus_desaxe_lib")
 
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/text"
"${CMAKE_CURRENT_SOURCE_DIR}/desaxe"
)
 
LINK_LIBRARIES(
${SCRIBUS_DESAXE_LIB}
${SCRIBUS_TEXT_LIB}
${SCRIBUS_PIXBUF_LIB}
)
451,6 → 456,7
${SCRIBUS_SOURCES}
${SCRIBUS_UI_CPP}
${SCRIBUS_TEXT_SOURCES}
${SCRIBUS_DESAXE_SOURCES}
)
 
INSTALL(TARGETS ${EXE_NAME}