From 517da68893be9e6d97c7993922c573de9560604d Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 22 Oct 2014 17:14:29 +0200 Subject: Add QFont::Weight enum values And try to make good use of them in order to match the QFont request more closely. Task-number: QTBUG-38482 Change-Id: I768dfa8828e370d77a1c17ecf4796d750b3edd9b Reviewed-by: Konstantin Ritt Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/winrt/qwinrtfontdatabase.cpp | 26 +--------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src/plugins/platforms/winrt/qwinrtfontdatabase.cpp') diff --git a/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp b/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp index 5d6b077abd..41bd2e108d 100644 --- a/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp +++ b/src/plugins/platforms/winrt/qwinrtfontdatabase.cpp @@ -209,31 +209,7 @@ void QWinRTFontDatabase::populateFamily(const QString &familyName) } } - QFont::Weight weight; - switch (font->GetWeight()) { - case DWRITE_FONT_WEIGHT_THIN: - case DWRITE_FONT_WEIGHT_EXTRA_LIGHT: - case DWRITE_FONT_WEIGHT_LIGHT: - case DWRITE_FONT_WEIGHT_SEMI_LIGHT: - weight = QFont::Light; - break; - default: - case DWRITE_FONT_WEIGHT_NORMAL: - case DWRITE_FONT_WEIGHT_MEDIUM: - weight = QFont::Normal; - break; - case DWRITE_FONT_WEIGHT_DEMI_BOLD: - weight = QFont::DemiBold; - break; - case DWRITE_FONT_WEIGHT_BOLD: - case DWRITE_FONT_WEIGHT_EXTRA_BOLD: - weight = QFont::Bold; - break; - case DWRITE_FONT_WEIGHT_BLACK: - case DWRITE_FONT_WEIGHT_EXTRA_BLACK: - weight = QFont::Black; - break; - } + QFont::Weight weight = QPlatformFontDatabase::weightFromInteger(font->GetWeight()); QFont::Style style; switch (font->GetStyle()) { -- cgit v1.2.3