diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase_qpa.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qfontengine.cpp | 6 | ||||
-rw-r--r-- | src/gui/text/qfontengine_p.h | 1 | ||||
-rw-r--r-- | src/gui/text/qplatformfontdatabase_qpa.cpp | 15 | ||||
-rw-r--r-- | src/gui/text/qplatformfontdatabase_qpa.h | 3 |
6 files changed, 26 insertions, 11 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 233bc04924..99c17435dc 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2726,7 +2726,7 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, QPoint offset; QImage *alphaMap = fontEngine->lockedAlphaMapForGlyph(glyphs[i], spp, neededFormat, s->matrix, &offset); - if (alphaMap == 0) + if (alphaMap == 0 || alphaMap->isNull()) continue; alphaPenBlt(alphaMap->bits(), alphaMap->bytesPerLine(), alphaMap->depth(), diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 3a578e746f..fbee077ba7 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -53,16 +53,18 @@ QT_BEGIN_NAMESPACE Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &foundryname, int weight, - QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, + QFont::Style style, int stretch, bool antialiased, + bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle) { QFontDatabasePrivate *d = privateDb(); - // qDebug() << "Adding font" << familyname << weight << italic << pixelSize << file << fileIndex << antialiased; + // qDebug() << "Adding font" << familyName << weight << style << pixelSize << antialiased; QtFontStyle::Key styleKey; styleKey.style = style; styleKey.weight = weight; styleKey.stretch = stretch; QtFontFamily *f = d->family(familyName, true); + f->fixedPitch = fixedPitch; for (int i = 0; i < QFontDatabase::WritingSystemsCount; ++i) { if (writingSystems.supported(QFontDatabase::WritingSystem(i))) { @@ -106,10 +108,12 @@ static QStringList fallbackFamilies(const QString &family, const QFont::Style &s static void initializeDb() { static int initialized = false; + QFontDatabasePrivate *db = privateDb(); - if (!initialized) { + if (!initialized || db->reregisterAppFonts) { //init by asking for the platformfontdb for the first time :) QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase(); + db->reregisterAppFonts = false; initialized = true; } } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 4f18aa3efd..fabd8c3634 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1281,7 +1281,11 @@ glyph_metrics_t QFontEngineBox::boundingBox(glyph_t) return glyph_metrics_t(0, -_size, _size, _size, _size, 0); } - +QFontEngine *QFontEngineBox::cloneWithSize(qreal pixelSize) const +{ + QFontEngineBox *fe = new QFontEngineBox(pixelSize); + return fe; +} QFixed QFontEngineBox::ascent() const { diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index f74302c054..2bec69c467 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -379,6 +379,7 @@ public: virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs); virtual glyph_metrics_t boundingBox(glyph_t glyph); + virtual QFontEngine *cloneWithSize(qreal pixelSize) const; virtual QFixed ascent() const; virtual QFixed descent() const; diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 7ad838561b..cedf481898 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -48,8 +48,9 @@ QT_BEGIN_NAMESPACE extern void qt_registerFont(const QString &familyname, const QString &foundryname, int weight, - QFont::Style style, int stretch, bool antialiased,bool scalable, int pixelSize, - const QSupportedWritingSystems &writingSystems, void *hanlde); + QFont::Style style, int stretch, bool antialiased, + bool scalable, int pixelSize, bool fixedPitch, + const QSupportedWritingSystems &writingSystems, void *hanlde); /*! \fn void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void *handle) @@ -88,7 +89,7 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * } } QFont::Stretch stretch = QFont::Unstretched; - registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,writingSystems,handle); + registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,false,writingSystems,handle); } } else { qDebug() << "header verification of QPF2 font failed. maybe it is corrupt?"; @@ -122,12 +123,16 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * \sa registerQPF2Font() */ void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight, - QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, + QFont::Style style, QFont::Stretch stretch, bool antialiased, + bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *usrPtr) { if (scalable) pixelSize = 0; - qt_registerFont(familyname,foundryname,weight,style,stretch,antialiased,scalable,pixelSize,writingSystems,usrPtr); + + qt_registerFont(familyname, foundryname, weight, style, + stretch, antialiased, scalable, pixelSize, + fixedPitch, writingSystems, usrPtr); } class QWritingSystemsPrivate diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index d34d602e43..ad94b108da 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -103,7 +103,8 @@ public: //callback static void registerQPF2Font(const QByteArray &dataArray, void *handle); static void registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight, - QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, + QFont::Style style, QFont::Stretch stretch, bool antialiased, + bool scalable, int pixelSize, bool fixedPitch, const QSupportedWritingSystems &writingSystems, void *handle); }; |