summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-22 21:58:15 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-12-22 22:33:31 -0500
commit29451a507b0fd0e6949558724d264a22431e1082 (patch)
tree07b5f7a78ae1ab65f861edaad924be1a528bb185
parent26aadb2508f9022cbfc72e73b558c6791f5d46d9 (diff)
downloadpango-smaller-space.tar.gz
Make missing space smallersmaller-space
The Microsoft paper I was citing actually recommends 1/4 em for ASCII space. Make it so... Update affected tests.
-rw-r--r--pango/pangocairo-font.c2
-rw-r--r--tests/layouts/no-space.layout10
-rw-r--r--tests/layouts/valid-14.layout4
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
}