[pango: 1/2] Fixes emoji backspace deletion behavior



commit ac67bc285e9335797450e7172ce218fbcce32fb6
Author: Peng Wu <alexepico gmail com>
Date:   Tue Apr 2 14:15:59 2019 +0800

    Fixes emoji backspace deletion behavior

 pango/break.c               | 3 ++-
 pango/pango-emoji-private.h | 3 +++
 pango/pango-emoji.c         | 6 ++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/pango/break.c b/pango/break.c
index 355518eb..37be1c65 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -124,7 +124,8 @@ static const CharJamoProps HangulJamoProps[] = {
 #define GREEK(wc) (((wc) >= 0x0370 && (wc) <= 0x3FF) || ((wc) >= 0x1F00 && (wc) <= 0x1FFF))
 #define KANA(wc) ((wc) >= 0x3040 && (wc) <= 0x30FF)
 #define HANGUL(wc) ((wc) >= 0xAC00 && (wc) <= 0xD7A3)
-#define BACKSPACE_DELETES_CHARACTER(wc) (!LATIN (wc) && !CYRILLIC (wc) && !GREEK (wc) && !KANA(wc) && 
!HANGUL(wc))
+#define EMOJI(wc) (_pango_Is_Emoji_Base_Character (wc))
+#define BACKSPACE_DELETES_CHARACTER(wc) (!LATIN (wc) && !CYRILLIC (wc) && !GREEK (wc) && !KANA (wc) && 
!HANGUL (wc) && !EMOJI (wc))
 
 /* Previously "123foo" was two words. But in UAX 29 of Unicode, 
  * we know don't break words between consecutive letters and numbers
diff --git a/pango/pango-emoji-private.h b/pango/pango-emoji-private.h
index f0d3b7f9..928ad885 100644
--- a/pango/pango-emoji-private.h
+++ b/pango/pango-emoji-private.h
@@ -24,6 +24,9 @@
 
 #include <glib.h>
 
+gboolean
+_pango_Is_Emoji_Base_Character (gunichar ch);
+
 gboolean
 _pango_Is_Emoji_Extended_Pictographic (gunichar ch);
 
diff --git a/pango/pango-emoji.c b/pango/pango-emoji.c
index c0e0de60..e316b370 100644
--- a/pango/pango-emoji.c
+++ b/pango/pango-emoji.c
@@ -94,6 +94,12 @@ DEFINE_pango_Is_(Emoji_Modifier)
 DEFINE_pango_Is_(Emoji_Modifier_Base)
 DEFINE_pango_Is_(Extended_Pictographic)
 
+gboolean
+_pango_Is_Emoji_Base_Character (gunichar ch)
+{
+       return _pango_Is_Emoji (ch);
+}
+
 gboolean
 _pango_Is_Emoji_Extended_Pictographic (gunichar ch)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]