From a57564aec2d898e8e1694081c21d30ce4ad91abe Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 9 Feb 2016 13:39:32 +0100 Subject: Material: fix fonts Request Roboto or Noto if exists, fallback to the system font. Even if we fallback to the system font, set the sizes appropriately. The latest spec for tabs says that the font size 14sp (scaled px) and all caps. https://www.google.com/design/spec/components/tabs.html#tabs-specs Change-Id: I34ecadf21306921e2115630ea41771dfef627b48 Task-number: QTBUG-50971 Reviewed-by: Liang Qi --- src/imports/controls/material/qquickmaterialtheme.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/imports/controls/material/qquickmaterialtheme.cpp') diff --git a/src/imports/controls/material/qquickmaterialtheme.cpp b/src/imports/controls/material/qquickmaterialtheme.cpp index 75ca1b8f..4124735a 100644 --- a/src/imports/controls/material/qquickmaterialtheme.cpp +++ b/src/imports/controls/material/qquickmaterialtheme.cpp @@ -43,8 +43,18 @@ QT_BEGIN_NAMESPACE QQuickMaterialTheme::QQuickMaterialTheme(QPlatformTheme *theme) : QQuickProxyTheme(theme) { - systemFont = QFont(QStringLiteral("Roboto")); - tabButtonFont = QFont(QStringLiteral("Roboto"), 10); + QFont font; + font.setFamily(QStringLiteral("Roboto")); + if (!font.exactMatch()) + font.setFamily(QStringLiteral("Noto")); + + if (font.exactMatch()) { + systemFont.setFamily(font.family()); + tabButtonFont.setFamily(font.family()); + } + + tabButtonFont.setPixelSize(14); + tabButtonFont.setCapitalization(QFont::AllUppercase); } QQuickMaterialTheme::~QQuickMaterialTheme() -- cgit v1.2.3