qt5base-lts/examples/widgets/richtext
Gabriel de Dietrich 909d3f5c73 Font Database: Add support for private, system UI font families
We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow
testing for private, system UI font families. Both QFontComboBox
and QFontDialog need to filter out those private font families
which, by definition, should be hidden from the end user.

(The textedit example had to be updated to fix the issue where the
default font would be private. In 5.4, we will be adding an equivalent,
public API in QFontDatabase, and a better solution for the textedit
example and QTexEdit in general).

In particular, on OS X and iOS, private fonts are used for the system
UI font. Those have their font family name prefixed by a dot.
QCoreTextFontDatabase knows about this, and makes sure those are
tested positive as private font families. In order to have a cleaner
layer separation, we moved the QPA theme font resolution from the
platform theme classes into QCoreTextFontDatabase for both Cocoa and
iOS QPA plugins.

In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that
nicely maps to the HITheme API we were using so far on Mac. That means
one HITheme dependency less. We also cache the font descriptors we get
for these font for each time QCTFD::populateFamilies() gets called.
(While not common, this currently happens in auto-tests, like
tst_QFontDatabase, and could happen in actual applications -- specially
when adding and removing application fonts.)

Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-08-11 10:46:13 +02:00
..
calendar Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
orderform Compile fix when QT_NO_PRINTDIALOG is defined 2013-02-26 13:31:45 +01:00
syntaxhighlighter Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
textedit Font Database: Add support for private, system UI font families 2014-08-11 10:46:13 +02:00
README Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00
richtext.pro centralize and fixup example sources install targets 2012-11-29 20:21:11 +01:00

Qt provides powerful document-oriented rich text engine that supports Unicode
and right-to-left scripts. Documents can be manipulated using a cursor-based
API, and their contents can be imported and exported as both HTML and in a
custom XML format.

Text is rendered using anti-aliased outline fonts to provide the best
possible on-screen representation.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.