Go to file
Jiang Jiang 97391be5eb 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>
2011-06-09 15:07:13 +02:00
bin Implemented module-local caching of module profiles. 2011-06-03 22:20:40 +02:00
config.profiles Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
config.tests Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
demos Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
dist Added some of my Qt 4.8 changes to the changelog 2011-05-26 14:16:22 +02:00
doc/src Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
examples Fix usage of QT_SOURCE_TREE 2011-06-07 22:18:35 +02:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Complain if we don't load(qt_module) first 2011-06-08 21:04:48 +02:00
qmake Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
src Allow selecting fonts with irregular style names 2011-06-09 15:07:13 +02:00
tests Allow selecting fonts with irregular style names 2011-06-09 15:07:13 +02:00
tools Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
util Make lexgen tests compile 2011-05-27 08:41:02 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add QT_xxx_VERSION macros for each library in qtbase 2011-05-10 15:15:15 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Moved certain qmake config variables to .qmake.cache. 2011-05-31 12:51:28 +02:00
configure.exe New configure.exe binary 2011-05-23 09:24:19 -05:00
header.BSD Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
header.FDL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL-ONLY Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
INSTALL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Fixed ordering problem when configuring with `-make <part>' 2011-05-26 11:09:32 +02:00
sync.profile Add QT_xxx_VERSION macros for each library in qtbase 2011-05-10 15:15:15 +02:00