summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2019-11-27 12:49:37 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-11-28 06:08:45 +0000
commit2a4dd69499cb85695ede86ac7244fe6e1c274834 (patch)
treeaa4732fb74fc8fcd833a7515e6c2ae34dbaa86d2 /src
parentd60b71d635a038e3fe8b061b0ac3f2aad70227a5 (diff)
CoreText: Fix getting system fonts on recent macOS/iOS versions
We introduced a work-around for iOS 11 which breaks on more recent OS versions because we try to request meta-fonts by name instead of using the special system font descriptors. This would cause warnings on the console and Times New Roman when requesting e.g. the system fixed width font. When testing on iOS 12 without the work-around, we are no longer able to reproduce the original issue, so the assumption is that this problem has been resolved. Since iOS 11 is not a supported target for Qt 5.14 we can remove the work-around entirely. [ChangeLog][macOS/iOS] Fixed a bug where QFontDatabase::systemFont() would return the wrong fonts on macOS 10.15 and iOS 13. Fixes: QTBUG-79900 Change-Id: Ie375c8c2ab877d6d66e3696662c4939f639a6e9e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index daa3dc94ea..894919a1c8 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -374,17 +374,6 @@ QFontEngine *QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>::fontEngine
QCFType<CTFontDescriptorRef> descriptor = QCFType<CTFontDescriptorRef>::constructFromGet(
static_cast<CTFontDescriptorRef>(usrPtr));
- // CoreText will sometimes invalidate information in font descriptors that refer
- // to system fonts in certain function calls or application states. While the descriptor
- // looks the same from the outside, some internal plumbing is different, causing the results
- // of creating CTFonts from those descriptors unreliable. The work-around for this
- // is to copy the attributes of those descriptors each time we make a new CTFont
- // from them instead of referring to the original, as that may trigger the CoreText bug.
- if (m_systemFontDescriptors.contains(descriptor)) {
- QCFType<CFDictionaryRef> attributes = CTFontDescriptorCopyAttributes(descriptor);
- descriptor = CTFontDescriptorCreateWithAttributes(attributes);
- }
-
// Since we do not pass in the destination DPI to CoreText when making
// the font, we need to pass in a point size which is scaled to include
// the DPI. The default DPI for the screen is 72, thus the scale factor