summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont_p.h
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-06-04 14:47:22 +0200
committerQt Continuous Integration System <qt-info@nokia.com>2011-06-09 15:07:13 +0200
commit97391be5ebddc62545ddb88f92fc2045bfa10711 (patch)
tree0f7e7252a8e41d0c9a00f348dcfff2ff25666bef /src/gui/text/qfont_p.h
parentb97215b04c0bf12ecfd51ccdeaedd1fab5e8bc03 (diff)
Allow selecting fonts with irregular style names
Fonts like "Helvetica Neue UltraLight" or "Skia Regular Black Condensed" can't be selected in Qt because either they don't report correct numeric values for weight/stretch/etc. or these values are not mapped from QFont enums in a linear way. Thus we provide a shortcut to select these fonts with PostScript name or full name without resorting to family name matching in QFontDatabase (these fonts are not registered in font database anyway). After this, we can simply use: QFont font("Helvetica Neue"); font.setStyleName("UltraLight"); to select these fonts. QCoreTextFontEngineMulti matched like this can be created directly from the CTFontRef instance instead of creating from the font name, making this process faster. The commit also cleaned up the font loading process in Mac font database a bit, moving the code for family matching into a separate function. Add QFontInfo::styleName() and QRawFont::styleName() to access the resolved style name for a font. Task-number: QTBUG-19366 Change-Id: Iad07768c02ed06cc8d6b7395dec554384f410506 Reviewed-on: http://codereview.qt.nokia.com/333 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui/text/qfont_p.h')
-rw-r--r--src/gui/text/qfont_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index d36518ee4b..8eeae6ffc1 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -80,6 +80,7 @@ struct QFontDef
}
QString family;
+ QString styleName;
#ifdef Q_WS_X11
QString addStyle;