Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3543 → Rev 3544

/branches/Version13x/Scribus/scribus/fileloader.cpp
202,8 → 202,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
216,8 → 216,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
230,8 → 230,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
245,9 → 245,9
{
if (!app->doc->UsedFonts.contains(itfsu.data()))
{
QFont fo = prefsManager->appPrefs.AvailFonts[itfsu.data()]->Font;
fo.setPointSize(qRound(app->doc->toolSettings.defSize / 10.0));
app->doc->AddFont(itfsu.data(), fo);
// QFont fo = prefsManager->appPrefs.AvailFonts[itfsu.data()]->Font;
// fo.setPointSize(qRound(app->doc->toolSettings.defSize / 10.0));
app->doc->AddFont(itfsu.data(), qRound(app->doc->toolSettings.defSize / 10.0));
}
}
if (prefsManager->appPrefs.askBeforeSubstituite)
379,8 → 379,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
393,8 → 393,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
407,8 → 407,8
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->SCName))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->SCName]];
if (!app->doc->UsedFonts.contains(it->itemText.at(e)->cfont->scName()))
it->itemText.at(e)->cfont = (*app->doc->AllFonts)[ReplacedFonts[it->itemText.at(e)->cfont->scName()]];
}
}
}
441,9 → 441,9
{
if (!app->doc->UsedFonts.contains(itfsu.data()))
{
QFont fo = prefsManager->appPrefs.AvailFonts[itfsu.data()]->Font;
fo.setPointSize(qRound(app->doc->toolSettings.defSize / 10.0));
app->doc->AddFont(itfsu.data(), fo);
// QFont fo = prefsManager->appPrefs.AvailFonts[itfsu.data()]->Font;
// fo.setPointSize(qRound(app->doc->toolSettings.defSize / 10.0));
app->doc->AddFont(itfsu.data(), qRound(app->doc->toolSettings.defSize / 10.0));
}
}
if (prefsManager->appPrefs.askBeforeSubstituite)
716,9 → 716,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
Neu->IFont = tmpf;
934,9 → 934,9
}
else
{
QFont fo = avail[Defont]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(Defont, fo);
// QFont fo = avail[Defont]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(Defont, qRound(doc->toolSettings.defSize / 10.0));
}
doc->toolSettings.defFont = Defont;
doc->toolSettings.dCols=QStoInt(dc.attribute("DCOL", "1"));
1186,9 → 1186,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
vg.Font = tmpf;
1587,9 → 1587,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
Neu->IFont = tmpf;
1765,7 → 1765,7
bool isThere = false;
for (uint dl = 0; dl < dummyFois.count(); ++dl)
{
if (dummyFois.at(dl)->SCName == tmpf)
if (dummyFois.at(dl)->scName() == tmpf)
{
isThere = true;
dummy = dummyFois.at(dl);
1774,7 → 1774,7
}
if (!isThere)
{
dummy = new Foi(tmpf, "", false);
dummy = new Foi(tmpf, "", "", "", "", 1, false);
dummyFois.append(dummy);
}
unknown = true;
1790,9 → 1790,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
int size = qRound(QStodouble(it->attribute("CSIZE")) * 10);
2330,9 → 2330,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, qRound(doc->toolSettings.defSize / 10.0));
}
}
vg->Font = tmpf;
/branches/Version13x/Scribus/scribus/pdfopts.cpp
23,7 → 23,7
#endif
extern bool CMSavail;
 
PDF_Opts::PDF_Opts( QWidget* parent, QString docFileName, QMap<QString,QFont> DocFonts, ScribusView *currView, PDFOptions *pdfOptions, QValueList<PDFPresentationData> Eff, ProfilesL *PDFXProfiles, SCFonts &AllFonts, double unitRatio, ProfilesL *printerProfiles)
PDF_Opts::PDF_Opts( QWidget* parent, QString docFileName, QMap<QString,int> DocFonts, ScribusView *currView, PDFOptions *pdfOptions, QValueList<PDFPresentationData> Eff, ProfilesL *PDFXProfiles, SCFonts &AllFonts, double unitRatio, ProfilesL *printerProfiles)
: QDialog( parent, "pdf", true, 0 )
{
setCaption( tr( "Save as PDF" ) );
/branches/Version13x/Scribus/scribus/scfonts.h
50,7 → 50,7
// handled by freetype: PFB_MAC, DFONT, HQX, MACBIN,
SFNT, TTCF, UNKNOWN_FORMAT };
Foi(QString scname, QString path, bool embedps);
Foi(QString fam, QString style, QString alt, QString psname, QString path, int face, bool embedps);
virtual ~Foi() {};
virtual QString RealName();
virtual bool EmbedFont(QString &str);
57,26 → 57,33
virtual void RawData(QByteArray & bb);
virtual bool ReadMetrics();
virtual bool GlNames(QMap<uint, QString> *GList);
private:
QString SCName;
private:
QString Datei;
public:
int faceIndex;
QString fontPath() { return faceIndex >= 0 ? QString("%1(%2)").arg(Datei).arg(faceIndex+1) : Datei; }
QString fontFilePath() { return Datei; }
QString fontFile;
int faceIndex_;
QString cached_RealName;
QString Family;
QString Effect;
QFont Font;
QString Alternative;
public:
FT_Face * ftFace();
QString scName() const { return SCName; } ;
QString fontPath() const { return faceIndex_ >= 0 ? QString("%1(%2)").arg(fontFile).arg(faceIndex_+1) : fontFile; };
QString fontFilePath() const { return fontFile; };
int faceIndex() const { return faceIndex_; };
QString family() const { return Family; } ;
QString style() const { return Effect; } ;
// QFont Font;
struct GlyphR { FPointArray Outlines;
double x;
double y;
};
// those should be private: -AV
bool EmbedPS;
bool HasMetrics;
bool isOTF;
bool Subset;
bool isStroked;
struct GlyphR { FPointArray Outlines;
double x;
double y;
};
QMap<uint,double> CharWidth;
QMap<uint,GlyphR> GlyphArray;
QMap<uint,FPointArray> RealGlyphs;
/branches/Version13x/Scribus/scribus/scfonts_ttf.h
13,8 → 13,8
class SCRIBUS_API Foi_ttf : public Foi
{
public:
Foi_ttf(QString scname, QString path, bool embedps) :
Foi(scname,path,embedps), metricsread(false)
Foi_ttf(QString fam, QString sty, QString alt, QString psname, QString path, int face, bool embedps) :
Foi(fam,sty,alt,psname,path,face,embedps), metricsread(false)
{
HasMetrics=true;
formatCode = SFNT;
/branches/Version13x/Scribus/scribus/gtaction.cpp
526,7 → 526,7
}
 
if(!ScApp->doc->UsedFonts.contains(useFont))
ScApp->doc->AddFont(useFont, prefsManager->appPrefs.AvailFonts[useFont]->Font);
ScApp->doc->AddFont(useFont);
return useFont;
}
 
/branches/Version13x/Scribus/scribus/pslib.h
35,7 → 35,7
 
class SCRIBUS_API PSLib {
public:
PSLib(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, ColorList DocColors, bool pdf = false, bool spot = true);
PSLib(bool psart, SCFonts &AllFonts, QMap<QString,int> DocFonts, ColorList DocColors, bool pdf = false, bool spot = true);
virtual ~PSLib() {};
virtual bool PS_set_file(QString fn);
virtual void PS_set_Info(QString art, QString was);
/branches/Version13x/Scribus/scribus/fmitem.cpp
22,11 → 22,12
#include <qfontmetrics.h>
#include <qapplication.h>
 
FmItem::FmItem(const QString& s, const QFont& f)
FmItem::FmItem(const QString& s, const Foi * f)
{
stringy = s;
font = f;
font.setPointSize(qApp->font().pointSize());
// font = f;
// font.setPointSize(qApp->font().pointSize());
font = qApp->font();
}
 
void FmItem::paint(QPainter *p, const QColorGroup&, bool, bool, int x, int y, int w, int h)
/branches/Version13x/Scribus/scribus/prefs.cpp
185,7 → 185,7
GroupBox200Layout->addWidget( DocumentTemplateDir, 3, 1 );
GroupBox200Layout->addWidget( FileC4, 3, 2 );
tabLayout->addWidget( GroupBox200, 1, 0 );
addItem( tr("General"), loadIcon("AppIcon.png"), tab);
addItem( tr("General"), loadIcon("scribusicon.png"), tab);
 
tab_7 = new QWidget( prefsWidgets, "tab_7" );
tabLayout_7 = new QHBoxLayout( tab_7, 0, 5, "tabLayout_7");
327,7 → 327,7
Layout21->addLayout(asurLayout);
 
tabLayout_7->addLayout( Layout21 );
addItem( tr("Document"), loadIcon("page.png"), tab_7);
addItem( tr("Document"), loadIcon("scribusdoc.png"), tab_7);
 
tabGuides = new TabGuides(prefsWidgets, &prefsData->guidesSettings, &prefsData->typographicSettings, docUnitIndex);
addItem( tr("Guides"), loadIcon("guides.png"), tabGuides);
355,7 → 355,7
tabColorManagement = new CMSPrefs(prefsWidgets, &prefsData->DCMSset, &ap->InputProfiles, &ap->InputProfilesCMYK, &ap->PrinterProfiles, &ap->MonitorProfiles);
addItem( tr("Color Management"), loadIcon("blend.png"), tabColorManagement);
}
QMap<QString,QFont> DocFonts;
QMap<QString,int> DocFonts;
DocFonts.clear();
tabPDF = new TabPDFOptions( prefsWidgets,
&prefsData->PDF_Options,
/branches/Version13x/Scribus/scribus/preview.cpp
420,7 → 420,7
{
bool ret = -1;
QString cmd1, cmd2, cmd3;
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
// Recreate Postscript-File only when the actual Page has changed
if ((Seite != APage) || (EnableGCR->isChecked() != GMode))
{
493,7 → 493,7
{
bool ret = -1;
QString cmd1, cmd2, cmd3;
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
// Recreate Postscript-File only when the actual Page has changed
if ((Seite != APage) || (EnableGCR->isChecked() != GMode))
{
/branches/Version13x/Scribus/scribus/tabpdfoptions.h
33,7 → 33,7
 
public:
TabPDFOptions( QWidget* parent, PDFOptions *Optionen, SCFonts &AllFonts,
ProfilesL *PDFXProfiles, QMap<QString,QFont> DocFonts,
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie = 0 );
~TabPDFOptions() {};
/branches/Version13x/Scribus/scribus/scfonts_ttf.cpp
18,7 → 18,7
 
QString Foi_ttf::RealName()
{
return(cached_RealName);
return(Foi::RealName());
}
 
bool Foi_ttf::ReadMetrics()
53,7 → 53,7
sDebug(QObject::tr("Font %1 is broken (FreeType), discarding it").arg(fontPath()));
return false;
}
error = FT_New_Face( library, fontFilePath(), faceIndex, &face );
error = FT_New_Face( library, fontFilePath(), faceIndex(), &face );
if (error)
{
UseFont = false;
162,7 → 162,7
QByteArray coll;
Foi::RawData(coll);
// access table for faceIndex
if (faceIndex >= static_cast<int>(word(coll, 8)))
if (faceIndex() >= static_cast<int>(word(coll, 8)))
{
bb.resize(0);
return;
169,9 → 169,9
}
static const uint OFFSET_TABLE_LEN = 12;
static const uint TDIR_ENTRY_LEN = 16;
uint faceOffset = word(coll, 12 + 4 * faceIndex);
uint faceOffset = word(coll, 12 + 4 * faceIndex());
uint nTables = word16(coll, faceOffset + 4);
sDebug(QObject::tr("extracting face %1 from font %2 (offset=%3, nTables=%4)").arg(faceIndex).arg(fontPath()).arg(faceOffset).arg(nTables));
sDebug(QObject::tr("extracting face %1 from font %2 (offset=%3, nTables=%4)").arg(faceIndex()).arg(fontPath()).arg(faceOffset).arg(nTables));
uint headerLength = OFFSET_TABLE_LEN + TDIR_ENTRY_LEN * nTables;
uint tableLengths = 0;
// sum table lengths incl padding
232,7 → 232,7
FT_ULong charcode;
FT_UInt gindex;
FT_Init_FreeType(&library);
FT_New_Face(library, fontFilePath(), faceIndex, &face);
FT_New_Face(library, fontFilePath(), faceIndex(), &face);
const FT_Stream fts = face->stream;
if (FT_Stream_Seek(fts, 0L)) {
FT_Done_FreeType( library );
/branches/Version13x/Scribus/scribus/search.cpp
419,7 → 419,7
}
if (SFont->isChecked())
{
if (Item->itemText.at(a)->cfont->SCName != sFont)
if (Item->itemText.at(a)->cfont->scName() != sFont)
found = false;
}
if (SStyle->isChecked())
/branches/Version13x/Scribus/scribus/fmitem.h
25,6 → 25,7
#include <qmenudata.h>
 
#include "scribusapi.h"
#include "scfonts.h"
 
/**
*@author Franz Schmid
33,7 → 34,7
class SCRIBUS_API FmItem : public QCustomMenuItem
{
public:
FmItem(const QString& s, const QFont& f);
FmItem(const QString& s, const Foi * f);
~FmItem() {};
void paint(QPainter *p, const QColorGroup& cg, bool act, bool enabled, int x, int y, int w, int h);
QSize sizeHint();
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp
26,7 → 26,7
 
 
TabPDFOptions::TabPDFOptions( QWidget* parent, PDFOptions *Optionen, SCFonts &AllFonts,
ProfilesL *PDFXProfiles, QMap<QString,QFont> DocFonts,
ProfilesL *PDFXProfiles, QMap<QString,int> DocFonts,
QValueList<PDFPresentationData> Eff, int unitIndex,
double PageH, double PageB, ScribusView *vie ) : QTabWidget( parent, "pdf" )
{
231,7 → 231,7
TextFont1 = new QLabel( tr( "Available Fonts:" ), GroupFont, "TextFont1" );
Layout4_2->addWidget( TextFont1 );
AvailFlist = new QListBox( GroupFont, "AvailFlist" );
QMap<QString,QFont>::Iterator it;
QMap<QString,int>::Iterator it;
for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
{
if (AllFonts[it.key()]->typeCode == Foi::TYPE1)
/branches/Version13x/Scribus/scribus/reformdoc.cpp
204,7 → 204,7
groupAutoSaveLayout->addWidget( textLabel1m );
groupAutoSaveLayout->addWidget( autoSaveTime );
reformDocLayout->addWidget( groupAutoSave );
addItem( tr("Document"), loadIcon("page.png"), tabPage);
addItem( tr("Document"), loadIcon("scribusdoc.png"), tabPage);
 
docInfos = new DocInfos(prefsWidgets, doc->documentInfo);
addItem( tr("Document Information"), loadIcon("documentinfo32.png"), docInfos);
346,7 → 346,7
addItem( tr("Display"), loadIcon("screen.png"), tabView);
 
tabTypo = new TabTypograpy( prefsWidgets, &doc->typographicSettings);
addItem( tr("Typography"), loadIcon("font.png"), tabTypo);
addItem( tr("Typography"), loadIcon("typography.png"), tabTypo);
 
tabTools = new TabTools( prefsWidgets, &doc->toolSettings, einheit, doc);
addItem( tr("Tools"), loadIcon("tools.png"), tabTools);
991,7 → 991,7
for (itfsu = tabFonts->RList.begin(); itfsu != itfsuend; ++itfsu)
prefsManager->appPrefs.GFontSub[itfsu.key()] = tabFonts->FlagsRepl.at(a++)->currentText();
QStringList uf = currDoc->UsedFonts.keys();
QMap<QString,QFont>::Iterator it3;
QMap<QString,int>::Iterator it3;
for (it3 = currDoc->UsedFonts.begin(); it3 != currDoc->UsedFonts.end(); ++it3)
FT_Done_Face(currDoc->FFonts[it3.key()]);
currDoc->UsedFonts.clear();
998,7 → 998,7
QStringList::Iterator it3a;
QStringList::Iterator it3aend=uf.end();
for (it3a = uf.begin(); it3a != it3aend; ++it3a)
currDoc->AddFont((*it3a), prefsManager->appPrefs.AvailFonts[(*it3a)]->Font);
currDoc->AddFont(*it3a);
 
currDoc->PDF_Options.Thumbnails = tabPDF->CheckBox1->isChecked();
currDoc->PDF_Options.Compress = tabPDF->Compression->isChecked();
/branches/Version13x/Scribus/scribus/collect4output.cpp
224,8 → 224,8
return false;
 
PrefsManager *prefsManager = PrefsManager::instance();
QMap<QString,QFont>::Iterator it3;
QMap<QString,QFont>::Iterator it3end = ScApp->doc->UsedFonts.end();
QMap<QString,int>::Iterator it3;
QMap<QString,int>::Iterator it3end = ScApp->doc->UsedFonts.end();
for (it3 = ScApp->doc->UsedFonts.begin(); it3 != it3end; ++it3)
{
QFileInfo itf = QFileInfo(prefsManager->appPrefs.AvailFonts[it3.key()]->fontFilePath());
/branches/Version13x/Scribus/scribus/pdflib.cpp
402,7 → 402,7
return ComputeMD5Sum(&TBytes);
}
 
bool PDFlib::PDF_Begin_Doc(QString fn, PDFOptions *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi)
bool PDFlib::PDF_Begin_Doc(QString fn, PDFOptions *opts, SCFonts &AllFonts, QMap<QString,int> DocFonts, BookMView* vi)
{
Spool.setName(fn);
if (!Spool.open(IO_WriteOnly))
533,7 → 533,7
PutDoc("/P "+IToStr(Options->Permissions)+"\n>>\nendobj\n");
}
RealFonts = DocFonts;
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
ReallyUsed.clear();
PageItem* pgit;
for (uint c = 0; c < doc->FrameItems.count(); ++c)
543,7 → 543,7
{
for (uint e = 0; e < pgit->itemText.count(); ++e)
{
ReallyUsed.insert(pgit->itemText.at(e)->cfont->SCName, DocFonts[pgit->itemText.at(e)->cfont->SCName]);
ReallyUsed.insert(pgit->itemText.at(e)->cfont->scName(), DocFonts[pgit->itemText.at(e)->cfont->scName()]);
}
}
}
554,7 → 554,7
{
for (uint e = 0; e < pgit->itemText.count(); ++e)
{
ReallyUsed.insert(pgit->itemText.at(e)->cfont->SCName, DocFonts[pgit->itemText.at(e)->cfont->SCName]);
ReallyUsed.insert(pgit->itemText.at(e)->cfont->scName(), DocFonts[pgit->itemText.at(e)->cfont->scName()]);
}
}
}
565,11 → 565,11
{
for (uint e = 0; e < pgit->itemText.count(); ++e)
{
ReallyUsed.insert(pgit->itemText.at(e)->cfont->SCName, DocFonts[pgit->itemText.at(e)->cfont->SCName]);
ReallyUsed.insert(pgit->itemText.at(e)->cfont->scName(), DocFonts[pgit->itemText.at(e)->cfont->scName()]);
}
}
}
QMap<QString,QFont>::Iterator it;
QMap<QString,int>::Iterator it;
a = 0;
for (it = ReallyUsed.begin(); it != ReallyUsed.end(); ++it)
{
743,11 → 743,13
PutDoc("/FontName /"+AllFonts[it.key()]->RealName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
PutDoc("/FontBBox [ "+AllFonts[it.key()]->FontBBox+" ]\n");
PutDoc("/Flags ");
QFontInfo fo = QFontInfo(it.data());
//FIXME: isItalic() should be queried from Foi, not from Qt -- AV
//QFontInfo fo = QFontInfo(it.data());
int pfl = 0;
if (AllFonts[it.key()]->IsFixedPitch)
pfl = pfl ^ 1;
if (fo.italic())
//if (fo.italic())
if (AllFonts[it.key()]->ItalicAngle != "0")
pfl = pfl ^ 64;
// pfl = pfl ^ 4;
pfl = pfl ^ 32;
2861,8 → 2863,8
}
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->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
uint idx1 = (idx >> 8) & 0xFF;
if (hl->cstyle & 32)
{
2891,7 → 2893,7
FillColor = "";
FillColor += putColor(hl->ccolor, hl->cshade, true);
}
if ((hl->cfont->isOTF) || (!hl->cfont->HasNames) || (hl->cfont->Subset) || (Options->SubsetList.contains(hl->cfont->SCName)))
if ((hl->cfont->isOTF) || (!hl->cfont->HasNames) || (hl->cfont->Subset) || (Options->SubsetList.contains(hl->cfont->scName())))
{
uint chr = chx[0].unicode();
if ((hl->cfont->CharWidth.contains(chr)) && (chr != 32))
3016,10 → 3018,10
{
cc = chx[0].unicode();
idx = 0;
if (GlyphsIdxOfFont[hl->cfont->SCName].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->SCName][cc].Code;
if (GlyphsIdxOfFont[hl->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
idx1 = (idx >> 8) & 0xFF;
tmp += UsedFontsP[hl->cfont->SCName]+"S"+IToStr(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
tmp += UsedFontsP[hl->cfont->scName()]+"S"+IToStr(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
if (hl->cstroke != "None")
{
tmp += StrokeColor;
3073,10 → 3075,10
chx = "-";
cc = chx[0].unicode();
idx = 0;
if (GlyphsIdxOfFont[hl->cfont->SCName].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->SCName][cc].Code;
if (GlyphsIdxOfFont[hl->cfont->scName()].contains(cc))
idx = GlyphsIdxOfFont[hl->cfont->scName()][cc].Code;
idx1 = (idx >> 8) & 0xFF;
tmp += UsedFontsP[hl->cfont->SCName]+"S"+IToStr(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
tmp += UsedFontsP[hl->cfont->scName()]+"S"+IToStr(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
idx2 = idx & 0xFF;
tmp += "<"+QString(toHex(idx2))+"> Tj\n";
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
73,7 → 73,7
UsedFonts.clear();
FT_Init_FreeType( &library );
AllFonts = &prefsData->AvailFonts;
AddFont(prefsData->toolSettings.defFont, prefsData->AvailFonts[prefsData->toolSettings.defFont]->Font);
AddFont(prefsData->toolSettings.defFont);//, prefsData->AvailFonts[prefsData->toolSettings.defFont]->Font);
toolSettings.defFont = prefsData->toolSettings.defFont;
toolSettings.defSize = prefsData->toolSettings.defSize;
toolSettings.tabFillChar = prefsData->toolSettings.tabFillChar;
341,7 → 341,7
DocPages.setAutoDelete(true);
MasterPages.clear();
DocPages.clear();
QMap<QString,QFont>::Iterator it3;
QMap<QString,int>::Iterator it3;
for (it3 = UsedFonts.begin(); it3 != UsedFonts.end(); ++it3)
{
if (!(*AllFonts)[it3.key()]->PrivateFont.isEmpty())
781,7 → 781,7
currentPageLayout = fp;
}
 
bool ScribusDoc::AddFont(QString name, QFont fo)
bool ScribusDoc::AddFont(QString name, int fsize)
{
bool ret = false;
bool error;
790,7 → 790,7
if (UsedFonts.contains(name))
return true;
 
error = FT_New_Face( library, (*AllFonts)[name]->fontFilePath(), (*AllFonts)[name]->faceIndex, &face );
error = FT_New_Face( library, (*AllFonts)[name]->fontFilePath(), (*AllFonts)[name]->faceIndex(), &face );
if (error)
return ret;
 
811,7 → 811,7
if (afm.exists())
FT_Attach_File(face, afm.name());
FFonts[name] = face;
UsedFonts[name] = fo;
UsedFonts[name] = fsize;
ret = true;
}
else
1626,7 → 1626,7
}
}
 
void ScribusDoc::getUsedFonts(QMap<QString,QFont> *Really)
void ScribusDoc::getUsedFonts(QMap<QString,int> *Really)
{
PageItem* it;
FPointArray gly;
1664,7 → 1664,7
{
for (uint e = 0; e < it->itemText.count(); ++e)
{
Really->insert(it->itemText.at(e)->cfont->SCName, UsedFonts[it->itemText.at(e)->cfont->SCName]);
Really->insert(it->itemText.at(e)->cfont->scName(), UsedFonts[it->itemText.at(e)->cfont->scName()]);
uint chr = it->itemText.at(e)->ch[0].unicode();
if ((chr == 13) || (chr == 32) || (chr == 29))
continue;
1732,7 → 1732,7
 
void ScribusDoc::reorganiseFonts()
{
QMap<QString,QFont> Really;
QMap<QString,int> Really;
//QMap<QString,QFont> DocF;
//DocF = UsedFonts;
if (!masterPageMode)
1773,12 → 1773,12
uint itemTextCount=it->itemText.count();
for (uint e = 0; e < itemTextCount; ++e)
{
Really.insert(it->itemText.at(e)->cfont->SCName, UsedFonts[it->itemText.at(e)->cfont->SCName]);
Really.insert(it->itemText.at(e)->cfont->scName(), UsedFonts[it->itemText.at(e)->cfont->scName()]);
}
}
}
}
QMap<QString,QFont>::Iterator itfo, itnext;
QMap<QString,int>::Iterator itfo, itnext;
for (itfo = UsedFonts.begin(); itfo != UsedFonts.end(); itfo = itnext)
{
itnext = itfo;
1791,8 → 1791,8
}
}
PrefsManager* prefsManager=PrefsManager::instance();
AddFont(prefsManager->appPrefs.toolSettings.defFont, prefsManager->appPrefs.AvailFonts[prefsManager->appPrefs.toolSettings.defFont]->Font);
AddFont(toolSettings.defFont, prefsManager->appPrefs.AvailFonts[toolSettings.defFont]->Font);
AddFont(prefsManager->appPrefs.toolSettings.defFont);//, prefsManager->appPrefs.AvailFonts[prefsManager->appPrefs.toolSettings.defFont]->Font);
AddFont(toolSettings.defFont);//, prefsManager->appPrefs.AvailFonts[toolSettings.defFont]->Font);
}
 
void ScribusDoc::setUnitIndex(const int newIndex)
/branches/Version13x/Scribus/scribus/pdfopts.h
35,7 → 35,7
Q_OBJECT
 
public:
PDF_Opts( QWidget* parent, QString docFileName, QMap<QString,QFont> DocFonts, ScribusView *currView, PDFOptions *pdfOptions,
PDF_Opts( QWidget* parent, QString docFileName, QMap<QString,int> DocFonts, ScribusView *currView, PDFOptions *pdfOptions,
QValueList<PDFPresentationData> Eff, ProfilesL *PDFXProfiles, SCFonts &AllFonts, double unitRatio, ProfilesL *printerProfiles);
~PDF_Opts() {};
 
/branches/Version13x/Scribus/scribus/scribusXml.cpp
114,7 → 114,7
bool isThere = false;
for (uint dl = 0; dl < dummyFois.count(); ++dl)
{
if (dummyFois.at(dl)->SCName == tmpf)
if (dummyFois.at(dl)->scName() == tmpf)
{
isThere = true;
dummy = dummyFois.at(dl);
123,7 → 123,7
}
if (!isThere)
{
dummy = new Foi(tmpf, "", false);
dummy = new Foi(tmpf, "", "", "", "", 1, false);
dummyFois.append(dummy);
}
unknown = true;
139,9 → 139,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf);
}
}
int size = qRound(QStodouble(it->attribute("CSIZE")) * 10);
223,7 → 223,7
 
QString ScriXmlDoc::AskForFont(SCFonts &avail, QString fStr, ScribusDoc *doc)
{
QFont fo;
// QFont fo;
QString tmpf = fStr;
if ((!avail.find(tmpf)) || (!avail[tmpf]->UseFont))
{
243,9 → 243,9
}
if (!doc->UsedFonts.contains(tmpf))
{
fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf);
}
DoFonts[fStr] = tmpf;
return tmpf;
881,7 → 881,6
PageItem *Neu;
LFrames.clear();
QString tmV, tmp, tmpf, tmp2, tmp3, tmp4, PgNam, f, Defont, tmf;
QFont fo;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
int x, a, counter, baseobj;
1233,7 → 1232,6
bool newVersion = false;
struct Linked Link;
QString tmp, tmpf, tmp2, tmp3, tmp4, PgNam, Defont, tmf;
QFont fo;
QMap<int,int> TableID;
QPtrList<PageItem> TableItems;
int x, a;
1328,9 → 1326,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[Defont]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(Defont, fo);
// QFont fo = avail[Defont]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(Defont);
}
}
doc->toolSettings.defFont = Defont;
1427,9 → 1425,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf);
}
}
vg.Font = tmpf;
1628,9 → 1626,9
{
if (!doc->UsedFonts.contains(tmpf))
{
QFont fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf, fo);
// QFont fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
doc->AddFont(tmpf);
}
}
OB.IFont = tmpf;
1927,7 → 1925,6
struct CopyPasteBuffer OB;
struct ParagraphStyle vg;
QString tmp, tmpf, tmp2, tmp3, tmp4, f, tmV, tmf;
QFont fo;
QMap<QString,QString> DoMul;
QMap<int,int> TableID;
QMap<int,int> arrowID;
2033,10 → 2030,10
else
tmpf = FontSub[tmpf];
}
fo = avail[tmpf]->Font;
fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
// fo = avail[tmpf]->Font;
// fo.setPointSize(qRound(doc->toolSettings.defSize / 10.0));
if(!doc->UsedFonts.contains(tmpf))
doc->AddFont(tmpf, fo);
doc->AddFont(tmpf);
DoFonts[pg.attribute("NAME")] = tmpf;
}
// 10/25/2004 pv - None is "reserved" color. cannot be defined in any file...
2231,7 → 2228,7
}
elem.setAttribute("COUNT", Selitems->count());
elem.setAttribute("Version", QString(VERSION));
QMap<QString,QFont>::Iterator itf;
QMap<QString,int>::Iterator itf;
for (itf = doc->UsedFonts.begin(); itf != doc->UsedFonts.end(); ++itf)
{
QDomElement fn=docu.createElement("FONT");
2512,7 → 2509,7
ScText * itemTextAtK = item->itemText.at(k);
QDomElement it=docu.createElement("ITEXT");
ts = itemTextAtK->csize / 10.0;
tf = itemTextAtK->cfont->SCName;
tf = itemTextAtK->cfont->scName();
tc = itemTextAtK->ccolor;
te = itemTextAtK->cextra;
tsh = itemTextAtK->cshade;
2567,7 → 2564,7
}
itemTextAtK = item->itemText.at(k);
ts2 = itemTextAtK->csize / 10.0;
tf2 = itemTextAtK->cfont->SCName;
tf2 = itemTextAtK->cfont->scName();
tc2 = itemTextAtK->ccolor;
te2 = itemTextAtK->cextra;
tsh2 = itemTextAtK->cshade;
2619,7 → 2616,7
break;
itemTextAtK = item->itemText.at(k);
ts2 = itemTextAtK->csize / 10.0;
tf2 = itemTextAtK->cfont->SCName;
tf2 = itemTextAtK->cfont->scName();
tc2 = itemTextAtK->ccolor;
te2 = itemTextAtK->cextra;
tsh2 = itemTextAtK->cshade;
2831,7 → 2828,7
ScText *itemTextAtK = item->itemText.at(k);
QDomElement it=docu->createElement("ITEXT");
ts = itemTextAtK->csize / 10.0;
tf = itemTextAtK->cfont->SCName;
tf = itemTextAtK->cfont->scName();
tc = itemTextAtK->ccolor;
te = itemTextAtK->cextra;
tsh = itemTextAtK->cshade;
2889,7 → 2886,7
}
itemTextAtK = item->itemText.at(k);
ts2 = itemTextAtK->csize / 10.0;
tf2 = itemTextAtK->cfont->SCName;
tf2 = itemTextAtK->cfont->scName();
tc2 = itemTextAtK->ccolor;
te2 = itemTextAtK->cextra;
tsh2 = itemTextAtK->cshade;
2943,7 → 2940,7
break;
itemTextAtK = item->itemText.at(k);
ts2 = itemTextAtK->csize / 10.0;
tf2 = itemTextAtK->cfont->SCName;
tf2 = itemTextAtK->cfont->scName();
tc2 = itemTextAtK->ccolor;
te2 = itemTextAtK->cextra;
tsh2 = itemTextAtK->cshade;
/branches/Version13x/Scribus/scribus/edit1format.cpp
576,9 → 576,9
tmpStyle.baseOff = qRound(fontBase->value() * 10.0);
tmpStyle.kernVal = qRound(fontKern->value() * 10.0);
 
QFont fo = QFont(FontC->currentFont());
fo.setPointSize(qRound(parentDoc->toolSettings.defSize / 10.0));
parentDoc->AddFont(FontC->currentFont(), fo);
// QFont fo = QFont(FontC->currentFont());
// fo.setPointSize(qRound(parentDoc->toolSettings.defSize / 10.0));
parentDoc->AddFont(FontC->currentFont(), qRound(parentDoc->toolSettings.defSize / 10.0));
parentDoc->docParagraphStyles.append(tmpStyle);
int tmpIndex = parentDoc->docParagraphStyles.count() - 1;
previewItem->itemText.clear();
/branches/Version13x/Scribus/scribus/scfonts.cpp
47,19 → 47,28
#include FT_TRUETYPE_TAGS_H
#include FT_TRUETYPE_TABLES_H
 
Foi::Foi(QString scname, QString path, bool embedps) :
SCName(scname), Datei(path), faceIndex(0), EmbedPS(embedps)
Foi::Foi(QString fam, QString sty, QString alt, QString psname, QString path, int face, bool embedps) :
Family(fam), Effect(sty), Alternative(alt), cached_RealName(psname), fontFile(path), faceIndex_(face), EmbedPS(embedps)
{
isOTF = false;
Subset = false;
typeCode = Foi::UNKNOWN_TYPE;
formatCode = Foi::UNKNOWN_FORMAT;
if ( sty != "" )
SCName = fam + " " + sty + alt;
else
SCName = fam + alt;
}
 
 
FT_Face * ftFace() {
// dummy for now
return NULL;
}
 
QString Foi::RealName()
{
QString result="Base";
return(result);
return QString("Base");
}
 
bool Foi::EmbedFont(QString &str)
91,9 → 100,9
if (error)
sDebug(QObject::tr("Freetype2 library not available"));
else
error = FT_New_Face( library, Datei, faceIndex, &face );
error = FT_New_Face( library, fontFile, faceIndex_, &face );
if (error)
sDebug(QObject::tr("Font %1 is broken, no embedding").arg(Datei));
sDebug(QObject::tr("Font %1 is broken, no embedding").arg(fontFile));
else
{
FT_Stream fts = face->stream;
103,14 → 112,14
error = FT_Stream_Read(fts, reinterpret_cast<FT_Byte *>(bb.data()), fts->size);
if (error)
{
sDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(Datei));
sDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(fontFile));
bb.resize(0);
}
/*
if (showFontInformation)
{
QFile f(Datei);
qDebug(QObject::tr("RawData for Font %1(%2): size=%3 filesize=%4").arg(Datei).arg(faceIndex).arg(bb.size()).arg(f.size()));
QFile f(fontFile);
qDebug(QObject::tr("RawData for Font %1(%2): size=%3 filesize=%4").arg(fontFile).arg(faceIndex_).arg(bb.size()).arg(f.size()));
}
*/
}
131,7 → 140,7
int YPos = qApp->font().pointSize();
uint n;
error = FT_Init_FreeType( &library );
error = FT_New_Face( library, Datei, 0, &face );
error = FT_New_Face( library, fontFile, 0, &face );
ts = QString(face->family_name) + " " + QString(face->style_name);
pm.fill();
pen_x = 0;
182,8 → 191,8
class Foi_postscript : public Foi
{
public:
Foi_postscript(QString scname, QString path, bool embedps) :
Foi(scname,path,embedps), metricsread(false)
Foi_postscript(QString fam, QString sty, QString alt, QString psname, QString path, int face, bool embedps) :
Foi(fam,sty,alt,psname,path,face,embedps), metricsread(false)
{
HasMetrics=false;
HasKern = false;
200,7 → 209,7
 
virtual QString RealName()
{
return(cached_RealName);
return(Foi::RealName());
}
 
virtual bool ReadMetrics() // routine by Franz Schmid - modified by Alastair M. Robinson
228,7 → 237,7
sDebug(QObject::tr("Font %1 is broken (FreeType2), discarding it").arg(fontPath()));
return false;
}
error = FT_New_Face( library, fontFilePath(), faceIndex, &face );
error = FT_New_Face( library, fontFilePath(), faceIndex(), &face );
if (error)
{
UseFont = false;
321,8 → 330,8
class Foi_pfb : public Foi_postscript
{
public:
Foi_pfb(QString scname, QString path, bool embedps) :
Foi_postscript(scname,path,embedps)
Foi_pfb(QString fam, QString sty, QString alt, QString psname, QString path, int face, bool embedps) :
Foi_postscript(fam,sty,alt,psname,path,face,embedps)
{
formatCode = PFB;
}
408,8 → 417,8
class Foi_pfa : public Foi_postscript
{
public:
Foi_pfa(QString scname, QString path, bool embedps) :
Foi_postscript(scname,path,embedps)
Foi_pfa(QString fam, QString sty, QString alt, QString psname, QString path, int face, bool embedps) :
Foi_postscript(fam,sty,alt,psname,path,face,embedps)
{
formatCode = PFA;
}
443,19 → 452,19
{
if (it.current()->UseFont)
{
if (fontMap.contains(it.current()->Family))
if (fontMap.contains(it.current()->family()))
{
QStringList effect;
if (!fontMap[it.current()->Family].contains(it.current()->Effect))
if (!fontMap[it.current()->family()].contains(it.current()->style()))
{
fontMap[it.current()->Family].append(it.current()->Effect);
fontMap[it.current()->family()].append(it.current()->style());
}
}
else
{
QStringList effect;
effect.append(it.current()->Effect);
fontMap.insert(it.current()->Family, effect);
effect.append(it.current()->style());
fontMap.insert(it.current()->family(), effect);
}
}
}
694,6 → 703,7
}
}
QString ts = fam + " " + sty;
QString alt = "";
const char* psName = FT_Get_Postscript_Name(face);
QString qpsName;
if (psName)
703,10 → 713,11
Foi *t = find(ts);
if (t)
{
if (t->cached_RealName != qpsName)
if (t->RealName() != qpsName)
{
ts += " ("+qpsName+")";
sty += " ("+qpsName+")";
alt = " ("+qpsName+")";
ts += alt;
sty += alt;
}
}
t = find(ts);
715,13 → 726,13
switch (format)
{
case Foi::PFA:
t = new Foi_pfa(ts, filename, true);
t = new Foi_pfa(fam, sty, alt, qpsName, filename, faceindex, true);
break;
case Foi::PFB:
t = new Foi_pfb(ts, filename, true);
t = new Foi_pfb(fam, sty, alt, qpsName, filename, faceindex, true);
break;
case Foi::SFNT:
t = new Foi_ttf(ts, filename, true);
t = new Foi_ttf(fam, sty, alt, qpsName, filename, faceindex, true);
getSFontType(face, t->typeCode);
if (t->typeCode == Foi::OTF)
{
730,7 → 741,7
}
break;
case Foi::TTCF:
t = new Foi_ttf(ts, filename, true);
t = new Foi_ttf(fam, sty, alt, qpsName, filename, faceindex, true);
t->formatCode = Foi::TTCF;
t->typeCode = Foi::TTF;
//getSFontType(face, t->typeCode);
741,7 → 752,7
}
break;
case Foi::TYPE42:
t = new Foi_ttf(ts, filename, true);
t = new Foi_ttf(fam, sty, alt, qpsName, filename, faceindex, true);
getSFontType(face, t->typeCode);
if (t->typeCode == Foi::OTF)
{
750,14 → 761,14
}
break;
}
t->cached_RealName = qpsName;
// t->cached_RealName = qpsName;
/* const char* psName = FT_Get_Postscript_Name(face);
if (psName)
t->cached_RealName = QString(psName);
else
t->cached_RealName = ts; */
t->Font = qApp->font();
t->Font.setPointSize(qApp->font().pointSize());
// t->Font = qApp->font();
// t->Font.setPointSize(qApp->font().pointSize());
insert(ts,t);
t->EmbedPS = true;
t->UseFont = true;
766,9 → 777,9
t->CharWidth[9] = 1;
// t->Family = QString(face->family_name);
// t->Effect = QString(face->style_name);
t->Family = fam;
t->Effect = sty;
t->faceIndex = faceindex;
// t->Family = fam;
// t->Effect = sty;
// t->faceIndex_ = faceindex;
t->PrivateFont = DocName;
//setBestEncoding(face); //AV
switch (face->charmap? face->charmap->encoding : -1)
792,7 → 803,7
t->FontEnc = QString();
}
if (showFontInformation)
sDebug(QObject::tr("Font %1 loaded from %2(%3)").arg(t->cached_RealName).arg(filename).arg(faceindex+1));
sDebug(QObject::tr("Font %1 loaded from %2(%3)").arg(t->RealName()).arg(filename).arg(faceindex+1));
 
/*
//debug
/branches/Version13x/Scribus/scribus/story.cpp
977,7 → 977,7
{
hg = new PtiSmall;
hg->ch = nextItem->itemText.at(a)->ch;
hg->cfont = nextItem->itemText.at(a)->cfont->SCName;
hg->cfont = nextItem->itemText.at(a)->cfont->scName();
hg->csize = nextItem->itemText.at(a)->csize;
hg->ccolor = nextItem->itemText.at(a)->ccolor;
hg->cshade = nextItem->itemText.at(a)->cshade;
2470,7 → 2470,8
void StoryEditor::newTxFont(const QString &f)
{
if(!currDoc->UsedFonts.contains(f)) {
if (!currDoc->AddFont(f, prefsManager->appPrefs.AvailFonts[f]->Font)) {
if (!currDoc->AddFont(f)) {
//, prefsManager->appPrefs.AvailFonts[f]->Font)) {
FontTools->Fonts->RebuildList(currDoc);
return;
};
2786,29 → 2787,27
 
void StoryEditor::updateStatus()
{
//FIXME Too slow!! Possibly move to a timer
QString tmp;
int p, i;
Editor->getCursorPosition(&p, &i);
uint styledTextCount=Editor->StyledText.count();
ParC->setText(tmp.setNum(styledTextCount));
static QRegExp rx( "(\\w+)\\b" );
ParC->setText(tmp.setNum(Editor->StyledText.count()));
QRegExp rx( "(\\w+)\\b" );
int pos = 0;
int counter = 0;
int counter1 = 0;
int counter2 = 0;
while ( pos >= 0 )
{
pos = rx.search( Editor->text(p), pos );
if ( pos > -1 )
{
++counter;
counter++;
pos += rx.matchedLength();
}
}
WordC->setText(tmp.setNum(counter));
CharC->setText(tmp.setNum(Editor->text(p).length()-1));
int counter1 = 0;
int counter2 = 0;
for (uint a = 0; a < styledTextCount; ++a)
for (uint a = 0; a < Editor->StyledText.count(); ++a)
{
int pos = 0;
while ( pos >= 0 )
2816,7 → 2815,7
pos = rx.search( Editor->text(a), pos );
if ( pos > -1 )
{
++counter2;
counter2++;
pos += rx.matchedLength();
}
}
/branches/Version13x/Scribus/scribus/pageitem.cpp
5070,7 → 5070,7
Text += QString(QChar(4))+"\t";
else
Text += itemText.at(a)->ch+"\t";
Text += itemText.at(a)->cfont->SCName+"\t";
Text += itemText.at(a)->cfont->scName()+"\t";
Text += QString::number(itemText.at(a)->csize / 10.0)+"\t";
Text += itemText.at(a)->ccolor+"\t";
Text += QString::number(itemText.at(a)->cextra)+"\t";
/branches/Version13x/Scribus/scribus/pdflib.h
47,7 → 47,7
PDFlib(ScribusDoc *docu);
~PDFlib() {};
bool doExport(QString fn, QString nam, int Components, std::vector<int> &pageNs, QMap<int,QPixmap> thumbs, QProgressBar *dia2);
bool PDF_Begin_Doc(QString fn, PDFOptions *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi);
bool PDF_Begin_Doc(QString fn, PDFOptions *opts, SCFonts &AllFonts, QMap<QString,int> DocFonts, BookMView* vi);
void PDF_Begin_Page(Page* pag, QPixmap pm = 0);
void PDF_End_Page();
void PDF_TemplatePage(Page* pag, bool clip = false);
189,7 → 189,7
QString Datum;
int NDnum;
QMap<QString, QString> UsedFontsP;
QMap<QString, QFont> RealFonts;
QMap<QString, int> RealFonts;
bool CompAvail;
QByteArray KeyGen;
QByteArray OwnerKey;
/branches/Version13x/Scribus/scribus/scribusdoc.h
223,7 → 223,7
//Items
const bool deleteTaggedItems();
 
bool AddFont(QString name, QFont fo);
bool AddFont(QString name, int fsize = 10);
void OpenCMSProfiles(ProfilesL InPo, ProfilesL MoPo, ProfilesL PrPo);
void CloseCMSProfiles();
void loadStylesFromFile(QString fileName, QValueList<ParagraphStyle> *tempStyles = NULL);
255,7 → 255,7
/*!
* @brief Returns a qmap of the fonts used within the document
*/
void getUsedFonts(QMap<QString,QFont> *Really);
void getUsedFonts(QMap<QString,int> *Really);
/*!
* @brief Builds a qmap of the colours used within the document
*/
408,7 → 408,7
double *ShapeValues;
int ValCount;
QString DocName;
QMap<QString,QFont> UsedFonts;
QMap<QString,int> UsedFonts;
SCFonts *AllFonts;
QColor papColor;
int CurrentSel;
/branches/Version13x/Scribus/scribus/scribusview.cpp
6733,7 → 6733,7
}
if (breakAndReturn)
{
Doc->CurrFont = currItem->itemText.at(a)->cfont->SCName;
Doc->CurrFont = currItem->itemText.at(a)->cfont->scName();
Doc->CurrFontSize = currItem->itemText.at(a)->csize;
Doc->CurrTextFill = currItem->itemText.at(a)->ccolor;
Doc->CurrTextFillSh = currItem->itemText.at(a)->cshade;
6756,7 → 6756,7
emit ItemTextBase(currItem->itemText.at(a)->cbase);
emit ItemTextSca(currItem->itemText.at(a)->cscale);
emit ItemTextScaV(currItem->itemText.at(a)->cscalev);
emit ItemTextFont(currItem->itemText.at(a)->cfont->SCName);
emit ItemTextFont(currItem->itemText.at(a)->cfont->scName());
emit ItemTextSize(currItem->itemText.at(a)->csize);
emit ItemTextUSval(currItem->itemText.at(a)->cextra);
emit ItemTextStil(currItem->itemText.at(a)->cstyle);
6779,7 → 6779,7
i = a - 1;
else
i = a;
Doc->CurrFont = currItem->itemText.at(i)->cfont->SCName;
Doc->CurrFont = currItem->itemText.at(i)->cfont->scName();
Doc->CurrFontSize = currItem->itemText.at(i)->csize;
Doc->CurrTextFill = currItem->itemText.at(i)->ccolor;
Doc->CurrTextFillSh = currItem->itemText.at(i)->cshade;
6802,7 → 6802,7
emit ItemTextSca(currItem->itemText.at(i)->cscale);
emit ItemTextScaV(currItem->itemText.at(i)->cscalev);
emit ItemTextFarben(currItem->itemText.at(i)->cstroke, currItem->itemText.at(i)->ccolor, currItem->itemText.at(i)->cshade2, currItem->itemText.at(i)->cshade);
emit ItemTextFont(currItem->itemText.at(i)->cfont->SCName);
emit ItemTextFont(currItem->itemText.at(i)->cfont->scName());
emit ItemTextSize(currItem->itemText.at(i)->csize);
emit ItemTextUSval(currItem->itemText.at(i)->cextra);
emit ItemTextStil(currItem->itemText.at(i)->cstyle);
6814,7 → 6814,7
currItem->CPos = currItem->itemText.count();
if (currItem->itemText.count() != 0)
{
Doc->CurrFont = currItem->itemText.at(currItem->CPos-1)->cfont->SCName;
Doc->CurrFont = currItem->itemText.at(currItem->CPos-1)->cfont->scName();
Doc->CurrFontSize = currItem->itemText.at(currItem->CPos-1)->csize;
Doc->CurrTextFill = currItem->itemText.at(currItem->CPos-1)->ccolor;
Doc->CurrTextFillSh = currItem->itemText.at(currItem->CPos-1)->cshade;
6837,7 → 6837,7
emit ItemTextSca(currItem->itemText.at(currItem->CPos-1)->cscale);
emit ItemTextScaV(currItem->itemText.at(currItem->CPos-1)->cscalev);
emit ItemTextFarben(currItem->itemText.at(currItem->CPos-1)->cstroke, currItem->itemText.at(currItem->CPos-1)->ccolor, currItem->itemText.at(currItem->CPos-1)->cshade2, currItem->itemText.at(currItem->CPos-1)->cshade);
emit ItemTextFont(currItem->itemText.at(currItem->CPos-1)->cfont->SCName);
emit ItemTextFont(currItem->itemText.at(currItem->CPos-1)->cfont->scName());
emit ItemTextSize(currItem->itemText.at(currItem->CPos-1)->csize);
emit ItemTextUSval(currItem->itemText.at(currItem->CPos-1)->cextra);
emit ItemTextStil(currItem->itemText.at(currItem->CPos-1)->cstyle);
/branches/Version13x/Scribus/scribus/fontcombo.cpp
149,8 → 149,8
{
disconnect(fontFamily, SIGNAL(activated(int)), this, SLOT(familySelected(int)));
disconnect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int)));
QString family = prefsManager->appPrefs.AvailFonts[f]->Family;
QString style = prefsManager->appPrefs.AvailFonts[f]->Effect;
QString family = prefsManager->appPrefs.AvailFonts[f]->family();
QString style = prefsManager->appPrefs.AvailFonts[f]->style();
fontFamily->setCurrentText(family);
fontStyle->clear();
QStringList slist = prefsManager->appPrefs.AvailFonts.fontMap[family];
/branches/Version13x/Scribus/scribus/scribus.cpp
583,7 → 583,6
 
void ScribusApp::initMenuBar()
{
QFont tmp;
RecentDocs.clear();
 
scrMenuMgr->createMenu("File", tr("&File"));
1063,7 → 1062,7
doc->currentParaStyle = currItem->itemText.at(ChPos)->cab;
setAbsValue(doc->currentParaStyle);
propertiesPalette->setAli(doc->currentParaStyle);
doc->CurrFont = currItem->itemText.at(ChPos)->cfont->SCName;
doc->CurrFont = currItem->itemText.at(ChPos)->cfont->scName();
doc->CurrFontSize = currItem->itemText.at(ChPos)->csize;
doc->CurrTextFill = currItem->itemText.at(ChPos)->ccolor;
doc->CurrTextFillSh = currItem->itemText.at(ChPos)->cshade;
4676,7 → 4675,7
bool ScribusApp::doPrint(PrintOptions *options)
{
bool retw = false;
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
QString filename(options->filename);
ReallyUsed.clear();
doc->getUsedFonts(&ReallyUsed);
4823,7 → 4822,7
BufferI += nextItem->itemText.at(a)->ch;
}
Buffer2 += "\t";
Buffer2 += nextItem->itemText.at(a)->cfont->SCName+"\t";
Buffer2 += nextItem->itemText.at(a)->cfont->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.at(a)->csize)+"\t";
Buffer2 += nextItem->itemText.at(a)->ccolor+"\t";
Buffer2 += QString::number(nextItem->itemText.at(a)->cextra)+"\t";
4909,7 → 4908,7
BufferI += nextItem->itemText.at(a)->ch;
}
Buffer2 += "\t";
Buffer2 += nextItem->itemText.at(a)->cfont->SCName+"\t";
Buffer2 += nextItem->itemText.at(a)->cfont->scName()+"\t";
Buffer2 += QString::number(nextItem->itemText.at(a)->csize)+"\t";
Buffer2 += nextItem->itemText.at(a)->ccolor+"\t";
Buffer2 += QString::number(nextItem->itemText.at(a)->cextra)+"\t";
6666,10 → 6665,10
QString nf2(nf);
if (!doc->UsedFonts.contains(nf))
{
if (doc->AddFont(nf, prefsManager->appPrefs.AvailFonts[nf]->Font))
if (doc->AddFont(nf)) //, prefsManager->appPrefs.AvailFonts[nf]->Font))
{
int a = FontMenu->insertItem(new FmItem(nf, prefsManager->appPrefs.AvailFonts[nf]->Font));
FontID.insert(a, prefsManager->appPrefs.AvailFonts[nf]->SCName);
int a = FontMenu->insertItem(new FmItem(nf, prefsManager->appPrefs.AvailFonts[nf]));
FontID.insert(a, prefsManager->appPrefs.AvailFonts[nf]->scName());
}
else
{
7194,10 → 7193,10
QString nf = doc->docParagraphStyles[a].Font;
if (!doc->UsedFonts.contains(nf))
{
if (doc->AddFont(nf, prefsManager->appPrefs.AvailFonts[nf]->Font))
if (doc->AddFont(nf)) //, prefsManager->appPrefs.AvailFonts[nf]->Font))
{
int ff = FontMenu->insertItem(new FmItem(nf, prefsManager->appPrefs.AvailFonts[nf]->Font));
FontID.insert(ff, prefsManager->appPrefs.AvailFonts[nf]->SCName);
int ff = FontMenu->insertItem(new FmItem(nf, prefsManager->appPrefs.AvailFonts[nf]));
FontID.insert(ff, prefsManager->appPrefs.AvailFonts[nf]->scName());
}
else
doc->docParagraphStyles[a].Font = doc->toolSettings.defFont;
7661,13 → 7660,13
if (!HaveDoc)
{
it.toFirst();
a = FontMenu->insertItem(new FmItem(it.currentKey(), it.current()->Font));
a = FontMenu->insertItem(new FmItem(it.currentKey(), it.current()));
FontMenu->setItemChecked(a, true);
FontID.insert(a, it.current()->SCName);
FontID.insert(a, it.current()->scName());
}
else
{
QMap<QString,QFont>::Iterator it3;
QMap<QString,int>::Iterator it3;
for (it3 = doc->UsedFonts.begin(); it3 != doc->UsedFonts.end(); ++it3)
{
a = FontMenu->insertItem(new FmItem(it3.key(), it3.data()));
7843,7 → 7842,7
pageNs.push_back(doc->currentPage->pageNr()+1);
ReOrderText(doc, view);
qApp->setOverrideCursor(QCursor(waitCursor), true);
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
ReallyUsed.clear();
doc->getUsedFonts(&ReallyUsed);
ColorList usedColors;
7990,7 → 7989,7
}
/* if (bookmarkPalette->BView->childCount() == 0)
doc->PDF_Options.Bookmarks = false; */
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
ReallyUsed.clear();
doc->getUsedFonts(&ReallyUsed);
if (doc->PDF_Options.EmbedList.count() != 0)
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
47,7 → 47,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)->cfont->scName().utf8());
return NULL;
}
else
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
268,7 → 268,7
return -1;
}
// get all used fonts
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
ReallyUsed.clear();
ScApp->doc->getUsedFonts(&ReallyUsed);
// create list of all used fonts
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/objprinter.cpp
444,7 → 444,7
psl = 3;
PSLevel = psl;
printcomm = QString(PyString_AsString(self->cmd));
QMap<QString,QFont> ReallyUsed;
QMap<QString,int> ReallyUsed;
ReallyUsed.clear();
ScApp->doc->getUsedFonts(&ReallyUsed);
PrefsManager *prefsManager=PrefsManager::instance();
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
52,7 → 52,7
{
row = Py_BuildValue((char*)"(sssiis)",
it.currentKey().utf8().data(),
it.current()->Family.utf8().data(),
it.current()->family().utf8().data(),
it.current()->RealName().utf8().data(),
it.current()->Subset,
it.current()->EmbedPS,
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
1649,7 → 1649,7
for ( ; it.current(); ++it)
{
QString fam;
QString &fn = it.current()->SCName;
QString fn = it.current()->scName();
int pos=fn.find(" ");
fam = fn.left(pos);
if (fam == family)
/branches/Version13x/Scribus/scribus/plugins/fontpreview/ui.h
36,7 → 36,7
QLabel* sizeLabel;
QSpinBox* sizeSpin;
/** Font iteration */
QMap<QString,QFont> reallyUsedFonts;
QMap<QString,int> reallyUsedFonts;
/** Pixmaps for each font type */
QPixmap ttfFont;
QPixmap otfFont;
/branches/Version13x/Scribus/scribus/plugins/fontpreview/ui.cpp
185,7 → 185,7
QString sstr = searchStr.lower();
for (SCFontsIterator fontIter(PrefsManager::instance()->appPrefs.AvailFonts); fontIter.current(); ++fontIter)
{
if (searchStr.length()!=0 && !fontIter.current()->SCName.lower().contains(sstr))
if (searchStr.length()!=0 && !fontIter.current()->scName().lower().contains(sstr))
continue;
if (fontIter.current()->UseFont)
{
192,9 → 192,9
QListViewItem *row = new QListViewItem(fontList);
Foi::FontType type = fontIter.current()->typeCode;
 
row->setText(0, fontIter.current()->SCName);
row->setText(0, fontIter.current()->scName());
// searching
if (reallyUsedFonts.contains(fontIter.current()->SCName))
if (reallyUsedFonts.contains(fontIter.current()->scName()))
row->setPixmap(1, okIcon);
 
if (type == Foi::OTF)
/branches/Version13x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
763,12 → 763,12
if ((hl->cstroke != "None") && (chst & 4))
{
tp->setAttribute("stroke", SetFarbe(hl->cstroke, hl->cshade2));
tp->setAttribute("stroke-width", FToStr((*ScApp->doc->AllFonts)[hl->cfont->SCName]->strokeWidth * (hl->csize / 10.0))+"pt");
tp->setAttribute("stroke-width", FToStr((*ScApp->doc->AllFonts)[hl->cfont->scName()]->strokeWidth * (hl->csize / 10.0))+"pt");
}
else
tp->setAttribute("stroke", "none");
tp->setAttribute("font-size", (hl->csize / 10.0));
tp->setAttribute("font-family", (*ScApp->doc->AllFonts)[hl->cfont->SCName]->Family);
tp->setAttribute("font-family", (*ScApp->doc->AllFonts)[hl->cfont->scName()]->family());
if (chst != 0)
{
if (chst & 64)
/branches/Version13x/Scribus/scribus/scfontmetrics.cpp
191,7 → 191,7
int pen_x;
FPoint gp;
error = FT_Init_FreeType( &library );
error = FT_New_Face( library, fnt->fontFilePath(), fnt->faceIndex, &face );
error = FT_New_Face( library, fnt->fontFilePath(), fnt->faceIndex(), &face );
int encode = setBestEncoding(face);
double uniEM = static_cast<double>(face->units_per_EM);
int h = qRound(face->height / uniEM) * s + 1;
308,7 → 308,7
FT_ULong charcode;
FT_UInt gindex;
error = FT_Init_FreeType(&library);
error = FT_New_Face(library, fnt->fontFilePath(), fnt->faceIndex, &face);
error = FT_New_Face(library, fnt->fontFilePath(), fnt->faceIndex(), &face);
setBestEncoding(face);
gindex = 0;
charcode = FT_Get_First_Char(face, &gindex );
346,7 → 346,7
uint counter1 = 32;
uint counter2 = 0;
error = FT_Init_FreeType(&library);
error = FT_New_Face(library, fnt->fontFilePath(), fnt->faceIndex, &face);
error = FT_New_Face(library, fnt->fontFilePath(), fnt->faceIndex(), &face);
setBestEncoding(face);
gindex = 0;
charcode = FT_Get_First_Char(face, &gindex );
481,7 → 481,7
width = name->CharWidth[c1]*size10;
if (name->HasKern)
{
face = currentDoc->FFonts[name->SCName];
face = currentDoc->FFonts[name->scName()];
uint cl = FT_Get_Char_Index(face, c1);
uint cr = FT_Get_Char_Index(face, c2);
FT_Get_Kerning(face, cl, cr, ft_kerning_unscaled, &delta);
500,7 → 500,7
FT_Face face;
if (name->CharWidth.contains(c1))
{
face = currentDoc->FFonts[name->SCName];
face = currentDoc->FFonts[name->scName()];
uint cl = FT_Get_Char_Index(face, c1);
int error = FT_Load_Glyph(face, cl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
if (!error) {
522,7 → 522,7
FT_Face face;
if (name->CharWidth.contains(c1))
{
face = currentDoc->FFonts[name->SCName];
face = currentDoc->FFonts[name->scName()];
uint cl = FT_Get_Char_Index(face, c1);
int error = FT_Load_Glyph(face, cl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
if (!error)
544,7 → 544,7
FT_Face face;
if (name->CharWidth.contains(c1))
{
face = currentDoc->FFonts[name->SCName];
face = currentDoc->FFonts[name->scName()];
uint cl = FT_Get_Char_Index(face, c1);
int error = FT_Load_Glyph(face, cl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
if (! error)
561,6 → 561,6
 
double RealFHeight(ScribusDoc *currentDoc, Foi* name, int Size)
{
FT_Face face = currentDoc->FFonts[name->SCName];
FT_Face face = currentDoc->FFonts[name->scName()];
return face->height / name->uniEM * (Size / 10.0);
}
/branches/Version13x/Scribus/scribus/scpreview.cpp
41,7 → 41,6
ScColor lf = ScColor();
QFont fo;
QMap<QString,QString> DoFonts;
QMap<QString,QFont> DoFonts2;
QMap<int,int> arrowID;
QString tmpf, tmpx, tmp2, tmp3;
int x, y;
119,10 → 118,10
else
tmpf = prefsManager->appPrefs.GFontSub[tmpf];
}
if (!DoFonts2.contains(tmpf))
if (!DoFonts.contains(tmpf))
{
FT_Face face;
error = FT_New_Face( library, prefsManager->appPrefs.AvailFonts[tmpf]->fontFilePath(), prefsManager->appPrefs.AvailFonts[tmpf]->faceIndex, &face );
error = FT_New_Face( library, prefsManager->appPrefs.AvailFonts[tmpf]->fontFilePath(), prefsManager->appPrefs.AvailFonts[tmpf]->faceIndex(), &face );
if (error)
tmpf = prefsManager->appPrefs.toolSettings.defFont;
if (prefsManager->appPrefs.AvailFonts[tmpf]->ReadMetrics())
134,10 → 133,10
prefsManager->appPrefs.AvailFonts[tmpf]->CharWidth[13] = 0;
}
}
fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
fo.setPointSize(12);
// fo = prefsManager->appPrefs.AvailFonts[tmpf]->Font;
// fo.setPointSize(12);
DoFonts[GetAttr(&pg, "NAME")] = tmpf;
DoFonts2[GetAttr(&pg, "NAME")] = fo;
// DoFonts2[GetAttr(&pg, "NAME")] = fo;
}
if(pg.tagName()=="COLOR")
{
596,7 → 595,7
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->xp, hl->yp, chx, hl->cfont->scName(), OB.Reverse, hl->cstyle, mode, chs);
}
pS->restore();
}
754,7 → 753,7
pS->setPen(tmpfa);
}
chs = hl->csize;
asce = prefsManager->appPrefs.AvailFonts[hl->cfont->SCName]->numAscent * (hl->csize / 10.0);
asce = prefsManager->appPrefs.AvailFonts[hl->cfont->scName()]->numAscent * (hl->csize / 10.0);
int chst = hl->cstyle & 127;
if (chst != 0)
{
777,7 → 776,7
}
}
}
wide = prefsManager->appPrefs.AvailFonts[hl->cfont->SCName]->CharWidth[chx[0].unicode()]*(chs / 10.0);
wide = prefsManager->appPrefs.AvailFonts[hl->cfont->scName()]->CharWidth[chx[0].unicode()]*(chs / 10.0);
if ((CurX+(wide+chs * hl->cextra / 10000.0)/2) >= wid)
{
if (zae < cl.size()-1)
807,7 → 806,7
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->cextra / 10000.0, CurY+OB.BaseOffs, chx, hl->cfont->scName(), OB.Reverse, hl->cstyle, 2, chs);
pS->restore();
CurX += wide+chs * hl->cextra / 10000.0;
}
/branches/Version13x/Scribus/scribus/pslib.cpp
34,7 → 34,7
#include "util.h"
#include "scfontmetrics.h"
 
PSLib::PSLib(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, ColorList DocColors, bool pdf, bool spot)
PSLib::PSLib(bool psart, SCFonts &AllFonts, QMap<QString,int> DocFonts, ColorList DocColors, bool pdf, bool spot)
{
QString tmp, tmp2, tmp3, tmp4, CHset;
QStringList wt;
103,7 → 103,7
erst = false;
}
}
QMap<QString,QFont>::Iterator it;
QMap<QString,int>::Iterator it;
int a = 0;
for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
{
1775,7 → 1775,7
}
else
{
PS_selectfont(hl->cfont->SCName, tsz / 10.0);
PS_selectfont(hl->cfont->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");
1782,7 → 1782,7
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);
PS_show_xyG(hl->cfont->SCName, chx, 0, 0);
PS_show_xyG(hl->cfont->scName(), chx, 0, 0);
PS_restore();
}
}
2309,7 → 2309,7
}
else
{
PS_selectfont(hl->cfont->SCName, tsz / 10.0);
PS_selectfont(hl->cfont->scName(), tsz / 10.0);
PS_save();
PS_translate(hl->xp, -hl->yp);
if (ite->Reverse)
2343,7 → 2343,7
{
SetFarbe(hl->ccolor, hl->cshade, &h, &s, &v, &k, gcr);
PS_setcmykcolor_stroke(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
PS_show_xyG(hl->cfont->SCName, chx, 0, 0);
PS_show_xyG(hl->cfont->scName(), chx, 0, 0);
}
PS_restore();
}