Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.3.2
-
None
Description
Emojis that are combined from latin symbols with variation selectors are rendered badly.
For example emoji 5️⃣
https://apps.timwhitlock.info/unicode/inspect?s=5%EF%B8%8F⃣
(Unfortunately the link is broken, but this emoji may be inserted at the form on page and then inspected)
Even if "Apple Color Emoji" font is added as substitution, it's not applied to this emoji, because starting symbol is from latin set.
There's no way to use "Apple Color Emoji" as default font in applications, because it breaks text rendering in other cases. But it should properly substitute emojies.
Sample:
int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); auto defaultSystemFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont); QString defaultFontFamily = defaultSystemFont.family(); QStringList fontSubstitutions = QStringList() << "Apple Color Emoji"; QFont::insertSubstitutions(defaultFontFamily, fontSubstitutions); QFont applicationFont(defaultFontFamily); app.setFont(applicationFont); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
import QtQuick import QtQuick.Controls import QtQuick.Layouts import QtQuick.Window Window { visible: true width: 640 height: 480 title: qsTr("Hello World") ColumnLayout { anchors.fill: parent anchors.margins: 20 Text { // Emojies are OK Layout.fillWidth: true wrapMode: Text.Wrap font.family: 'Apple Color Emoji' text: '☺️☹️☠️❤️♥️❣️✌️☝️✍️⚕️☘️☀️❄️☃️☁️⭐⚡☔⚓✈️♟️⌨️⚗️⚙️⚒️✏️✒️✉️⌚⚔️⚖️⚰️⚱️❤️⚪⚫⬜♐♏♎♍♌♋♊♉♈♑♒♓♀️♂️‼️⁉️🅾️🅱️🅰️♨️㊙️㊗️✴️🈷️▶️◀️⏏️⚠️〽️⚜️☣️☢️✳️❇️💱⬅️↙️⬇️↘️➡️↗️⬆️☑️↕️↔️↩️↪️⤴️⤵️🈂️5️⃣4️⃣3️⃣2️⃣1️⃣0️⃣*️⃣#️⃣6️⃣7️⃣8️⃣9️⃣Ⓜ️⚕️♿🅿️⚛️☪️☦️✝️☯️☮️☸️✡️♾️©️®️™️▪️◾◼️▫️◽◻️' } Text { // Rendered poorly, the spaces are too wide Layout.fillWidth: true wrapMode: Text.Wrap font.family: 'Apple Color Emoji' text: 'Hello, World' + ' ' + "Apple Color Emoji" } Text { // Emojies are broken Layout.fillWidth: true wrapMode: Text.Wrap text: '☺️☹️☠️❤️♥️❣️✌️☝️✍️⚕️☘️☀️❄️☃️☁️⭐⚡☔⚓✈️♟️⌨️⚗️⚙️⚒️✏️✒️✉️⌚⚔️⚖️⚰️⚱️❤️⚪⚫⬜♐♏♎♍♌♋♊♉♈♑♒♓♀️♂️‼️⁉️🅾️🅱️🅰️♨️㊙️㊗️✴️🈷️▶️◀️⏏️⚠️〽️⚜️☣️☢️✳️❇️💱⬅️↙️⬇️↘️➡️↗️⬆️☑️↕️↔️↩️↪️⤴️⤵️🈂️5️⃣4️⃣3️⃣2️⃣1️⃣0️⃣*️⃣#️⃣6️⃣7️⃣8️⃣9️⃣Ⓜ️⚕️♿🅿️⚛️☪️☦️✝️☯️☮️☸️✡️♾️©️®️™️▪️◾◼️▫️◽◻️' } Text { // Rendered OK Layout.fillWidth: true wrapMode: Text.Wrap text: 'Hello, World' + ' ' + font.family } Item { Layout.fillHeight: true Layout.fillWidth: true } } }
P.S. This is probable not limited to macOS.
Attachments
Issue Links
- relates to
-
QTBUG-108799 [REG 6.2.4-6.3.2] Airplane emoji completely breaks text rendering
- Closed
-
QTBUG-111801 Emoji font selection in Qt
- Closed