/branches/Version13x/Scribus/scribus/tabpdfoptions.h |
---|
39,6 → 39,7 |
~TabPDFOptions() {}; |
void restoreDefaults(); |
SCFonts *AllFontsP; |
QWidget* tabGeneral; |
QWidget* tabFonts; |
QWidget* tabPresentation; |
/branches/Version13x/Scribus/scribus/scfonts_ttf.cpp |
---|
44,8 → 44,6 |
FPointArray outlines; |
double x, y; |
struct GlyphR GRec; |
char *buf[50]; |
QString glyName = ""; |
error = FT_Init_FreeType( &library ); |
if (error) |
{ |
62,7 → 60,6 |
} |
uniEM = static_cast<double>(face->units_per_EM); |
HasKern = FT_HAS_KERNING(face); |
HasNames = FT_HAS_GLYPH_NAMES(face); |
Ascent = tmp.setNum(face->ascender * 1000 / uniEM); |
Descender = tmp.setNum(face->descender * 1000 / uniEM); |
CapHeight = Ascent; |
104,12 → 101,6 |
GRec.y = y; |
GlyphArray.insert(charcode, GRec); |
} |
/* The following lines are a check for some weired fonts which have invalid "post" tables */ |
FT_Get_Glyph_Name(face, gindex, buf, 50); |
QString newName = QString(reinterpret_cast<char*>(buf)); |
if (newName == glyName) |
HasNames = false; |
glyName = newName; |
charcode = FT_Get_Next_Char( face, charcode, &gindex ); |
} |
UseFont = (invalidGlyphs == 0); |
/branches/Version13x/Scribus/scribus/about.cpp |
---|
46,7 → 46,7 |
tabLayout1->addWidget( pixmapLabel1 ); |
buildID = new QLabel( tab, "BB" ); |
buildID->setAlignment(Qt::AlignCenter); |
QString BUILD_DAY = "11"; |
QString BUILD_DAY = "14"; |
QString BUILD_MONTH = tr("October"); |
QString BUILD_YEAR = "2005"; |
QString BUILD_TIME = ""; |
/branches/Version13x/Scribus/scribus/tabpdfoptions.cpp |
---|
36,6 → 36,7 |
unitRatio = unitGetRatioFromIndex(unitIndex); |
FontsToEmbed.clear(); |
AllFontsP = &AllFonts; |
view = vie; |
EffVal = Eff; |
Opts = Optionen; |
1312,28 → 1313,69 |
{ |
if (EmbedList->count() != 0) |
{ |
if (EmbedList->findItem(AvailFlist->currentText()) == NULL) |
if (!(*AllFontsP)[AvailFlist->currentText()]->Subset) |
{ |
FontsToEmbed.append(AvailFlist->currentText()); |
EmbedList->insertItem(AvailFlist->currentText()); |
if (EmbedList->findItem(AvailFlist->currentText()) == NULL) |
{ |
FontsToEmbed.append(AvailFlist->currentText()); |
EmbedList->insertItem(AvailFlist->currentText()); |
} |
} |
else |
{ |
if (SubsetList->count() != 0) |
{ |
if (SubsetList->findItem(AvailFlist->currentText()) == NULL) |
{ |
FontsToSubset.append(AvailFlist->currentText()); |
SubsetList->insertItem(AvailFlist->currentText()); |
} |
} |
else |
{ |
FontsToSubset.append(AvailFlist->currentText()); |
SubsetList->insertItem(AvailFlist->currentText()); |
} |
} |
} |
else |
{ |
FontsToEmbed.append(AvailFlist->currentText()); |
EmbedList->insertItem(AvailFlist->currentText()); |
if (!(*AllFontsP)[AvailFlist->currentText()]->Subset) |
{ |
FontsToEmbed.append(AvailFlist->currentText()); |
EmbedList->insertItem(AvailFlist->currentText()); |
} |
else |
{ |
if (SubsetList->count() != 0) |
{ |
if (SubsetList->findItem(AvailFlist->currentText()) == NULL) |
{ |
FontsToSubset.append(AvailFlist->currentText()); |
SubsetList->insertItem(AvailFlist->currentText()); |
} |
} |
else |
{ |
FontsToSubset.append(AvailFlist->currentText()); |
SubsetList->insertItem(AvailFlist->currentText()); |
} |
} |
} |
} |
void TabPDFOptions::RemoveSubset() |
{ |
FontsToSubset.remove(SubsetList->currentText()); |
FontsToEmbed.append(SubsetList->currentText()); |
EmbedList->insertItem(SubsetList->currentText()); |
SubsetList->removeItem(SubsetList->currentItem()); |
SubsetList->clearSelection(); |
if (SubsetList->count() == 0) |
FromSubset->setEnabled(false); |
if (!(*AllFontsP)[SubsetList->currentText()]->Subset) |
{ |
FontsToSubset.remove(SubsetList->currentText()); |
FontsToEmbed.append(SubsetList->currentText()); |
EmbedList->insertItem(SubsetList->currentText()); |
SubsetList->removeItem(SubsetList->currentItem()); |
SubsetList->clearSelection(); |
if (SubsetList->count() == 0) |
FromSubset->setEnabled(false); |
} |
} |
void TabPDFOptions::PutToSubset() |
1419,8 → 1461,16 |
{ |
if (AvailFlist->item(a)->isSelectable()) |
{ |
FontsToEmbed.append(AvailFlist->item(a)->text()); |
EmbedList->insertItem(AvailFlist->item(a)->text()); |
if (!(*AllFontsP)[AvailFlist->item(a)->text()]->Subset) |
{ |
FontsToEmbed.append(AvailFlist->item(a)->text()); |
EmbedList->insertItem(AvailFlist->item(a)->text()); |
} |
else |
{ |
FontsToSubset.append(AvailFlist->item(a)->text()); |
SubsetList->insertItem(AvailFlist->item(a)->text()); |
} |
} |
} |
} |
/branches/Version13x/Scribus/scribus/fontprefs.h |
---|
45,6 → 45,7 |
bool FlagUse; |
bool FlagSub; |
bool FlagOTF; |
bool FlagNames; |
}; |
QMap<QString, fontSet> fontFlags; |
QPtrList<QComboBox> FlagsRepl; |
/branches/Version13x/Scribus/scribus/scfonts.cpp |
---|
230,8 → 230,6 |
FT_ULong charcode; |
FT_UInt gindex; |
FT_Face face; |
char *buf[50]; |
QString glyName = ""; |
isStroked = false; |
error = FT_Init_FreeType( &library ); |
if (error) |
260,7 → 258,6 |
if (afm.exists()) |
error = FT_Attach_File(face, afm.name()); |
HasKern = FT_HAS_KERNING(face); |
HasNames = FT_HAS_GLYPH_NAMES(face); |
Ascent = tmp.setNum(face->ascender); |
Descender = tmp.setNum(face->descender); |
numDescender = face->descender / uniEM; |
302,12 → 299,6 |
GRec.y = y; |
GlyphArray.insert(charcode, GRec); |
} |
/* The following lines are a check for some weired fonts which have invalid "post" tables */ |
FT_Get_Glyph_Name(face, gindex, buf, 50); |
QString newName = QString(reinterpret_cast<char*>(buf)); |
if (newName == glyName) |
HasNames = false; |
glyName = newName; |
charcode = FT_Get_Next_Char( face, charcode, &gindex ); |
} |
FT_Done_Face( face ); |
650,6 → 641,9 |
bool SCFonts::AddScalableFont(QString filename, FT_Library &library, QString DocName) |
{ |
static bool firstRun; |
bool Subset = false; |
char *buf[50]; |
QString glyName = ""; |
Foi::FontFormat format; |
Foi::FontType type; |
FT_Face face = NULL; |
679,6 → 673,7 |
checkedFonts.insert(filename, foCache); |
error = true; |
} |
bool HasNames = FT_HAS_GLYPH_NAMES(face); |
if (!error) |
{ |
if (!checkedFonts.contains(filename)) |
699,6 → 694,14 |
checkedFonts.insert(filename, foCache); |
return true; |
} |
FT_Get_Glyph_Name(face, gindex, buf, 50); |
QString newName = QString(reinterpret_cast<char*>(buf)); |
if (newName == glyName) |
{ |
HasNames = false; |
Subset = true; |
} |
glyName = newName; |
charcode = FT_Get_Next_Char( face, charcode, &gindex ); |
} |
foCache.isOK = true; |
728,6 → 731,14 |
checkedFonts.insert(filename, foCache); |
return true; |
} |
FT_Get_Glyph_Name(face, gindex, buf, 50); |
QString newName = QString(reinterpret_cast<char*>(buf)); |
if (newName == glyName) |
{ |
HasNames = false; |
Subset = true; |
} |
glyName = newName; |
charcode = FT_Get_Next_Char( face, charcode, &gindex ); |
} |
foCache.isOK = true; |
789,9 → 800,11 |
{ |
case Foi::PFA: |
t = new Foi_pfa(fam, sty, ts, qpsName, filename, faceindex, true); |
t->Subset = Subset; |
break; |
case Foi::PFB: |
t = new Foi_pfb(fam, sty, ts, qpsName, filename, faceindex, true); |
t->Subset = Subset; |
break; |
case Foi::SFNT: |
t = new Foi_ttf(fam, sty, ts, qpsName, filename, faceindex, true); |
801,6 → 814,8 |
t->isOTF = true; |
t->Subset = true; |
} |
else |
t->Subset = Subset; |
break; |
case Foi::TTCF: |
t = new Foi_ttf(fam, sty, ts, qpsName, filename, faceindex, true); |
812,6 → 827,8 |
t->isOTF = true; |
t->Subset = true; |
} |
else |
t->Subset = Subset; |
break; |
case Foi::TYPE42: |
t = new Foi_ttf(fam, sty, ts, qpsName, filename, faceindex, true); |
821,9 → 838,12 |
t->isOTF = true; |
t->Subset = true; |
} |
else |
t->Subset = Subset; |
break; |
} |
insert(ts,t); |
t->HasNames = HasNames; |
t->EmbedPS = true; |
t->UseFont = true; |
t->CharWidth[13] = 0; |
1017,10 → 1037,14 |
void SCFonts::ReadCacheList(QString pf) |
{ |
QFile fr(pf + "/cfonts.xml"); |
QFileInfo fir(fr); |
if (fir.exists()) |
fr.remove(); |
checkedFonts.clear(); |
struct testCache foCache; |
QDomDocument docu("fontcacherc"); |
QFile f(pf + "/cfonts.xml"); |
QFile f(pf + "/checkfonts.xml"); |
if(!f.open(IO_ReadOnly)) |
return; |
ScApp->setSplashStatus( QObject::tr("Reading Font Cache") ); |
1071,7 → 1095,7 |
} |
} |
ScApp->setSplashStatus( QObject::tr("Writing updated Font Cache") ); |
QFile f(pf + "/cfonts.xml"); |
QFile f(pf + "/checkfonts.xml"); |
if(f.open(IO_WriteOnly)) |
{ |
QTextStream s(&f); |
/branches/Version13x/Scribus/scribus/fontprefs.cpp |
---|
94,6 → 94,7 |
if (type == Foi::OTF) |
row->setPixmap(0, otfFont); |
} |
foS.FlagNames = it.current()->HasNames; |
row->setText(4, it.current()->fontPath()); |
fontFlags.insert(it.currentKey(), foS); |
} |
217,7 → 218,7 |
else |
ite->setPixmap(2, empty); |
} |
if ((col == 3) && (!fontFlags[tmp].FlagOTF)) |
if ((col == 3) && (!fontFlags[tmp].FlagOTF) && (!fontFlags[tmp].FlagNames)) |
{ |
fontFlags[tmp].FlagSub = !fontFlags[tmp].FlagSub; |
if (fontFlags[tmp].FlagSub) |
424,12 → 425,11 |
if (type == Foi::OTF) |
row->setPixmap(0, otfFont); |
} |
foS.FlagNames = it.current()->HasNames; |
row->setText(4, it.current()->fontPath()); |
fontFlags.insert(it.currentKey(), foS); |
} |
//fontList->setSorting(0); |
fontList->sort(); |
UsedFonts.sort(); |
//fontList->setSorting(-1); |
UpdateFliste(); |
} |