[pango/bidi-stack-size: 2/11] break: Cosmetics




commit 898b09609ab8fd9628dd2fdc62da816ccf1e880b
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 27 07:23:42 2021 -0400

    break: Cosmetics

 pango/break.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/pango/break.c b/pango/break.c
index ddef75f6..b26a0651 100644
--- a/pango/break.c
+++ b/pango/break.c
@@ -358,24 +358,26 @@ pango_default_break (const gchar   *text,
       switch (type)
         {
         case G_UNICODE_SPACE_SEPARATOR:
+          /* Just few spaces have variable width. So explicitly mark them.
+           */
+          attrs[i].is_white = TRUE;
+          attrs[i].is_expandable_space = (wc == ' ' || wc == 0x00A0);
+          break;
         case G_UNICODE_LINE_SEPARATOR:
         case G_UNICODE_PARAGRAPH_SEPARATOR:
           attrs[i].is_white = TRUE;
+          attrs[i].is_expandable_space = FALSE;
           break;
         case G_UNICODE_CONTROL:
-          if (wc == '\t' || wc == '\n' || wc == '\r' || wc == '\f')
-            attrs[i].is_white = TRUE;
-          else
-            attrs[i].is_white = FALSE;
+          attrs[i].is_white = (wc == '\t' || wc == '\n' || wc == '\r' || wc == '\f');
+          attrs[i].is_expandable_space = FALSE;
           break;
         default:
           attrs[i].is_white = FALSE;
+          attrs[i].is_expandable_space = FALSE;
           break;
         }
 
-      /* Just few spaces have variable width. So explicitly mark them.
-       */
-      attrs[i].is_expandable_space = (0x0020 == wc || 0x00A0 == wc);
       is_Extended_Pictographic =
        _pango_Is_Emoji_Extended_Pictographic (wc);
 


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