r20001 by avox - #12973: Don't use AGL when we have a Apple Unicode cmap

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 12 17:38:05 UTC 2015


Author: avox
Date: Sun Apr 12 17:38:04 2015
New Revision: 20001

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20001
Log:
#12973: Don't use AGL when we have a Apple Unicode cmap

Modified:
    trunk/Scribus/scribus/fonts/ftface.cpp
    trunk/Scribus/scribus/fonts/ftface.h
    trunk/Scribus/scribus/fonts/scface_ttf.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.h

Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20001&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp (original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp Sun Apr 12 17:38:04 2015
@@ -9,6 +9,7 @@
 
 #include FT_OUTLINE_H
 #include FT_GLYPH_H
+#include FT_TRUETYPE_IDS_H
 
 #include <QObject>
 #include <QFile>
@@ -325,6 +326,12 @@
 	return result;
 }
 
+bool FtFace::hasMicrosoftUnicodeCmap(FT_Face face)
+{
+	return (face->charmap && face->charmap->encoding == FT_ENCODING_UNICODE && face->charmap->platform_id == TT_PLATFORM_MICROSOFT);
+}
+
+
 bool FtFace::glyphNames(QMap<uint, std::pair<QChar, QString> >& GList) const
 {
 	char buf[50];

Modified: trunk/Scribus/scribus/fonts/ftface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20001&path=/trunk/Scribus/scribus/fonts/ftface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.h (original)
+++ trunk/Scribus/scribus/fonts/ftface.h Sun Apr 12 17:38:04 2015
@@ -86,6 +86,7 @@
 
 	void RawData   (QByteArray & bb)            const;
 
+	static bool hasMicrosoftUnicodeCmap(FT_Face face);
 	static QString adobeGlyphName(FT_ULong charcode);
 	virtual bool glyphNames(QMap<uint, std::pair<QChar, QString> >& GList) const;
 

Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20001&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp Sun Apr 12 17:38:04 2015
@@ -546,8 +546,7 @@
 
 	// The glyph name table embedded in Truetype fonts is not reliable.
 	// For those fonts we consequently use Adobe Glyph names whenever possible.
-	const bool avoidFntNames = (formatCode != ScFace::TYPE42 && typeCode == ScFace::TTF) &&
-	                           (face->charmap && face->charmap->encoding == FT_ENCODING_UNICODE);
+	const bool avoidFntNames = (formatCode != ScFace::TYPE42 && typeCode == ScFace::TTF) && hasMicrosoftUnicodeCmap(face);
 	if (avoidFntNames)
 		return true; // We use Adobe 'uniXXXX' names in such case
 
@@ -565,8 +564,7 @@
 	
 	// The glyph name table embedded in Truetype fonts is not reliable.
 	// For those fonts we consequently use Adobe Glyph names whenever possible.
-	const bool avoidFntNames = (formatCode != ScFace::TYPE42 && typeCode == ScFace::TTF) &&
-	                           (face->charmap && face->charmap->encoding == FT_ENCODING_UNICODE);
+	const bool avoidFntNames = (formatCode != ScFace::TYPE42 && typeCode == ScFace::TTF) && hasMicrosoftUnicodeCmap(face);
 	if (!avoidFntNames)
 		return FtFace::glyphNames(GList);
 	

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20001&path=/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.cpp (original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.cpp Sun Apr 12 17:38:04 2015
@@ -314,6 +314,7 @@
 	return pmr;
 }
 
+#if 0
 bool GlyphNames(const FtFace& fnt, QMap<uint, std::pair<QChar, QString> >& GList)
 {
 	char buf[50];
@@ -383,7 +384,7 @@
 
 	return true;
 }
-
+#endif
 
 static int traceMoveto( FT_Vector *to, FPointArray *composite )
 {

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20001&path=/trunk/Scribus/scribus/fonts/scfontmetrics.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.h (original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.h Sun Apr 12 17:38:04 2015
@@ -32,6 +32,6 @@
 FPointArray SCRIBUS_API traceChar(FT_Face face, uint chr, int chs, qreal *x, qreal *y, bool *err);
 FPointArray SCRIBUS_API traceGlyph(FT_Face face, uint chr, int chs, qreal *x, qreal *y, bool *err);
 QPixmap     SCRIBUS_API FontSample(const ScFace& fnt, int s, QString ts, QColor back, bool force = false);
-bool        SCRIBUS_API GlyphNames(const FtFace& fnt, QMap<uint, std::pair<QChar, QString> >& GList);
+//bool        SCRIBUS_API GlyphNames(const FtFace& fnt, QMap<uint, std::pair<QChar, QString> >& GList);
 
 #endif




More information about the scribus-commit mailing list