Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 19360 → Rev 19359

/trunk/Scribus/scribus/fonts/scface_ttf.cpp
500,13 → 500,6
delete kernFeature;
}
 
bool ScFace_ttf::isSymbolic() const
{
FT_Face face = ftFace();
if (!face || !face->charmap)
return false;
return (m_face->charmap->encoding == FT_ENCODING_MS_SYMBOL);
}
 
void ScFace_ttf::load() const
{
/trunk/Scribus/scribus/fonts/ftface.h
74,7 → 74,7
QString pdfDescentAsString() const { return m_pdfDescender; }
QString pdfCapHeightAsString() const { return m_pdfCapHeight; }
QString pdfFontBBoxAsString() const { return m_pdfFontBBox; }
QString italicAngleAsString() const { return m_italicAngle; }
QString ItalicAngleAsString() const { return m_italicAngle; }
 
 
//FIXME QMap<QString,QString> fontDictionary(qreal sz=1.0) const;
/trunk/Scribus/scribus/fonts/scface.cpp
201,14 → 201,6
return NONE;
}
 
bool ScFace::isSymbolic() const
{
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->isSymbolic();
}
 
QString ScFace::pdfAscentAsString() const
{
if (m->status == ScFace::UNKNOWN) {
245,7 → 237,7
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->italicAngleAsString();
return m->ItalicAngleAsString();
}
 
qreal ScFace::ascent(qreal sz) const
/trunk/Scribus/scribus/fonts/scface.h
164,7 → 164,7
virtual QString pdfDescentAsString() const { return "0"; }
virtual QString pdfCapHeightAsString() const { return "0"; }
virtual QString pdfFontBBoxAsString() const { return "0 0 0 0"; }
virtual QString italicAngleAsString() const { return "0"; }
virtual QString ItalicAngleAsString() const { return "0"; }
virtual qreal descent(qreal /*sz*/) const { return 0.0; }
virtual qreal xHeight(qreal sz) const { return sz; }
virtual qreal capHeight(qreal sz) const { return sz; }
186,7 → 186,6
virtual FPointArray glyphOutline(uint gl, qreal sz) const;
virtual FPoint glyphOrigin (uint gl, qreal sz) const;
 
virtual bool isSymbolic() const { return false; }
};
 
 
201,9 → 200,6
/// test for null object
bool isNone() const { return m->status == NULLFACE; }
 
/// test if font is a symbolic font
bool isSymbolic() const;
 
ScFace& operator=(const ScFace& other);
/** two ScFaces are equal if they either are both NULLFACEs or they
agree on family, style, variant and fontpath
/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
113,7 → 113,8
//FT_Set_Charmap(face, face->charmaps[chmapUniCode]);
retVal = 0;
}
else if (foundEncoding)
else
if (foundEncoding)
{
// qDebug() << "using special enc for" << face->family_name << face->style_name;
mapToSet=chmapCustom;
138,7 → 139,7
gindex = 0;
int countCurrMap=0;
charcode = FT_Get_First_Char( face, &gindex );
while (gindex != 0)
while ( gindex != 0 )
{
countCurrMap++;
charcode = FT_Get_Next_Char( face, charcode, &gindex );
146,14 → 147,16
//If the last Unicode map we found before has more characters,
//then set it to be the current map.
if (countUniCode > countCurrMap)
if (countUniCode>countCurrMap)
{
// qDebug() << "override with Unicode enc for" << face->family_name << face->style_name << "map" << mapToSet << "has only" << countCurrMap << "glyphs";
mapToSet = chmapUniCode;
mapToSet=chmapUniCode;
//FT_Set_Charmap(face, face->charmaps[chmapUniCode]);
retVal = 0;
}
}
FT_Set_Charmap(face, face->charmaps[mapToSet]);
// if (face->charmap == NULL || mapToSet!=FT_Get_Charmap_Index(face->charmap))
FT_Set_Charmap(face, face->charmaps[mapToSet]);
// qDebug() << "set map" << mapToSet << "for" << face->family_name << face->style_name;
// qDebug() << "glyphsForNumbers 0-9:" << FT_Get_Char_Index(face, QChar('0').unicode())
// << FT_Get_Char_Index(face, QChar('1').unicode()) << FT_Get_Char_Index(face, QChar('2').unicode()) << FT_Get_Char_Index(face, QChar('3').unicode())
/trunk/Scribus/scribus/fonts/scface_ttf.h
98,8 → 98,6
 
qreal glyphKerning ( uint gl1, uint gl2, qreal sz ) const;
 
virtual bool isSymbolic() const;
 
private:
mutable KernFeature * kernFeature;
};
/trunk/Scribus/scribus/pdflib_core.cpp
1583,8 → 1583,7
++nglyphs;
// qDebug() << QString("pdflib: nglyphs %1 max %2").arg(nglyphs).arg(face.maxGlyph());
uint FontDes = fontDescriptor;
if ((face.isSymbolic() || Options.Version == PDFOptions::PDFVersion_X4) &&
(fformat == ScFace::SFNT || fformat == ScFace::TTCF))
if (Options.Version == PDFOptions::PDFVersion_X4 && (fformat == ScFace::SFNT || fformat == ScFace::TTCF))
{
uint fontWidths2 = newObject();
StartObj(fontWidths2);
5615,7 → 5614,7
else
idx1 = idx / 224;
ScFace currentFace = style.font();
if ((Options.Version == PDFOptions::PDFVersion_X4 || currentFace.isSymbolic())
if (Options.Version == PDFOptions::PDFVersion_X4
&& (currentFace.format() == ScFace::SFNT || currentFace.format() == ScFace::TTCF)
&& ( !Options.SubsetList.contains(style.font().replacementName()) ) )
tmp+= UsedFontsP[currentFace.replacementName()]+" "+FToStr(tsz / 10.0)+" Tf\n";
5725,8 → 5724,7
tmp += "<"+QString(toHex(idx2))+"> Tj\n";
}
}
else if ((Options.Version == PDFOptions::PDFVersion_X4 || currentFace.isSymbolic()) &&
(currentFace.format() == ScFace::SFNT || currentFace.format() == ScFace::TTCF))
else if (Options.Version == PDFOptions::PDFVersion_X4 && (currentFace.format() == ScFace::SFNT || currentFace.format() == ScFace::TTCF))
{
QString val;
val.setNum(idx,16);