r24720 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Sun Oct 3 02:51:58 UTC 2021
Author: jghali
Date: Sun Oct 3 02:51:58 2021
New Revision: 24720
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24720
Log:
Code cleanup
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
Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24720&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp (original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp Sun Oct 3 02:51:58 2021
@@ -41,20 +41,6 @@
*****/
FtFace::FtFace(const QString& fam, const QString& sty, const QString& vari, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features)
- : m_face(nullptr),
- m_isBold(false),
- m_isItalic(false),
- m_encoding(0.0),
- m_uniEM(0.0),
- m_ascent(0.0),
- m_descent(0.0),
- m_height(0.0),
- m_xHeight(0.0),
- m_capHeight(0.0),
- m_maxAdvanceWidth(0.0),
- m_underlinePos(0.0),
- m_strikeoutPos(0.0),
- m_strokeWidth(0.0)
{
family = fam;
style = sty;
@@ -70,7 +56,8 @@
}
-FtFace::~FtFace() {
+FtFace::~FtFace()
+{
unload();
}
Modified: trunk/Scribus/scribus/fonts/ftface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24720&path=/trunk/Scribus/scribus/fonts/ftface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.h (original)
+++ trunk/Scribus/scribus/fonts/ftface.h Sun Oct 3 02:51:58 2021
@@ -55,10 +55,9 @@
FtFace(const QString& fam, const QString& sty, const QString& variant, const QString& scname,
const QString& psname, const QString& path, int face, const QStringList& features);
+ ~FtFace() override;
FT_Face ftFace() const override;
-
- virtual ~FtFace();
// font metrics
qreal ascent(qreal sz=1.0) const override { return m_ascent * sz; }
@@ -97,12 +96,12 @@
void loadGlyph (ScFace::gid_type gl) const override;
protected:
- mutable FT_Face m_face;
+ mutable FT_Face m_face { nullptr };
static FT_Library m_library;
- mutable bool m_isBold;
- mutable bool m_isItalic;
+ mutable bool m_isBold { false };
+ mutable bool m_isItalic { false };
mutable QString m_pdfAscent;
mutable QString m_pdfCapHeight;
@@ -110,18 +109,18 @@
mutable QString m_italicAngle;
mutable QString m_pdfFontBBox;
- mutable int m_encoding;
+ mutable int m_encoding { 0 };
- mutable qreal m_uniEM;
- mutable qreal m_ascent;
- mutable qreal m_descent;
- mutable qreal m_height;
- mutable qreal m_xHeight;
- mutable qreal m_capHeight;
- mutable qreal m_maxAdvanceWidth;
- mutable qreal m_underlinePos;
- mutable qreal m_strikeoutPos;
- mutable qreal m_strokeWidth;
+ mutable qreal m_uniEM { 0.0 };
+ mutable qreal m_ascent { 0.0 };
+ mutable qreal m_descent { 0.0 };
+ mutable qreal m_height { 0.0 };
+ mutable qreal m_xHeight { 0.0 };
+ mutable qreal m_capHeight { 0.0 };
+ mutable qreal m_maxAdvanceWidth { 0.0 };
+ mutable qreal m_underlinePos { 0.0 };
+ mutable qreal m_strikeoutPos { 0.0 };
+ mutable qreal m_strokeWidth { 0.0 };
QString uniGlyphNameToUnicode(const QString& glyphName) const;
};
Modified: trunk/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24720&path=/trunk/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface.cpp Sun Oct 3 02:51:58 2021
@@ -385,7 +385,6 @@
// clear caches
m_m->m_glyphWidth.clear();
m_m->m_glyphOutline.clear();
- //m->m_cMap.clear();
m_m->status = ScFace::UNKNOWN;
}
Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24720&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h (original)
+++ trunk/Scribus/scribus/fonts/scface.h Sun Oct 3 02:51:58 2021
@@ -154,7 +154,6 @@
// caches
mutable QHash<gid_type, qreal> m_glyphWidth;
mutable QHash<gid_type, GlyphData> m_glyphOutline;
- //mutable QHash<gid_type, uint> m_cMap;
void* m_hbFont {nullptr};
// fill caches & members
@@ -163,7 +162,6 @@
{
m_glyphWidth.clear();
m_glyphOutline.clear();
- //m_cMap.clear();
status = qMax(m_cachedStatus, ScFace::LOADED);
}
@@ -172,7 +170,6 @@
{
m_glyphWidth.clear();
m_glyphOutline.clear();
- //m_cMap.clear();
status = ScFace::UNKNOWN;
}
More information about the scribus-commit
mailing list