From e4323aed09eb62b5be6a80167592cbe34da4b52f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 17 Dec 2021 18:07:58 -0500 Subject: cairo: Work harder to measure space When coming up with a width for a missing space, we were just measuring the hex digits. But in subsetted fonts, such as the ones we use for ci, hex digits might well be missing. Take that into account and still provide some nonzero width for space. Update affected tests. --- tests/layouts/no-space.layout | 12 ++++++------ tests/layouts/valid-14.layout | 18 ++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) (limited to 'tests') diff --git a/tests/layouts/no-space.layout b/tests/layouts/no-space.layout index 0d4ef481..12f878f6 100644 --- a/tests/layouts/no-space.layout +++ b/tests/layouts/no-space.layout @@ -21,8 +21,8 @@ "is-wrapped" : false, "is-ellipsized" : false, "unknown-glyphs" : 4, - "width" : 44032, - "height" : 44032, + "width" : 261120, + "height" : 261120, "log-attrs" : [ { "char-break" : true, @@ -105,13 +105,13 @@ "glyphs" : [ { "glyph" : 268435488, - "width" : 0, + "width" : 54272, "is-cluster-start" : true, "log-cluster" : 0 }, { "glyph" : 268435488, - "width" : 0, + "width" : 54272, "is-cluster-start" : true, "log-cluster" : 1 }, @@ -123,13 +123,13 @@ }, { "glyph" : 268435488, - "width" : 0, + "width" : 54272, "is-cluster-start" : true, "log-cluster" : 5 }, { "glyph" : 268435488, - "width" : 0, + "width" : 54272, "is-cluster-start" : true, "log-cluster" : 6 } diff --git a/tests/layouts/valid-14.layout b/tests/layouts/valid-14.layout index 10cef38b..69d061b0 100644 --- a/tests/layouts/valid-14.layout +++ b/tests/layouts/valid-14.layout @@ -189,8 +189,8 @@ "runs" : [ { "offset" : 0, - "length" : 3, - "text" : "你", + "length" : 6, + "text" : "你好", "bidi-level" : 0, "gravity" : "south", "language" : "en-us", @@ -241,9 +241,9 @@ ] }, { - "offset" : 3, - "length" : 4, - "text" : "好 ", + "offset" : 6, + "length" : 1, + "text" : " ", "bidi-level" : 0, "gravity" : "south", "language" : "xx", @@ -266,16 +266,10 @@ "end-x-offset" : 0, "glyphs" : [ { - "glyph" : 1, + "glyph" : 268435488, "width" : 15360, "is-cluster-start" : true, "log-cluster" : 0 - }, - { - "glyph" : 268435488, - "width" : 0, - "is-cluster-start" : true, - "log-cluster" : 3 } ] }, -- cgit v1.2.1