r21067 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 6 11:32:22 UTC 2016
Author: jghali
Date: Sun Mar 6 11:32:22 2016
New Revision: 21067
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21067
Log:
#13293: Crashes with assertion failure while exporting PDF embedding Noto Sans Ja fonts
Modified:
trunk/Scribus/scribus/fonts/ftface.cpp
trunk/Scribus/scribus/fonts/scface.cpp
trunk/Scribus/scribus/fonts/scface.h
trunk/Scribus/scribus/pdflib_core.cpp
Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21067&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp (original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp Sun Mar 6 11:32:22 2016
@@ -7,6 +7,7 @@
#include "fonts/ftface.h"
+#include FT_CID_H
#include FT_OUTLINE_H
#include FT_GLYPH_H
#include FT_TRUETYPE_IDS_H
@@ -89,6 +90,10 @@
}
}
+ FT_Bool isCID = false;
+ FT_Get_CID_Is_Internally_CID_Keyed(m_face, &isCID);
+
+ const_cast<FtFace*>(this)->isCIDFont = isCID;
const_cast<FtFace*>(this)->isStroked = false;
const_cast<FtFace*>(this)->hasGlyphNames = FT_HAS_GLYPH_NAMES(m_face);
Modified: trunk/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21067&path=/trunk/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface.cpp Sun Mar 6 11:32:22 2016
@@ -23,6 +23,7 @@
embedPs(false),
subset(false),
outline(false),
+ isCIDFont(false),
isStroked(false),
isFixedPitch(false),
hasGlyphNames(false),
Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21067&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h (original)
+++ trunk/Scribus/scribus/fonts/scface.h Sun Mar 6 11:32:22 2016
@@ -122,8 +122,9 @@
bool usable;
bool embedPs;
bool subset;
- bool outline;
-
+ bool outline;
+
+ bool isCIDFont;
bool isStroked;
bool isFixedPitch;
bool hasGlyphNames;
@@ -185,6 +186,7 @@
virtual bool EmbedFont(QByteArray &/*str*/) const { return false; }
virtual void RawData(QByteArray & /*bb*/) const {}
+ virtual bool isCIDKeyed() const { return isCIDFont; }
virtual bool hasNames() const { return hasGlyphNames; }
virtual bool glyphNames(QMap<gid_type, std::pair<ucs4_type, QString> >& gList) const;
@@ -299,6 +301,9 @@
/// deprecated? tells if the face has PS names
bool hasNames() const { return m_m->hasNames(); }
+
+ /// tells if the font is a CID font
+ virtual bool isCIDKeyed() const { return m_m->isCIDFont; }
/// tells if this font is an outline font
bool isStroked() const { return m_m->isStroked; }
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21067&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sun Mar 6 11:32:22 2016
@@ -1987,6 +1987,10 @@
if (face.type() == ScFace::TTF)
{
pdfFont = PDF_WriteTtfSubsetFont(fontName, face, usedGlyphs);
+ }
+ else if (face.isCIDKeyed())
+ {
+ pdfFont = PDF_WriteType3Font(fontName, face, usedGlyphs);
}
else
{
More information about the scribus-commit
mailing list