Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 17776 → Rev 17778

/trunk/Scribus/scribus/pdflib_core.cpp
1523,8 → 1523,8
StartObj(fontDescriptor);
// TODO: think about QByteArray ScFace::getFontDescriptor() -- AV
PutDoc("<<\n/Type /FontDescriptor\n");
PutDoc("/FontName /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
PutDoc("/FontBBox [ "+face.fontBBoxAsString()+" ]\n");
PutDoc("/FontName /" + face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ) + "\n");
PutDoc("/FontBBox [ " + face.pdfFontBBoxAsString() + " ]\n");
PutDoc("/Flags ");
//FIXME: isItalic() should be queried from ScFace, not from Qt -- AV
//QFontInfo fo = QFontInfo(it.data());
1537,15 → 1537,10
// pfl = pfl ^ 4;
pfl = pfl ^ 32;
PutDoc(QString::number(pfl)+"\n");
PutDoc("/Ascent " + face.ascentAsString()+"\n");
PutDoc("/Descent " + face.descentAsString()+"\n");
PutDoc("/CapHeight " + face.capHeightAsString()+"\n");
PutDoc("/Ascent " + face.pdfAscentAsString()+"\n");
PutDoc("/Descent " + face.pdfDescentAsString()+"\n");
PutDoc("/CapHeight " + face.pdfCapHeightAsString()+"\n");
PutDoc("/ItalicAngle " + face.italicAngleAsString()+"\n");
// PutDoc("/Ascent "+QString::number(static_cast<int>(face.ascent()))+"\n");
// PutDoc("/Descent "+QString::number(static_cast<int>(face.descent()))+"\n");
// PutDoc("/CapHeight "+QString::number(static_cast<int>(face.capHeight()))+"\n");
// PutDoc("/ItalicAngle "+face.italicAngle()+"\n");
// PutDoc("/StemV "+ face.stemV() + "\n");
PutDoc("/StemV 1\n");
if ((fformat == ScFace::SFNT || fformat == ScFace::TTCF) && (Options.EmbedList.contains(it.key())))
PutDoc("/FontFile2 "+QString::number(embeddedFontObject)+" 0 R\n");
/trunk/Scribus/scribus/fonts/scface_ttf.cpp
273,9 → 273,7
quint16 SecondGlyph ( toUint16 ( recordBase ) );
qint16 Value1 ( toInt16 ( recordBase + 2 ) );
pairs[FirstGlyph][SecondGlyph] = double ( Value1 );
 
}
 
}
}
else
282,7 → 280,6
{
// qDebug() <<"ValueFormat1 is null or both ValueFormat1 and ValueFormat2 are null";
}
 
}
else if ( PosFormat == 2 ) // class kerning
{
606,7 → 603,7
str+="/FontName /" + psName + " def\n";
str+="/Encoding /ISOLatin1Encoding where {pop ISOLatin1Encoding} {StandardEncoding} ifelse def\n";
str+="/PaintType 0 def\n/FontMatrix [1 0 0 1 0 0] def\n";
str+="/FontBBox ["+FontBBox+"] def\n";
str+="/FontBBox ["+m_pdfFontBBox+"] def\n";
str+="/FontType 42 def\n";
str+="/FontInfo 8 dict dup begin\n";
str+="/FamilyName (" + psName + ") def\n";
/trunk/Scribus/scribus/fonts/scface.cpp
201,35 → 201,35
return NONE;
}
 
QString ScFace::ascentAsString() const
QString ScFace::pdfAscentAsString() const
{
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->ascentAsString();
return m->pdfAscentAsString();
}
 
QString ScFace::descentAsString() const
QString ScFace::pdfDescentAsString() const
{
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->descentAsString();
return m->pdfDescentAsString();
}
QString ScFace::capHeightAsString() const
QString ScFace::pdfCapHeightAsString() const
{
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->capHeightAsString();
return m->pdfCapHeightAsString();
}
 
QString ScFace::fontBBoxAsString() const
QString ScFace::pdfFontBBoxAsString() const
{
if (m->status == ScFace::UNKNOWN) {
m->load();
}
return m->FontBBoxAsString();
return m->pdfFontBBoxAsString();
}
 
QString ScFace::italicAngleAsString() const
/trunk/Scribus/scribus/fonts/ftface.cpp
111,11 → 111,14
m_strikeoutPos = m_ascent / 3;
m_strokeWidth = m_face->underline_thickness / m_uniEM;
const_cast<FtFace*>(this)->isFixedPitch = m_face->face_flags & 4;
Ascent = QString::number(m_face->ascender);
CapHeight = QString::number(m_face->height);
Descender = QString::number(m_face->descender);
FontBBox = QString::number(m_face->bbox.xMin)+" "+QString::number(m_face->bbox.yMin)+" "+QString::number(m_face->bbox.xMax)+" "+QString::number(m_face->bbox.yMax);
ItalicAngle = "0";
m_pdfAscent = QString::number(m_face->ascender / m_uniEM * 1000);
m_pdfCapHeight = QString::number(m_face->height / m_uniEM * 1000);
m_pdfDescender = QString::number(m_face->descender / m_uniEM * 1000);
m_pdfFontBBox = QString::number(m_face->bbox.xMin / m_uniEM * 1000) + " " +
QString::number(m_face->bbox.yMin / m_uniEM * 1000) + " " +
QString::number(m_face->bbox.xMax / m_uniEM * 1000) + " " +
QString::number(m_face->bbox.yMax / m_uniEM * 1000);
m_italicAngle = "0";
 
//FIXME: FT_Set_Charmap(m_face, m_face->charmaps[m_encoding]);
setBestEncoding(m_face);
/trunk/Scribus/scribus/fonts/scface.h
160,12 → 160,12
 
// dummy implementations
virtual qreal ascent(qreal sz) const { return sz; }
virtual QString ascentAsString() const { return "0" ; }
virtual QString descentAsString() const { return "0"; }
virtual QString capHeightAsString() const { return "0"; }
virtual QString FontBBoxAsString() const { return "0 0 0 0"; }
virtual QString pdfAscentAsString() const { return "0" ; }
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 qreal descent(qreal /*sz*/) const { return 0.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; }
virtual qreal height(qreal sz) const { return sz; }
307,11 → 307,11
QString variant() const { return m->variant; }
// font metrics
QString ascentAsString() const;
QString descentAsString() const;
QString capHeightAsString() const;
QString fontBBoxAsString() const;
QString italicAngleAsString() const;
QString pdfAscentAsString() const;
QString pdfDescentAsString() const;
QString pdfCapHeightAsString() const;
QString pdfFontBBoxAsString() const;
QString italicAngleAsString() const;
qreal ascent(qreal sz=1.0) const;
qreal descent(qreal sz=1.0) const;
qreal xHeight(qreal sz=1.0) const;
/trunk/Scribus/scribus/fonts/ftface.h
70,11 → 70,11
qreal underlinePos(qreal sz=1.0) const { return m_underlinePos * sz; }
qreal strokeWidth(qreal /*sz*/) const { return m_strokeWidth; }
qreal maxAdvanceWidth(qreal sz=1.0) const { return m_maxAdvanceWidth * sz; }
QString ascentAsString() const { return Ascent; }
QString descentAsString() const { return Descender; }
QString capHeightAsString() const { return CapHeight; }
QString FontBBoxAsString() const { return FontBBox; }
QString ItalicAngleAsString() const { return ItalicAngle; }
QString pdfAscentAsString() const { return m_pdfAscent; }
QString pdfDescentAsString() const { return m_pdfDescender; }
QString pdfCapHeightAsString() const { return m_pdfCapHeight; }
QString pdfFontBBoxAsString() const { return m_pdfFontBBox; }
QString ItalicAngleAsString() const { return m_italicAngle; }
//FIXME QMap<QString,QString> fontDictionary(qreal sz=1.0) const;
95,13 → 95,13
static FT_Library library;
 
mutable QString Ascent;
mutable QString CapHeight;
mutable QString Descender;
mutable QString ItalicAngle;
mutable QString m_pdfAscent;
mutable QString m_pdfCapHeight;
mutable QString m_pdfDescender;
mutable QString m_italicAngle;
mutable QString m_pdfFontBBox;
mutable QString StdVW;
QString FontEnc;
mutable QString FontBBox;
 
mutable int m_encoding;