r22144 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Fri Aug 25 10:49:13 UTC 2017
Author: jghali
Date: Fri Aug 25 10:49:13 2017
New Revision: 22144
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22144
Log:
ScFace / FtFace refactoring: rename EmbedFont() and RawData() to match code style
Modified:
trunk/Scribus/scribus/fonts/ftface.cpp
trunk/Scribus/scribus/fonts/ftface.h
trunk/Scribus/scribus/fonts/scface.cpp
trunk/Scribus/scribus/fonts/scface.h
trunk/Scribus/scribus/fonts/scface_ps.h
trunk/Scribus/scribus/fonts/scface_ttf.cpp
trunk/Scribus/scribus/fonts/scface_ttf.h
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/scfonts.cpp
Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp (original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp Fri Aug 25 10:49:13 2017
@@ -424,7 +424,7 @@
return uniStr.toUpper();
}
-void FtFace::RawData(QByteArray & bb) const
+void FtFace::rawData(QByteArray & bb) const
{
FT_Stream fts = ftFace()->stream;
bb.resize(fts->size);
Modified: trunk/Scribus/scribus/fonts/ftface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/ftface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.h (original)
+++ trunk/Scribus/scribus/fonts/ftface.h Fri Aug 25 10:49:13 2017
@@ -85,7 +85,7 @@
// GlyphMetrics glyphBBox (gid_type gl, qreal sz) const;
- void RawData (QByteArray & bb) const;
+ void rawData (QByteArray & bb) const;
static bool hasMicrosoftUnicodeCmap(FT_Face face);
static QString adobeGlyphName(FT_ULong charcode);
Modified: trunk/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface.cpp Fri Aug 25 10:49:13 2017
@@ -507,12 +507,12 @@
}
}
-bool ScFace::EmbedFont(QByteArray &str)
-{
- if (m_m->status == ScFace::UNKNOWN) {
- m_m->load();
- }
- return m_m->EmbedFont(str);
+bool ScFace::embedFont(QByteArray &str)
+{
+ if (m_m->status == ScFace::UNKNOWN) {
+ m_m->load();
+ }
+ return m_m->embedFont(str);
}
@@ -525,12 +525,12 @@
}
-void ScFace::RawData(QByteArray & bb)
-{
- if (m_m->status == ScFace::UNKNOWN) {
- m_m->load();
- }
- m_m->RawData(bb);
+void ScFace::rawData(QByteArray & bb)
+{
+ if (m_m->status == ScFace::UNKNOWN) {
+ m_m->load();
+ }
+ m_m->rawData(bb);
}
void ScFace::checkAllGlyphs()
Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h (original)
+++ trunk/Scribus/scribus/fonts/scface.h Fri Aug 25 10:49:13 2017
@@ -195,8 +195,8 @@
virtual gid_type char2CMap(uint /*ch*/) const { return 0; }
virtual QMap<QString,QString> fontDictionary(qreal sz=1.0) const;
virtual GlyphMetrics glyphBBox(gid_type gl, qreal sz) const;
- virtual bool EmbedFont(QByteArray &/*str*/) const { return false; }
- virtual void RawData(QByteArray & /*bb*/) const {}
+ virtual bool embedFont(QByteArray &/*str*/) const { return false; }
+ virtual void rawData(QByteArray & /*bb*/) const {}
virtual FT_Face ftFace() const { return 0; }
virtual void* hbFont();
@@ -238,8 +238,8 @@
bool operator!=(const ScFace& other) const { return ! (*this == other); }
- bool EmbedFont(QByteArray &str);
- void RawData(QByteArray & bb);
+ bool embedFont(QByteArray &str);
+ void rawData(QByteArray & bb);
bool glyphNames(FaceEncoding& gList);
/// prevent unloading of face data
Modified: trunk/Scribus/scribus/fonts/scface_ps.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/scface_ps.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ps.h (original)
+++ trunk/Scribus/scribus/fonts/scface_ps.h Fri Aug 25 10:49:13 2017
@@ -104,7 +104,7 @@
/*
Class ScFace_pfb
Subclass of ScFace, specifically for Adobe type 1 .pfb fonts.
- Implements: RealName() and EmbedFont().
+ Implements: realName() and embedFont().
*/
class ScFace_pfb : public ScFace_postscript
@@ -116,10 +116,10 @@
formatCode = ScFace::PFB;
}
- virtual bool EmbedFont(QByteArray &str) const
+ virtual bool embedFont(QByteArray &str) const
{
QByteArray bb;
- RawData(bb);
+ rawData(bb);
// QString tmp2 = "";
if ((bb.size() > 2) && (bb[0] == char(0x80)) && (static_cast<int>(bb[1]) == 1))
{
@@ -191,7 +191,7 @@
/*
Class ScFace_pfa
Subclass of ScFace, specifically for Adobe type 1 and type 3 .pfa fonts.
- Implements: RealName() and EmbedFont().
+ Implements: realName() and embedFont().
*/
class ScFace_pfa : public ScFace_postscript
@@ -202,10 +202,10 @@
{
formatCode = ScFace::PFA;
}
- virtual bool EmbedFont(QByteArray &str) const
+ virtual bool embedFont(QByteArray &str) const
{
QByteArray bb;
- RawData(bb);
+ rawData(bb);
if (bb.size() > 2 && bb[0] == '%' && bb[1] == '!')
{
// this is ok since bb will not contain '\0'
Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp Fri Aug 25 10:49:13 2017
@@ -102,10 +102,10 @@
return true;
}
-void ScFace_ttf::RawData(QByteArray & bb) const {
+void ScFace_ttf::rawData(QByteArray & bb) const {
if (formatCode == ScFace::TTCF) {
QByteArray coll;
- FtFace::RawData(coll);
+ FtFace::rawData(coll);
// access table for faceIndex
if (faceIndex >= static_cast<int>(sfnt::word(coll, 8)))
{
@@ -155,17 +155,17 @@
}
}
else if (formatCode == ScFace::TYPE42) {
- FtFace::RawData(bb);
+ FtFace::rawData(bb);
}
else {
- FtFace::RawData(bb);
- }
-}
-
-bool ScFace_ttf::EmbedFont(QByteArray &str) const
+ FtFace::rawData(bb);
+ }
+}
+
+bool ScFace_ttf::embedFont(QByteArray &str) const
{
QByteArray bb;
- FtFace::RawData(bb);
+ FtFace::rawData(bb);
if (formatCode == ScFace::TYPE42) {
//easy:
str = bb;
Modified: trunk/Scribus/scribus/fonts/scface_ttf.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/fonts/scface_ttf.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.h (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.h Fri Aug 25 10:49:13 2017
@@ -15,7 +15,7 @@
/*
Class ScFace_ttf
Subclass of ScFace, specifically for TrueType fonts.
- Implements: RealName() and EmbedFont().
+ Implements: realName() and embedFont().
*/
class SCRIBUS_API ScFace_ttf : public FtFace
@@ -27,8 +27,8 @@
void load () const;
void unload () const;
- bool EmbedFont(QByteArray &str) const;
- void RawData(QByteArray & bb) const;
+ bool embedFont(QByteArray &str) const;
+ void rawData(QByteArray & bb) const;
virtual bool glyphNames(ScFace::FaceEncoding& GList) const;
virtual bool hasNames() const;
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Fri Aug 25 10:49:13 2017
@@ -2140,7 +2140,7 @@
PdfFont PDFLibCore::PDF_WriteTtfSubsetFont(const QByteArray& fontName, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs)
{
QByteArray font;
- face.RawData(font);
+ face.rawData(font);
/*dumpFont(face.psName() + ".ttf", font);*/
QList<ScFace::gid_type> glyphs = RealGlyphs.uniqueKeys();
glyphs.removeAll(0);
@@ -2170,7 +2170,7 @@
PdfFont PDFLibCore::PDF_WriteCffSubsetFont(const QByteArray& fontName, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs)
{
// QByteArray sfnt; //TEST
-// face.RawData(sfnt);
+// face.rawData(sfnt);
// QByteArray cff = sfnt::getTable(sfnt, "CFF ");
// dumpFont(fontName, cff);
// cff::CFF cfffont(cff);
@@ -2183,7 +2183,7 @@
// // END
QByteArray font, data;
- face.RawData(data);
+ face.rawData(data);
font = sfnt::getTable(data, "CFF ");
/*dumpFont(face.psName() + ".cff", font);*/
QList<ScFace::gid_type> glyphs = RealGlyphs.uniqueKeys();
@@ -2312,7 +2312,7 @@
{
ScFace::FontFormat fformat = face.format();
QByteArray bb;
- face.RawData(bb);
+ face.rawData(bb);
if (fformat == ScFace::PFB)
{
embeddedFontObject = PDF_EmbedType1BinaryFontObject(bb);
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22144&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Fri Aug 25 10:49:13 2017
@@ -867,7 +867,7 @@
/*
//debug
QByteArray bb;
- t->RawData(bb);
+ t->rawData(bb);
QFile dump(QString("/tmp/fonts/%1-%2").arg(ts).arg(psName));
dump.open(IO_WriteOnly);
QDataStream os(&dump);
More information about the scribus-commit
mailing list