qt5base-lts/tests/auto/gui
Tor Arne Vestbø 50cb2687b2 UIKit: Improve handling of private system fonts / fallback fonts
Commit 2bc7a40048 taught the CoreText font database to populate the
families lazily, and in the process added a guard to ensure that we
didn't populate internal fonts (prefixed with a '.'), as these fonts
would then show up in font selection dialogs.

Commit 909d3f5c7 then added support for private fonts, by making it
possible to filter out any private fonts from font selection daialogs.
But the guard was not removed, so we were still not populating these
fonts. This guard has been removed, and the filtering function has
been updated to include the conditions of the guard.

Next, commit e5e93345c5 used [UIFont fontNamesForFamilyName:] to verify
that each family that we registered with the font database would also
have matching fonts when finally populated. This is not the right approach,
as [UIFont fontNamesForFamilyName:] does not handle internal fonts.

Instead we trust what CTFontDescriptorCreateMatchingFontDescriptors()
gives us, but make sure to register the resulting font descriptors
with the original/originating font family, instead of the one we pull
out of the font descriptor.

Finally, as of iOS 10, we can use CTFontManagerCopyAvailableFontFamilyNames
instead of [UIFont familyNames], which gives us all of the internal font
families like on macOS, instead of just the user-visible families. For
earlier iOS versions we manually add '.PhoneFallback', as we know it
will be available even if not listed in [UIFont familyNames].

The end result is that we register and populate families like '.PhoneFallback',
which is critical to supporting more esoteric writing systems.

The check in tst_QFont that styles for a given family is not empty has
been removed, as we can't guarantee that on all platforms, which is
also documented for QFontDatabase::styles().

Task-number: QTBUG-45746
Task-number: QTBUG-50624
Change-Id: I04674dcb2bb36b4cdf5646d540c35727ff3daaad
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-12-08 16:38:01 +00:00
..
image Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-16 12:35:36 +01:00
itemmodels QStandardItemModel: Reset the flags on clear() 2016-02-17 11:39:13 +00:00
kernel Clean up some conditions in our pro files 2016-11-14 19:22:17 +00:00
math3d Updated license headers 2016-01-21 18:55:18 +00:00
painting Fix qdrawhelper function toRGB64 2016-12-08 12:40:02 +00:00
qopengl Merge remote-tracking branch 'origin/5.7' into 5.8 2016-11-01 06:02:55 +01:00
qopenglconfig Merge remote-tracking branch 'origin/5.6' into 5.7 2016-08-25 16:12:11 +02:00
text UIKit: Improve handling of private system fonts / fallback fonts 2016-12-08 16:38:01 +00:00
util Fix test for WinRT 2016-09-23 07:20:53 +00:00
gui.pro Clean up some conditions in our pro files 2016-11-14 19:22:17 +00:00