summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@theqtcompany.com>2016-04-05 16:52:11 -0700
committerJake Petroules <jake.petroules@theqtcompany.com>2016-04-06 22:42:55 +0000
commit3ddb2c325e832afc7deef7a48c130408130f0d9e (patch)
treeb9f8de13c091fc15937d66f8508bfc30c461f391 /src
parent140a273b3c01e8eb3664f14410539339454527d8 (diff)
Fix QPrinter PDF output using fonts with spaces in the PostScript name.
Task-number: QTBUG-52352 Done-with: Andy Shaw <andy.shaw@theqtcompany.com> Change-Id: Id8dcb4a57520c2cc53483672f6578e5ab0bb5de5 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpdf.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index d68d719c39..22a387bd28 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1556,6 +1556,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
int toUnicode = requestObject();
QFontEngine::Properties properties = font->fontEngine->properties();
+ QByteArray postscriptName = properties.postscriptName.replace(' ', '_');
{
qreal scale = 1000/properties.emSquare.toReal();
@@ -1569,7 +1570,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
s << (char)('A' + (tag % 26));
tag /= 26;
}
- s << '+' << properties.postscriptName << "\n"
+ s << '+' << postscriptName << "\n"
"/Flags " << 4 << "\n"
"/FontBBox ["
<< properties.boundingBox.x()*scale
@@ -1612,7 +1613,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
QPdf::ByteStream s(&cid);
s << "<< /Type /Font\n"
"/Subtype /CIDFontType2\n"
- "/BaseFont /" << properties.postscriptName << "\n"
+ "/BaseFont /" << postscriptName << "\n"
"/CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >>\n"
"/FontDescriptor " << fontDescriptor << "0 R\n"
"/CIDToGIDMap /Identity\n"
@@ -1636,7 +1637,7 @@ void QPdfEnginePrivate::embedFont(QFontSubset *font)
QPdf::ByteStream s(&font);
s << "<< /Type /Font\n"
"/Subtype /Type0\n"
- "/BaseFont /" << properties.postscriptName << "\n"
+ "/BaseFont /" << postscriptName << "\n"
"/Encoding /Identity-H\n"
"/DescendantFonts [" << cidfont << "0 R]\n"
"/ToUnicode " << toUnicode << "0 R"