diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-16 07:51:17 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-22 13:13:30 (GMT) |
commit | 9d00cf202376c2b02dec27b362cf88a00e952e88 (patch) | |
tree | fdfa479fbaa5a505dd7147e379b0c58e54ebce41 /src/gui/text/qplatformfontdatabase_qpa.cpp | |
parent | 687d44569dbccea72c582c6d7da9a271ae2c86c8 (diff) | |
download | Qt-9d00cf202376c2b02dec27b362cf88a00e952e88.zip Qt-9d00cf202376c2b02dec27b362cf88a00e952e88.tar.gz Qt-9d00cf202376c2b02dec27b362cf88a00e952e88.tar.bz2 |
Lighthouse: using QFont enums when possible in QPlatformFontdatabase
also, make it possible to register fonts in QPlatformDatabases with a
null handle
Reviewed-by: paul
Diffstat (limited to 'src/gui/text/qplatformfontdatabase_qpa.cpp')
-rw-r--r-- | src/gui/text/qplatformfontdatabase_qpa.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 370c921..7a89fe4 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -65,9 +65,9 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * QByteArray writingSystemBits = QFontEngineQPA::extractHeaderField(data, QFontEngineQPA::Tag_WritingSystems).toByteArray(); if (!fontName.isEmpty() && pixelSize) { - int fontWeight = 50; + QFont::Weight fontWeight = QFont::Normal; if (weight.type() == QVariant::Int || weight.type() == QVariant::UInt) - fontWeight = weight.toInt(); + fontWeight = QFont::Weight(weight.toInt()); QFont::Style fontStyle = static_cast<QFont::Style>(style.toInt()); @@ -80,16 +80,16 @@ void QPlatformFontDatabase::registerQPF2Font(const QByteArray &dataArray, void * currentByte >>= 1; } } - - registerFont(fontName,QString(),fontWeight,fontStyle,100,true,false,pixelSize,writingSystems,handle); + QFont::Stretch stretch = QFont::Unstretched; + registerFont(fontName,QString(),fontWeight,fontStyle,stretch,true,false,pixelSize,writingSystems,handle); } } else { qDebug() << "header verification of QPF2 font failed. maybe it is corrupt?"; } } -void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, int weight, - QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, +void QPlatformFontDatabase::registerFont(const QString &familyname, const QString &foundryname, QFont::Weight weight, + QFont::Style style, QFont::Stretch stretch, bool antialiased, bool scalable, int pixelSize, const QSupportedWritingSystems &writingSystems, void *usrPtr) { if (scalable) |