From: Mirko Günther <renegart@gmx.de>
Subject: [PATCH] qml5: use Noto Color Emoji font for the emoji plugin

Qt 5 counterpart of upstream commit af0797b3 ("Use Noto Color Emoji font
for the emoji plugin with Qt 6"). CharKey renders labels with
UI.fontFamily and Font.Light, so emoji glyphs fall back to whatever font
fontconfig matches for that weight. With a monochrome Noto Emoji font
installed next to Noto Color Emoji, the emoji keyboard shows monochrome
glyphs.

Expose the label font family on CharKey and set it to Noto Color Emoji
for the emoji keys.
---
diff --git a/plugins/emoji/qml5/CategoryKey.qml b/plugins/emoji/qml5/CategoryKey.qml
index bba82df..051a500 100644
--- a/plugins/emoji/qml5/CategoryKey.qml
+++ b/plugins/emoji/qml5/CategoryKey.qml
@@ -24,6 +24,7 @@ CharKey {
     normalColor: fullScreenItem.theme.backgroundColor
     borderColor: normalColor
     pressedColor: normalColor
+    fontFamily: "Noto Color Emoji"
     fontSize: fullScreenItem.landscape ? height / 1.8 : height / 2.5
     layer.enabled: !highlight
     layer.effect: ShaderEffect {
diff --git a/plugins/emoji/qml5/Keyboard_emoji.qml b/plugins/emoji/qml5/Keyboard_emoji.qml
index 3f89fc2..af11997 100644
--- a/plugins/emoji/qml5/Keyboard_emoji.qml
+++ b/plugins/emoji/qml5/Keyboard_emoji.qml
@@ -199,6 +199,7 @@ KeyPad {
                 normalColor: fullScreenItem.theme.backgroundColor
                 borderColor: normalColor
                 pressedColor: fullScreenItem.theme.backgroundColor
+                fontFamily: "Noto Color Emoji"
                 fontSize: units.gu(2.45)
                 onKeySent: {
                     internal.updateRecent(key);
diff --git a/qml5/keys/CharKey.qml b/qml5/keys/CharKey.qml
index 46bd208..d661f52 100644
--- a/qml5/keys/CharKey.qml
+++ b/qml5/keys/CharKey.qml
@@ -72,6 +72,8 @@ Item {
     property bool borderEnabled: fullScreenItem.theme.keyBorderEnabled
     property string borderColor: borderEnabled ? fullScreenItem.theme.charKeyBorderColor : "transparent"
 
+    property string fontFamily: UI.fontFamily
+
     // Scale the font so the label fits if a long word is set
     property int fontSize: (fullScreenItem.landscape ? (height / 2) : (height / 2.8))
                            * (4 / (label.length >= 2 ? (label.length <= 6 ? label.length + 2.5 : 8) : 4));
@@ -148,7 +150,7 @@ Item {
             Text {
                 id: keyLabel
                 text: (panel.activeKeypadState === "NORMAL") ? label : shifted;
-                font.family: UI.fontFamily
+                font.family: fontFamily
                 font.pixelSize: fontSize
                 font.weight: Font.Light
                 color: fullScreenItem.theme.fontColor
