From f791d96362cbe7ef8435e999adaaf05e6f2683a5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 Nov 2022 01:11:18 +0100 Subject: Fix some emoji that end with fe0f --- src/Text.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Text.cpp b/src/Text.cpp index e67d879..ed972e0 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -7,6 +7,7 @@ #include "../generated/Emoji.hpp" #include #include +#include #include #include #include @@ -509,6 +510,11 @@ namespace QuickMedia text_element.create_text(std::string_view(str.data() + index, offset)); text_element.text_type = TextElement::TextType::EMOJI; text_element.url = "/usr/share/quickmedia/emoji/" + emoji_codepoint_combined + ".png"; + // Some emoji do not work with the -fe0f variant + if(emoji_sequence_length > 0 && emoji_sequence[emoji_sequence_length - 1] == 0xfe0f && access(text_element.url.c_str(), F_OK) != 0) { + emoji_codepoint_combined.erase(emoji_codepoint_combined.end() - 5, emoji_codepoint_combined.end()); + text_element.url = "/usr/share/quickmedia/emoji/" + emoji_codepoint_combined + ".png"; + } text_element.local = true; text_element.size = { (int)vspace, (int)vspace }; text_element.text_num_bytes = emoji_byte_length; -- cgit v1.2.3