From 13b0fbbd9591836bfa8372ecd25a72c8fa1ade14 Mon Sep 17 00:00:00 2001 From: Benoit KUGLER Date: Sat, 13 Dec 2025 09:24:46 +0100 Subject: [PATCH] [harfbuzz] check advances in test suite (related to #210) --- harfbuzz/harfbuzz_shape_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/harfbuzz/harfbuzz_shape_test.go b/harfbuzz/harfbuzz_shape_test.go index eb19b2f5..27c53aa1 100644 --- a/harfbuzz/harfbuzz_shape_test.go +++ b/harfbuzz/harfbuzz_shape_test.go @@ -284,6 +284,17 @@ func (mft testInput) shape(t *testing.T, verify bool) (string, error) { return "", err } + // check that YAdvance is only used for vertical text + // and XAdvance for horizontal text + isHorizontal := buffer.Props.Direction.isHorizontal() + for _, pos := range buffer.Pos { + if isHorizontal { + tu.Assert(t, pos.YAdvance == 0) + } else { + tu.Assert(t, pos.XAdvance == 0) + } + } + return buffer.serialize(font, mft.format), nil }