summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-01-02 18:56:10 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-01-02 18:56:10 +0000
commite5cefff034652310509b76e109b898c10bac9d58 (patch)
treed99fc0cc56fc4754c61e244f150bb8af493177d4
parente7147f503495aa88299ca597382c4a4584ea268e (diff)
parent67f5d7387814a23b571f15353ad61b3a201a1de1 (diff)
downloadpango-e5cefff034652310509b76e109b898c10bac9d58.tar.gz
Merge branch 'matthiasc/for-main' into 'main'
Add a test for letterspacing See merge request GNOME/pango!570
-rw-r--r--pango/pango-item.c1
-rw-r--r--tests/layouts/letterspacing.layout135
-rw-r--r--tests/meson.build1
3 files changed, 137 insertions, 0 deletions
diff --git a/pango/pango-item.c b/pango/pango-item.c
index c599241f..944bfe2d 100644
--- a/pango/pango-item.c
+++ b/pango/pango-item.c
@@ -317,6 +317,7 @@ pango_analysis_collect_features (const PangoAnalysis *analysis,
HB_TAG('l','i','g','a'),
HB_TAG('c','l','i','g'),
HB_TAG('d','l','i','g'),
+ HB_TAG('h','l','i','g'),
};
int i;
for (i = 0; i < G_N_ELEMENTS (tags); i++)
diff --git a/tests/layouts/letterspacing.layout b/tests/layouts/letterspacing.layout
new file mode 100644
index 00000000..f1eb5fa5
--- /dev/null
+++ b/tests/layouts/letterspacing.layout
@@ -0,0 +1,135 @@
+{
+ "context" : {
+ "font" : "serif 12",
+ "base-gravity" : "south",
+ "gravity-hint" : "natural",
+ "base-dir" : "weak-ltr",
+ "round-glyph-positions" : true,
+ "transform" : [
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0
+ ]
+ },
+ "text" : "ffi",
+ "attributes" : [
+ {
+ "type" : "letter-spacing",
+ "value" : 10240
+ },
+ {
+ "type" : "font-features",
+ "value" : "liga=1"
+ }
+ ],
+ "font" : "DejaVu Sans 32",
+ "output" : {
+ "is-wrapped" : false,
+ "is-ellipsized" : false,
+ "unknown-glyphs" : 0,
+ "width" : 63488,
+ "height" : 52224,
+ "log-attrs" : [
+ {
+ "char-break" : true,
+ "cursor-position" : true,
+ "word-start" : true,
+ "sentence-boundary" : true,
+ "sentence-start" : true,
+ "backspace-deletes-character" : true,
+ "word-boundary" : true
+ },
+ {
+ "char-break" : true,
+ "cursor-position" : true,
+ "break-inserts-hyphen" : true
+ },
+ {
+ "char-break" : true,
+ "cursor-position" : true,
+ "break-inserts-hyphen" : true
+ },
+ {
+ "line-break" : true,
+ "mandatory-break" : true,
+ "char-break" : true,
+ "white" : true,
+ "cursor-position" : true,
+ "word-end" : true,
+ "sentence-boundary" : true,
+ "sentence-end" : true,
+ "word-boundary" : true
+ }
+ ],
+ "lines" : [
+ {
+ "start-index" : 0,
+ "length" : 3,
+ "paragraph-start" : true,
+ "direction" : "ltr",
+ "runs" : [
+ {
+ "offset" : 0,
+ "length" : 3,
+ "text" : "ffi",
+ "bidi-level" : 0,
+ "gravity" : "south",
+ "language" : "en-us",
+ "script" : "latin",
+ "font" : {
+ "description" : "DejaVu Sans 32",
+ "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01",
+ "matrix" : [
+ 1,
+ -0,
+ -0,
+ 1,
+ 0,
+ 0
+ ]
+ },
+ "flags" : 0,
+ "extra-attributes" : [
+ {
+ "type" : "letter-spacing",
+ "value" : 10240
+ },
+ {
+ "type" : "font-features",
+ "value" : "liga=1"
+ }
+ ],
+ "y-offset" : 0,
+ "start-x-offset" : 0,
+ "end-x-offset" : 0,
+ "glyphs" : [
+ {
+ "glyph" : 73,
+ "width" : 20480,
+ "is-cluster-start" : true,
+ "log-cluster" : 0
+ },
+ {
+ "glyph" : 73,
+ "width" : 25600,
+ "x-offset" : 5120,
+ "is-cluster-start" : true,
+ "log-cluster" : 1
+ },
+ {
+ "glyph" : 76,
+ "width" : 17408,
+ "x-offset" : 5120,
+ "is-cluster-start" : true,
+ "log-cluster" : 2
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/tests/meson.build b/tests/meson.build
index b885f999..83732b5a 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -124,6 +124,7 @@ installed_test_layouts_data = [
'layouts/arabic-format.layout',
'layouts/no-space.layout',
'layouts/aaa.layout',
+ 'layouts/letterspacing.layout',
]
installed_test_fonts_data = [