[pango: 3/5] Update Line Break to Unicode 14




commit 604425dd784e6dbd91b985a3aa138154ef15cd14
Author: Peng Wu <pwu redhat com>
Date:   Tue Oct 12 09:54:44 2021 +0800

    Update Line Break to Unicode 14

 pango/break.c              | 8 ++++++--
 tests/testboundaries_ucd.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/pango/break.c b/pango/break.c
index 0cb6666d..917d6031 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -1118,6 +1118,11 @@ default_break (const char    *text,
              break_type == G_UNICODE_BREAK_EMOJI_MODIFIER)
            break_op = BREAK_PROHIBITED;
 
+         if ((_pango_Is_Emoji_Extended_Pictographic (prev_wc) &&
+              g_unichar_type (prev_wc) == G_UNICODE_UNASSIGNED) &&
+             break_type == G_UNICODE_BREAK_EMOJI_MODIFIER)
+           break_op = BREAK_PROHIBITED;
+
          /* Rule LB29 */
          if (prev_break_type == G_UNICODE_BREAK_INFIX_SEPARATOR &&
              (break_type == G_UNICODE_BREAK_ALPHABETIC ||
@@ -1137,8 +1142,7 @@ default_break (const char    *text,
               prev_break_type == G_UNICODE_BREAK_HANGUL_T_JAMO ||
               prev_break_type == G_UNICODE_BREAK_HANGUL_LV_SYLLABLE ||
               prev_break_type == G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE) &&
-             (break_type == G_UNICODE_BREAK_INSEPARABLE ||
-              break_type == G_UNICODE_BREAK_POSTFIX))
+             break_type == G_UNICODE_BREAK_POSTFIX)
            break_op = BREAK_PROHIBITED;
 
          if (prev_break_type == G_UNICODE_BREAK_PREFIX &&
diff --git a/tests/testboundaries_ucd.c b/tests/testboundaries_ucd.c
index d9f08a57..8abf0b7a 100644
--- a/tests/testboundaries_ucd.c
+++ b/tests/testboundaries_ucd.c
@@ -273,7 +273,7 @@ do_test (const gchar *filename,
       
       if (num_attrs > 0)
         {
-          PangoLogAttr *attrs = g_new (PangoLogAttr, num_attrs);
+          PangoLogAttr *attrs = g_new0 (PangoLogAttr, num_attrs);
           pango_get_log_attrs (string, -1, 0, pango_language_from_string ("C"), attrs, num_attrs);
 
           if (! attrs_equal (attrs, expected_attrs, num_attrs, bits))


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