diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-05 13:46:47 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-05 13:46:47 (GMT) |
commit | ad04d96fdac0fea252096d5144abf684516cbb10 (patch) | |
tree | 50e9defb39955db39116677f2eef3d72e8053a26 /src/gui/text/qfontengine.cpp | |
parent | 1200bf9f82860d2f391a4b68ce25c606eb9a0831 (diff) | |
parent | bbaf34b1f5ac4e6d425eab183112b504b9ed4e83 (diff) | |
download | Qt-ad04d96fdac0fea252096d5144abf684516cbb10.zip Qt-ad04d96fdac0fea252096d5144abf684516cbb10.tar.gz Qt-ad04d96fdac0fea252096d5144abf684516cbb10.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Conflicts:
src/gui/painting/qpdf.cpp
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r-- | src/gui/text/qfontengine.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 3652c69..f73b816 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -46,7 +46,6 @@ #include "qpainter.h" #include "qpainterpath.h" #include "qvarlengtharray.h" -#include <private/qpdf_p.h> #include <qmath.h> #include <qendian.h> #include <private/qharfbuzz_p.h> @@ -681,11 +680,7 @@ void QFontEngine::removeGlyphFromCache(glyph_t) QFontEngine::Properties QFontEngine::properties() const { Properties p; -#ifndef QT_NO_PRINTER - QByteArray psname = QPdf::stripSpecialCharacters(fontDef.family.toUtf8()); -#else - QByteArray psname = fontDef.family.toUtf8(); -#endif + QByteArray psname = QFontEngine::convertToPostscriptFontFamilyName(fontDef.family.toUtf8()); psname += '-'; psname += QByteArray::number(fontDef.style); psname += '-'; @@ -1097,6 +1092,23 @@ quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode) return 0; } +QByteArray QFontEngine::convertToPostscriptFontFamilyName(const QByteArray &family) +{ + QByteArray f = family; + f.replace(' ', ""); + f.replace('(', ""); + f.replace(')', ""); + f.replace('<', ""); + f.replace('>', ""); + f.replace('[', ""); + f.replace(']', ""); + f.replace('{', ""); + f.replace('}', ""); + f.replace('/', ""); + f.replace('%', ""); + return f; +} + Q_GLOBAL_STATIC_WITH_INITIALIZER(QVector<QRgb>, qt_grayPalette, { x->resize(256); QRgb *it = x->data(); |