summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler.cpp4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm36
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm2
3 files changed, 29 insertions, 13 deletions
diff --git a/src/platformsupport/fbconvenience/qfbvthandler.cpp b/src/platformsupport/fbconvenience/qfbvthandler.cpp
index 7bb9e28ac2..8aab0bada4 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler.cpp
+++ b/src/platformsupport/fbconvenience/qfbvthandler.cpp
@@ -70,6 +70,10 @@ QT_BEGIN_NAMESPACE
#ifdef VTH_ENABLED
static void setTTYCursor(bool enable)
{
+ static bool ignore = qEnvironmentVariableIntValue("QT_QPA_PRESERVE_CONSOLE_STATE");
+ if (ignore)
+ return;
+
const char * const devs[] = { "/dev/tty0", "/dev/tty", "/dev/console", 0 };
int fd = -1;
for (const char * const *dev = devs; *dev; ++dev) {
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index e8ea194897..c450e91d49 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -478,30 +478,42 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
if (cascadeList) {
QStringList fallbackList;
const int numCascades = CFArrayGetCount(cascadeList);
+
+ int symbolIndex = -1;
+ int notoSansUniversalIndex = -1;
for (int i = 0; i < numCascades; ++i) {
CTFontDescriptorRef fontFallback = (CTFontDescriptorRef) CFArrayGetValueAtIndex(cascadeList, i);
QCFString fallbackFamilyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontFallback, kCTFontFamilyNameAttribute);
- fallbackList.append(QString::fromCFString(fallbackFamilyName));
+
+ QString fallbackName = QString::fromCFString(fallbackFamilyName);
+ fallbackList.append(fallbackName);
+
+ if (!qt_isFontFamilyPopulated(fallbackName))
+ const_cast<QCoreTextFontDatabase *>(this)->populateFromDescriptor(fontFallback, fallbackName);
+
+ if (fallbackName == QLatin1String(".Apple Symbols Fallback"))
+ symbolIndex = fallbackList.size() - 1;
+ else if (fallbackName == QLatin1String(".Noto Sans Universal"))
+ notoSansUniversalIndex = fallbackList.size() - 1;
}
// .Apple Symbols Fallback will be at the beginning of the list and we will
// detect that this has glyphs for Arabic and other writing systems.
// Since it is a symbol font, it should be the last resort, so that
// the proper fonts for these writing systems are preferred.
- int symbolIndex = fallbackList.indexOf(QLatin1String(".Apple Symbols Fallback"));
- if (symbolIndex >= 0)
+ if (symbolIndex >= 0) {
fallbackList.move(symbolIndex, fallbackList.size() - 1);
+ if (notoSansUniversalIndex > symbolIndex)
+ --notoSansUniversalIndex;
+ }
- addExtraFallbacks(&fallbackList);
+ // .Noto Sans Universal appears to have a bug when the application
+ // does not have a valid Info.plist, which causes it to return glyph #4
+ // (a question mark) for any character.
+ if (notoSansUniversalIndex >= 0)
+ fallbackList.move(notoSansUniversalIndex, fallbackList.size() - 1);
- // Since iOS 13, the cascade list may contain meta-fonts which have not been
- // populated to the database, such as ".AppleJapaneseFont". It is important that we
- // include this in the fallback list, in order to get fallback support for all
- // languages
- for (const QString &fallback : fallbackList) {
- if (!qt_isFontFamilyPopulated(fallback))
- const_cast<QCoreTextFontDatabase *>(this)->populateFamily(fallback);
- }
+ addExtraFallbacks(&fallbackList);
extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 072dd1a28a..30c80ebd86 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -471,7 +471,7 @@ void QCoreTextFontEngine::draw(CGContextRef ctx, qreal x, qreal y, const QTextIt
const qreal firstY = positions[0].y.toReal();
for (int i = 0; i < glyphs.size(); ++i) {
cgPositions[i].x = positions[i].x.toReal() - firstX;
- cgPositions[i].y = positions[i].y.toReal() - firstY;
+ cgPositions[i].y = firstY - positions[i].y.toReal();
cgGlyphs[i] = glyphs[i];
}