[pango/smaller-space] Make missing space smaller




commit 29451a507b0fd0e6949558724d264a22431e1082
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Dec 22 21:58:15 2021 -0500

    Make missing space smaller
    
    The Microsoft paper I was citing actually recommends
    1/4 em for ASCII space. Make it so...
    
    Update affected tests.

 pango/pangocairo-font.c       |  2 +-
 tests/layouts/no-space.layout | 10 +++++-----
 tests/layouts/valid-14.layout |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 5eb385d9..598065c0 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -679,7 +679,7 @@ get_space_extents (PangoCairoFontPrivate *cf_priv,
 {
   /* See https://docs.microsoft.com/en-us/typography/develop/character-design-standards/whitespace */
 
-  int width = pango_font_get_absolute_size (PANGO_FONT (cf_priv->cfont)) / 2;
+  int width = pango_font_get_absolute_size (PANGO_FONT (cf_priv->cfont)) / 4;
 
   if (ink_rect)
     {
diff --git a/tests/layouts/no-space.layout b/tests/layouts/no-space.layout
index 646450c1..b9bef178 100644
--- a/tests/layouts/no-space.layout
+++ b/tests/layouts/no-space.layout
@@ -21,7 +21,7 @@
     "is-wrapped" : false,
     "is-ellipsized" : false,
     "unknown-glyphs" : 4,
-    "width" : 130048,
+    "width" : 89088,
     "height" : 45056,
     "log-attrs" : [
       {
@@ -105,13 +105,13 @@
             "glyphs" : [
               {
                 "glyph" : 268435488,
-                "width" : 21504,
+                "width" : 11264,
                 "is-cluster-start" : true,
                 "log-cluster" : 0
               },
               {
                 "glyph" : 268435488,
-                "width" : 21504,
+                "width" : 11264,
                 "is-cluster-start" : true,
                 "log-cluster" : 1
               },
@@ -123,13 +123,13 @@
               },
               {
                 "glyph" : 268435488,
-                "width" : 21504,
+                "width" : 11264,
                 "is-cluster-start" : true,
                 "log-cluster" : 5
               },
               {
                 "glyph" : 268435488,
-                "width" : 21504,
+                "width" : 11264,
                 "is-cluster-start" : true,
                 "log-cluster" : 6
               }
diff --git a/tests/layouts/valid-14.layout b/tests/layouts/valid-14.layout
index 07c80f17..427cb5ee 100644
--- a/tests/layouts/valid-14.layout
+++ b/tests/layouts/valid-14.layout
@@ -235,7 +235,7 @@
               },
               {
                 "glyph" : 1058,
-                "width" : 14336,
+                "width" : 17408,
                 "log-cluster" : 0
               }
             ]
@@ -267,7 +267,7 @@
             "glyphs" : [
               {
                 "glyph" : 268435488,
-                "width" : 7168,
+                "width" : 4096,
                 "is-cluster-start" : true,
                 "log-cluster" : 0
               }


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