From cf2afdc541b540582650f89c6b95aacfeaef516f Mon Sep 17 00:00:00 2001
From: Kitty Barnett <develop@catznip.com>
Date: Sun, 11 Sep 2022 21:44:00 +0100
Subject: [PATCH] Add emoji as its own font to promote character reuse

---
 indra/llrender/llfontgl.cpp                  | 7 +++++++
 indra/llrender/llfontgl.h                    | 1 +
 indra/newview/skins/default/xui/en/fonts.xml | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 4770f793954..e9899c95678 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -1005,6 +1005,13 @@ LLFontGL::VAlign LLFontGL::vAlignFromName(const std::string& name)
 	return gl_vfont_align;
 }
 
+ //static
+LLFontGL* LLFontGL::getFontEmoji()
+{
+	static LLFontGL* fontp = getFont(LLFontDescriptor("Emoji", "Large", 0));
+	return fontp;;
+}
+
 //static
 LLFontGL* LLFontGL::getFontMonospace()
 {
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index a60feb87cbd..29bdb798e1b 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -191,6 +191,7 @@ class LLFontGL
 
 	static void setFontDisplay(BOOL flag) { sDisplayFont = flag; }
 		
+	static LLFontGL* getFontEmoji();
 	static LLFontGL* getFontMonospace();
 	static LLFontGL* getFontSansSerifSmall();
 	static LLFontGL* getFontSansSerif();
diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml
index ed355463226..681f670f085 100644
--- a/indra/newview/skins/default/xui/en/fonts.xml
+++ b/indra/newview/skins/default/xui/en/fonts.xml
@@ -70,6 +70,11 @@
     <file>DejaVuSans-BoldOblique.ttf</file>
   </font>
 
+  <font name="Emoji"
+	comment="Name of emoji font">
+    <file>Twemoji.ttf</file>
+  </font>
+
   <font name="Monospace"
 	comment="Name of monospace font">
     <file>DejaVuSansMono.ttf</file>
-- 
GitLab