diff options
Diffstat (limited to 'tests')
66 files changed, 16404 insertions, 1295 deletions
diff --git a/tests/breaks/eight.expected b/tests/breaks/eight.expected index 39794d22..d71bb02f 100644 --- a/tests/breaks/eight.expected +++ b/tests/breaks/eight.expected @@ -4,4 +4,4 @@ Whitespace: x x x x Sentences: bs e b Words: bs be bs e s be bs be b bs be bs be bs be bs be bs be b Graphemes: b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b -Hyphens: i i i i i i i i i i i i i i i i +Hyphens: i i i i i i i i i i i i i i i i diff --git a/tests/breaks/eleven.expected b/tests/breaks/eleven.expected index 8df89869..b4a33897 100644 --- a/tests/breaks/eleven.expected +++ b/tests/breaks/eleven.expected @@ -1,7 +1,7 @@ -Text: ❤ ️ ︎ ︎ 👨 [0x200d]🦰 👨🏿 [0x200d]🦱 0 ️ ⃣ 🏴[0xe0075][0xe0073][0xe0063][0xe0061][0xe007f] 🇩🇪 ️ [0x0a] -Breaks: c lc lc lc lc lc c lc -Whitespace: w w -Sentences: bs e b -Words: b b b bs be b b b -Graphemes: b b b b b b b b -Hyphens: i i i i i i i i +Text: ❤️ ︎ ︎ 👨[0x200d] 🦰 👨🏿[0x200d] 🦱 0️ ⃣ 🏴[0xe0075][0xe0073][0xe0063][0xe0061][0xe007f] 🇩🇪️ [0x0a] +Breaks: c lc lc lc lc lc c Lc +Whitespace: w w +Sentences: bs e b +Words: b b b bs be b b b +Graphemes: b b b b b b b b +Hyphens: i i i i i diff --git a/tests/breaks/fifteen.expected b/tests/breaks/fifteen.expected index 93b37c39..3521a70b 100644 --- a/tests/breaks/fifteen.expected +++ b/tests/breaks/fifteen.expected @@ -1,7 +1,7 @@ Text: o n e [ ] t w o - t h r e e [ ] f o [0xad] u r [0x0a] -Breaks: c c c c lc c c c lc c c c c c lc c c lc c c lc +Breaks: c c c c lc c c c lc c c c c c lc c c lc c c Lc Whitespace: x x w w Sentences: bs e b Words: bs be bs be bs be bs be b Graphemes: b b b b b b b b b b b b b b b b b b b b b -Hyphens: i i i i i i i i i +Hyphens: i i i i i i i i i i diff --git a/tests/breaks/one.expected b/tests/breaks/one.expected index 44fee3ef..6c811256 100644 --- a/tests/breaks/one.expected +++ b/tests/breaks/one.expected @@ -1,7 +1,7 @@ Text: a b c / d e f [ ] g h i [0xad] j k l . [ ] B l a [0x0a] -Breaks: c c c c lc c c c lc c c c lc c c c c lc c c c lc +Breaks: c c c c lc c c c lc c c c lc c c c c lc c c c Lc Whitespace: x x w w Sentences: bs e bs e b Words: bs be bs be bs be b bs be b Graphemes: b b b b b b b b b b b b b b b b b b b b b b -Hyphens: i i i i i i i i i i i +Hyphens: i i i i i i i i i i i i diff --git a/tests/breaks/seventeen.expected b/tests/breaks/seventeen.expected index 8f5f2749..35fb5120 100644 --- a/tests/breaks/seventeen.expected +++ b/tests/breaks/seventeen.expected @@ -4,4 +4,4 @@ Whitespace: x x x w Sentences: bs e bs e bs e b Words: bs be bs be bs be bs e s be bs be bs be bs be bs e s be bs be bs be bs be bs e s e s be b Graphemes: b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b -Hyphens: i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i +Hyphens: i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i diff --git a/tests/breaks/sixteen.expected b/tests/breaks/sixteen.expected index 0fd06fb2..2868b8e4 100644 --- a/tests/breaks/sixteen.expected +++ b/tests/breaks/sixteen.expected @@ -1,7 +1,7 @@ Text: h y ‧ p h e n | a t i o n [ ] o v e r [0xad] l o a d [0x0a] -Breaks: c c c lc c c c c lc c c c c c lc c c c c lc c c c c lc +Breaks: c c c lc c c c c lc c c c c c lc c c c c lc c c c c Lc Whitespace: x w w Sentences: bs e b Words: bs e s be bs be bs be b Graphemes: b b b b b b b b b b b b b b b b b b b b b b b b b -Hyphens: i ri i i i i i i i i i i i i i i +Hyphens: i ri i i i i i i i i i i i i i i i diff --git a/tests/breaks/thirteen.expected b/tests/breaks/thirteen.expected index e6b1787d..25a38150 100644 --- a/tests/breaks/thirteen.expected +++ b/tests/breaks/thirteen.expected @@ -1,7 +1,7 @@ Text: a [ ] a b [0x200b] s p [0x200b] [ ] [ ] d e [0xad] f g [ ] b [0x0a] -Breaks: c c lc c c lc c c c c lc c c lc c c lc c lc +Breaks: c c lc c c lc c c c c lc c c lc c c lc c Lc Whitespace: x x x x w w Sentences: bs e b Words: bs be bs be bs be b Graphemes: b b b b b b b b b b b b b b b b b b b -Hyphens: i i i i i i +Hyphens: i i i i i i i i diff --git a/tests/breaks/two.break b/tests/breaks/two.break index 6ff0a36e..53c39c5c 100644 --- a/tests/breaks/two.break +++ b/tests/breaks/two.break @@ -1,3 +1,3 @@ # Example from https://gitlab.gnome.org/GNOME/pango/issues/218 # This shows difference between word start/end and boundary -goril·les +goril‧les diff --git a/tests/breaks/two.expected b/tests/breaks/two.expected index 2921d224..58d15186 100644 --- a/tests/breaks/two.expected +++ b/tests/breaks/two.expected @@ -1,7 +1,7 @@ -Text: g o r i l · l e s [0x0a] -Breaks: c c c c c c c c c c lc -Whitespace: w w -Sentences: bs e b -Words: bs e s be b -Graphemes: b b b b b b b b b b b -Hyphens: i i i i i i i +Text: g o r i l ‧ l e s [0x0a] +Breaks: c c c c c c lc c c c Lc +Whitespace: w w +Sentences: bs e b +Words: bs e s be b +Graphemes: b b b b b b b b b b b +Hyphens: i i i i ri i i diff --git a/tests/fonts/Cantarell-VF.otf b/tests/fonts/Cantarell-VF.otf Binary files differnew file mode 100644 index 00000000..cd2ccf42 --- /dev/null +++ b/tests/fonts/Cantarell-VF.otf diff --git a/tests/fonts/DejaVuSans.ttf b/tests/fonts/DejaVuSans.ttf Binary files differnew file mode 100644 index 00000000..46bb331e --- /dev/null +++ b/tests/fonts/DejaVuSans.ttf diff --git a/tests/fonts/README b/tests/fonts/README new file mode 100644 index 00000000..df48f804 --- /dev/null +++ b/tests/fonts/README @@ -0,0 +1,4 @@ +The fonts in this directory are available to test-layout tests. +emoji-subset.ttf is a subset of Noto Color Emoji that is just +big enough to provide the Emoji that are present in our test +cases. diff --git a/tests/fonts/emoji-subset.ttf b/tests/fonts/emoji-subset.ttf Binary files differnew file mode 100644 index 00000000..2addf727 --- /dev/null +++ b/tests/fonts/emoji-subset.ttf diff --git a/tests/layouts/bratwurst.layout b/tests/layouts/bratwurst.layout new file mode 100644 index 00000000..c31446ac --- /dev/null +++ b/tests/layouts/bratwurst.layout @@ -0,0 +1,225 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "A case with a single word made up of two items,", + "expected to produce a single overlong line." + ], + "text" : "Bratwurst", + "attributes" : [ + { + "start" : 4, + "type" : "style", + "value" : "italic" + } + ], + "font" : "Cantarell Bold 32", + "width" : 87040, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 202752, + "height" : 53248, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : 9, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 4, + "text" : "Brat", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 29, + "width" : 28672, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 244, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 3 + } + ] + }, + { + "offset" : 4, + "length" : 5, + "text" : "wurst", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 467, + "width" : 35840, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 438, + "width" : 24576, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 20480, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/bratwurst2.layout b/tests/layouts/bratwurst2.layout new file mode 100644 index 00000000..ffd37cdd --- /dev/null +++ b/tests/layouts/bratwurst2.layout @@ -0,0 +1,188 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "A single word, expected to produce a single", + "overlong line." + ], + "text" : "Bratwurst", + "font" : "Cantarell Bold 32", + "width" : 87040, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 202752, + "height" : 53248, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : 9, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 9, + "text" : "Bratwurst", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 29, + "width" : 28672, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 244, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 467, + "width" : 35840, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 438, + "width" : 24576, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 417, + "width" : 20480, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 8 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/bratwurst3.layout b/tests/layouts/bratwurst3.layout new file mode 100644 index 00000000..e79ba81c --- /dev/null +++ b/tests/layouts/bratwurst3.layout @@ -0,0 +1,318 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "A single word with word-char wrapping,", + "expected to be broken to fit the line width." + ], + "text" : "Bratwurst", + "font" : "Cantarell Bold 32", + "wrap" : "word-char", + "width" : 87040, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 78848, + "height" : 212992, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : 2, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 2, + "text" : "Br", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 29, + "width" : 28672, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1081, + "width" : 18432, + "log-cluster" : 1 + } + ] + } + ] + }, + { + "start-index" : 2, + "length" : 2, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 2, + "length" : 2, + "text" : "at", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1081, + "width" : 18432, + "log-cluster" : 1 + } + ] + } + ] + }, + { + "start-index" : 4, + "length" : 2, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 4, + "length" : 2, + "text" : "wu", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 467, + "width" : 35840, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 438, + "width" : 24576, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1081, + "width" : 18432, + "log-cluster" : 1 + } + ] + } + ] + }, + { + "start-index" : 6, + "length" : 3, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 6, + "length" : 3, + "text" : "rst", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 417, + "width" : 20480, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/bratwurst4.layout b/tests/layouts/bratwurst4.layout new file mode 100644 index 00000000..f25f1e9e --- /dev/null +++ b/tests/layouts/bratwurst4.layout @@ -0,0 +1,245 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "A single word with a soft hyphen,", + "expected to be broken at the soft", + "hyphen and still produce overlong", + "lines." + ], + "text" : "Bratwurst", + "font" : "Cantarell Bold 32", + "width" : 87040, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 115712, + "height" : 106496, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : 6, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "Brat", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 29, + "width" : 28672, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 244, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1081, + "width" : 18432, + "log-cluster" : 4 + } + ] + } + ] + }, + { + "start-index" : 6, + "length" : 5, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 6, + "length" : 5, + "text" : "wurst", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 467, + "width" : 35840, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 438, + "width" : 24576, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 20480, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 430, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/effigy.layout b/tests/layouts/effigy.layout new file mode 100644 index 00000000..cc8c4282 --- /dev/null +++ b/tests/layouts/effigy.layout @@ -0,0 +1,188 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "A ligature that is expected to be borken", + "to produce two fitting lines." + ], + "text" : "effigy", + "font" : "DejaVu Sans 32", + "wrap" : "char", + "width" : 81920, + "height" : 2048, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 73728, + "height" : 102400, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : "eff", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "DejaVu Sans 32", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 72, + "width" : 26624, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 5041, + "width" : 30720, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 2803, + "width" : 16384, + "log-cluster" : 1 + } + ] + } + ] + }, + { + "start-index" : 3, + "length" : 3, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 3, + "length" : 3, + "text" : "igy", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "DejaVu Sans 32", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 76, + "width" : 12288, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 74, + "width" : 27648, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 92, + "width" : 25600, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/kebab.layout b/tests/layouts/kebab.layout new file mode 100644 index 00000000..357fd40d --- /dev/null +++ b/tests/layouts/kebab.layout @@ -0,0 +1,254 @@ +{ + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "comment" : [ + "Two words, expected to be broken", + "between words, collapsing the space", + "and still produce two overlong lines." + ], + "text" : "Döner Kebab", + "font" : "Cantarell Bold 32", + "width" : 87040, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 126976, + "height" : 106496, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : 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" : 7, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 7, + "text" : "Döner ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 37, + "width" : 31744, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 381, + "width" : 25600, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 360, + "width" : 25600, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 287, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 409, + "width" : 18432, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 6 + } + ] + } + ] + }, + { + "start-index" : 7, + "length" : 5, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 7, + "length" : 5, + "text" : "Kebab", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Bold 32", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 8374 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 100, + "width" : 28672, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 272, + "width" : 25600, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 244, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 272, + "width" : 25600, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + } + ] + } + ] + } +} diff --git a/tests/layouts/valid-1.expected b/tests/layouts/valid-1.expected deleted file mode 100644 index 96bbed57..00000000 --- a/tests/layouts/valid-1.expected +++ /dev/null @@ -1,43 +0,0 @@ -This is a test of the automatic emergency brake! - ---- parameters - -wrapped: 0 -ellipsized: 1 -lines: 2 -width: 225280 - ---- attributes - -range 0 22 -range 22 41 -22 41 foreground #00000000ffff -22 41 underline single -range 41 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 47(1) 49(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'This is a test of the automatic emergency brake! -' -i=2, index=49, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=22, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'This is a test of the ' -i=2, index=22, chars=11, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'automatic e' -22 41 foreground #00000000ffff -22 41 underline single -i=3, index=33, chars=15, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, 'mergency brake!' -0 2147483647 fallback false -22 41 foreground #00000000ffff -22 41 underline single -i=4, index=48, no run, line end -i=5, index=49, no run, line end diff --git a/tests/layouts/valid-1.layout b/tests/layouts/valid-1.layout index 9289830b..8ee8cf46 100644 --- a/tests/layouts/valid-1.layout +++ b/tests/layouts/valid-1.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "This is a test of the automatic emergency brake!\n", "attributes" : [ { @@ -16,5 +32,660 @@ ], "font" : "Cantarell 11", "ellipsize" : "end", - "width" : 225280 + "width" : 225280, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 225280, + "height" : 37888, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 48, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 22, + "text" : "This is a test of the ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 187, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + } + ] + }, + { + "offset" : 22, + "length" : 11, + "text" : "automatic e", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 22, + "end" : 41, + "type" : "foreground", + "value" : "#00000000ffff" + }, + { + "start" : 22, + "end" : 41, + "type" : "underline", + "value" : "single" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + } + ] + }, + { + "offset" : 33, + "length" : 15, + "text" : "mergency brake!", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : false + }, + { + "start" : 22, + "end" : 41, + "type" : "foreground", + "value" : "#00000000ffff" + }, + { + "start" : 22, + "end" : 41, + "type" : "underline", + "value" : "single" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1062, + "width" : 20480, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 49, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-10.expected b/tests/layouts/valid-10.expected deleted file mode 100644 index 6eb02946..00000000 --- a/tests/layouts/valid-10.expected +++ /dev/null @@ -1,37 +0,0 @@ -Hello שלום Γειά σας - ---- parameters - -wrapped: 0 -ellipsized: 1 -lines: 2 -width: 102400 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 12(0) 10(0) 8(0) 14(0) 15(0) 17(0) 19(0) 21(0) 23(0) 24(0) 26(0) 28(0) 28(1) 31(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'Hello שלום Γειά σας -' -i=2, index=31, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Hello ' -i=2, index=12, chars=4, level=1, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, 'שלום' -i=3, index=14, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, ' ' -i=4, index=15, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=greek, language=el, 'Γ' -i=5, index=17, chars=7, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, 'ειά σας' -0 2147483647 fallback false -i=6, index=30, no run, line end -i=7, index=31, no run, line end diff --git a/tests/layouts/valid-10.layout b/tests/layouts/valid-10.layout index 0d36a38d..765aba83 100644 --- a/tests/layouts/valid-10.layout +++ b/tests/layouts/valid-10.layout @@ -1,8 +1,417 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "Hello שלום Γειά σας\n", - "attributes" : [], "font" : "Cantarell 11", "justify" : true, "ellipsize" : "end", - "width" : 102400 + "width" : 102400, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 102400, + "height" : 38912, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 30, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "Hello ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 76, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + } + ] + }, + { + "offset" : 6, + "length" : 8, + "text" : "שלום", + "bidi-level" : 1, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1332, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1331, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1344, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 14, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 15, + "length" : 2, + "text" : "Γ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "el", + "script" : "greek", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 677, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 17, + "length" : 13, + "text" : "ειά σας", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : false + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1062, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 31, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-11.expected b/tests/layouts/valid-11.expected deleted file mode 100644 index c22daf87..00000000 --- a/tests/layouts/valid-11.expected +++ /dev/null @@ -1,53 +0,0 @@ -double low error - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 -width: 225280 - ---- attributes - -range 0 6 -0 6 underline double -0 6 overline single -range 6 7 -range 7 10 -7 10 underline low -7 10 strikethrough true -range 10 11 -range 11 16 -11 16 underline error -11 16 rise 1024 -range 16 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 15(1) 17(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'double low error -' -i=2, index=17, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'double' -0 6 underline double -0 6 overline single -i=2, index=6, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=3, index=7, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'low' -7 10 underline low -7 10 strikethrough true -i=4, index=10, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=5, index=11, chars=5, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'error' -11 16 rise 1024 -11 16 underline error -i=6, index=16, no run, line end -i=7, index=17, no run, line end diff --git a/tests/layouts/valid-11.layout b/tests/layouts/valid-11.layout index a044cc53..9a5e5f40 100644 --- a/tests/layouts/valid-11.layout +++ b/tests/layouts/valid-11.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "double low error\n", "attributes" : [ { @@ -38,5 +54,429 @@ ], "font" : "Cantarell 11", "wrap" : "char", - "width" : 225280 + "width" : 225280, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 109568, + "height" : 38912, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 16, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "double", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 6, + "type" : "underline", + "value" : "double" + }, + { + "end" : 6, + "type" : "overline", + "value" : "single" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + } + ] + }, + { + "offset" : 6, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 7, + "length" : 3, + "text" : "low", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 7, + "end" : 10, + "type" : "underline", + "value" : "low" + }, + { + "start" : 7, + "end" : 10, + "type" : "strikethrough", + "value" : true + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + }, + { + "offset" : 10, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 11, + "length" : 5, + "text" : "error", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 11, + "end" : 16, + "type" : "rise", + "value" : 1024 + }, + { + "start" : 11, + "end" : 16, + "type" : "underline", + "value" : "error" + } + ], + "y-offset" : 1024, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + } + ] + }, + { + "start-index" : 17, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-12.expected b/tests/layouts/valid-12.expected deleted file mode 100644 index d66ae134..00000000 --- a/tests/layouts/valid-12.expected +++ /dev/null @@ -1,35 +0,0 @@ -a b c d
e f g h - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 3 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 25(1) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 50(1) 52(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'a b c d
' -i=2, index=28, paragraph-start=0, dir=ltr 'e f g h -' -i=3, index=52, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=25, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'a b c d' -i=2, index=25, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '
' -i=3, index=28, no run, line end -i=4, index=28, chars=23, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'e f g h' -i=5, index=51, no run, line end -i=6, index=52, no run, line end diff --git a/tests/layouts/valid-12.layout b/tests/layouts/valid-12.layout index 1c9fa227..59451e08 100644 --- a/tests/layouts/valid-12.layout +++ b/tests/layouts/valid-12.layout @@ -1,6 +1,21 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "a b c d
e f g h\n", - "attributes" : [], "font" : "Cantarell 11", "tabs" : { "positions-in-pixels" : true, @@ -11,5 +26,763 @@ 150, 200 ] + }, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 1, + "width" : 113664, + "height" : 56320, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 28, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 25, + "text" : "a b c d", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 24 + } + ] + }, + { + "offset" : 25, + "length" : 3, + "text" : "
", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 268443688, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 28, + "length" : 23, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 28, + "length" : 23, + "text" : "e f g h", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + } + ] + } + ] + }, + { + "start-index" : 52, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] } } diff --git a/tests/layouts/valid-13.expected b/tests/layouts/valid-13.expected deleted file mode 100644 index cc435a88..00000000 --- a/tests/layouts/valid-13.expected +++ /dev/null @@ -1,35 +0,0 @@ -a b c d
e f g h - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 1 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 51(0) 51(1) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'a b c d
e f g h -' - ---- runs - -i=1, index=0, chars=25, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'a b c d' -0 4294967295 show 2 -i=2, index=25, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '
' -0 4294967295 show 2 -i=3, index=28, chars=24, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'e f g h -' -0 4294967295 show 2 -i=4, index=52, no run, line end diff --git a/tests/layouts/valid-13.layout b/tests/layouts/valid-13.layout index a9f10f86..b3aaeb1c 100644 --- a/tests/layouts/valid-13.layout +++ b/tests/layouts/valid-13.layout @@ -1,6 +1,21 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "a b c d
e f g h\n", - "attributes" : [], "font" : "Cantarell 11", "tabs" : { "positions-in-pixels" : true, @@ -12,5 +27,772 @@ 200 ] }, - "single-paragraph" : true + "single-paragraph" : true, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 2, + "width" : 219136, + "height" : 18432, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 52, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 25, + "text" : "a b c d", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "type" : "show", + "value" : 2 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 24 + } + ] + }, + { + "offset" : 25, + "length" : 3, + "text" : "
", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "type" : "show", + "value" : 2 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 268443688, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 28, + "length" : 24, + "text" : "e f g h\n", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "type" : "show", + "value" : 2 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 268435466, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 23 + } + ] + } + ] + } + ] + } } diff --git a/tests/layouts/valid-14.expected b/tests/layouts/valid-14.expected deleted file mode 100644 index 89172781..00000000 --- a/tests/layouts/valid-14.expected +++ /dev/null @@ -1,38 +0,0 @@ -你好 Hello שלום Γειά σας - ---- parameters - -wrapped: 0 -ellipsized: 1 -lines: 2 -width: 161792 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 3(0) 6(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 19(0) 17(0) 15(0) 21(0) 22(0) 24(0) 26(0) 28(0) 30(0) 31(0) 33(0) 35(0) 35(1) 38(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr '你好 Hello שלום Γειά σας -' -i=2, index=38, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=1, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, '你' -0 2147483647 fallback true -i=2, index=3, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=han, language=xx, '好 ' -i=3, index=7, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Hello ' -i=4, index=19, chars=4, level=1, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, 'שלום' -i=5, index=21, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, ' ' -i=6, index=22, chars=8, level=0, gravity=south, flags=0, font=OMITTED, script=greek, language=el, 'Γειά σας' -i=7, index=37, no run, line end -i=8, index=38, no run, line end diff --git a/tests/layouts/valid-14.layout b/tests/layouts/valid-14.layout index 116cc94f..61e7182e 100644 --- a/tests/layouts/valid-14.layout +++ b/tests/layouts/valid-14.layout @@ -1,8 +1,528 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "你好 Hello שלום Γειά σας\n", - "attributes" : [], "font" : "Cantarell 11", "ellipsize" : "start", "width" : 161792, - "line-spacing" : 1.5 + "line-spacing" : 1.5, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 161792, + "height" : 47104, + "log-attrs" : [ + { + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "sentence-boundary" : true, + "sentence-start" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 37, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "你好", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : true + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1058, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1058, + "width" : 4096, + "log-cluster" : 0 + }, + { + "glyph" : 1058, + "width" : 16384, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 6, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "xx", + "script" : "han", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 7, + "length" : 6, + "text" : "Hello ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 76, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + } + ] + }, + { + "offset" : 13, + "length" : 8, + "text" : "שלום", + "bidi-level" : 1, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1332, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1331, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1344, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 21, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 22, + "length" : 15, + "text" : "Γειά σας", + "bidi-level" : 0, + "gravity" : "south", + "language" : "el", + "script" : "greek", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 677, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 808, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 812, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 837, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 822, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 804, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 821, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 13 + } + ] + } + ] + }, + { + "start-index" : 38, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-15.expected b/tests/layouts/valid-15.expected deleted file mode 100644 index f029482a..00000000 --- a/tests/layouts/valid-15.expected +++ /dev/null @@ -1,36 +0,0 @@ -Lets see if this text is long enough to wrap due to height limitations. It might, or it might not. - ---- parameters - -wrapped: 1 -ellipsized: 1 -lines: 2 -width: 153600 -height: 40960 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 24(1) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 51(0) 52(0) 53(0) 54(0) 55(0) 56(0) 57(0) 58(0) 59(0) 60(0) 61(0) 62(0) 63(0) 64(0) 65(0) 66(0) 67(0) 68(0) 69(0) 70(0) 71(0) 72(0) 73(0) 74(0) 75(0) 76(0) 77(0) 78(0) 79(0) 80(0) 81(0) 82(0) 83(0) 84(0) 85(0) 86(0) 87(0) 88(0) 89(0) 90(0) 91(0) 92(0) 93(0) 94(0) 95(0) 96(0) 97(0) 97(1) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'Lets see if this text is ' -i=2, index=25, paragraph-start=0, dir=ltr 'long enough to wrap due to height limitations. It might, or it might not. -' - ---- runs - -i=1, index=0, chars=25, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Lets see if this text is ' -i=2, index=25, no run, line end -i=3, index=25, chars=20, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'long enough to wrap ' -i=4, index=45, chars=53, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, 'due to height limitations. It might, or it might not.' -0 2147483647 fallback false -i=5, index=98, no run, line end diff --git a/tests/layouts/valid-15.layout b/tests/layouts/valid-15.layout index 9f584ba6..b6613068 100644 --- a/tests/layouts/valid-15.layout +++ b/tests/layouts/valid-15.layout @@ -1,8 +1,1033 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "Lets see if this text is long enough to wrap due to height limitations. It might, or it might not.\n", - "attributes" : [], "font" : "Cantarell 11", "ellipsize" : "end", "width" : 153600, - "height" : 40960 + "height" : 40960, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 153600, + "height" : 36864, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "sentence-boundary" : true, + "sentence-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 25, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 25, + "text" : "Lets see if this text is ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 103, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 472, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 24 + } + ] + } + ] + }, + { + "start-index" : 25, + "length" : 73, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 25, + "length" : 20, + "text" : "long enough to wrap ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + } + ] + }, + { + "offset" : 45, + "length" : 53, + "text" : "due to height limitations. It might, or it might not.", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : false + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1062, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + } + ] + } } diff --git a/tests/layouts/valid-16.expected b/tests/layouts/valid-16.expected deleted file mode 100644 index 01af96cf..00000000 --- a/tests/layouts/valid-16.expected +++ /dev/null @@ -1,37 +0,0 @@ -Lets see if this text is long enough to wrap due to height limitations. It might, or it might not. - ---- parameters - -wrapped: 1 -ellipsized: 1 -lines: 3 -width: 153600 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 24(1) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 51(0) 52(0) 53(0) 54(0) 55(0) 56(0) 57(0) 58(0) 59(0) 60(0) 61(0) 62(0) 63(0) 64(0) 65(0) 66(0) 67(0) 68(0) 69(0) 70(0) 71(0) 72(0) 73(0) 74(0) 75(0) 76(0) 77(0) 78(0) 79(0) 80(0) 81(0) 82(0) 83(0) 84(0) 85(0) 86(0) 87(0) 88(0) 89(0) 90(0) 91(0) 92(0) 93(0) 94(0) 95(0) 96(0) 97(0) 97(1) 99(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'Lets see if this text is ' -i=2, index=25, paragraph-start=0, dir=ltr 'long enough to wrap due to height limitations. It might, or it might not. -' -i=3, index=99, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=25, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Lets see if this text is ' -i=2, index=25, no run, line end -i=3, index=25, chars=20, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'long enough to wrap ' -i=4, index=45, chars=53, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, 'due to height limitations. It might, or it might not.' -0 2147483647 fallback false -i=5, index=98, no run, line end -i=6, index=99, no run, line end diff --git a/tests/layouts/valid-16.layout b/tests/layouts/valid-16.layout index e2a82d96..fc2776e2 100644 --- a/tests/layouts/valid-16.layout +++ b/tests/layouts/valid-16.layout @@ -1,9 +1,1041 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "Lets see if this text is long enough to wrap due to height limitations. It might, or it might not.\n", - "attributes" : [], "font" : "Cantarell 11", "wrap" : "word-char", "ellipsize" : "end", "width" : 153600, - "height" : -2 + "height" : -2, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 153600, + "height" : 56320, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "sentence-boundary" : true, + "sentence-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 25, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 25, + "text" : "Lets see if this text is ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 103, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 472, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 24 + } + ] + } + ] + }, + { + "start-index" : 25, + "length" : 73, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 25, + "length" : 20, + "text" : "long enough to wrap ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + } + ] + }, + { + "offset" : 45, + "length" : 53, + "text" : "due to height limitations. It might, or it might not.", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : false + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1062, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 99, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-17.expected b/tests/layouts/valid-17.expected deleted file mode 100644 index 4b3192fb..00000000 --- a/tests/layouts/valid-17.expected +++ /dev/null @@ -1,35 +0,0 @@ -some|bla|bla|bla - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 3 -width: 102400 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 12(1) 14(0) 15(0) 15(1) 17(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'some|bla|bla|' -i=2, index=13, paragraph-start=0, dir=ltr 'bla -' -i=3, index=17, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=13, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'some|bla|bla|' -i=2, index=13, no run, line end -i=3, index=13, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'bla' -i=4, index=16, no run, line end -i=5, index=17, no run, line end diff --git a/tests/layouts/valid-17.layout b/tests/layouts/valid-17.layout index 062cc241..71182844 100644 --- a/tests/layouts/valid-17.layout +++ b/tests/layouts/valid-17.layout @@ -1,7 +1,335 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "some|bla|bla|bla\n", - "attributes" : [], "font" : "Cantarell 11", "justify" : true, - "width" : 102400 + "width" : 102400, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 102400, + "height" : 56320, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 13, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 13, + "text" : "some|bla|bla|", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 358, + "width" : 14336, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1188, + "width" : 5120, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 272, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 349, + "width" : 5120, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 244, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1188, + "width" : 5120, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 272, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 349, + "width" : 5120, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 244, + "width" : 9216, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 1188, + "width" : 5120, + "x-offset" : 1024, + "is-cluster-start" : true, + "log-cluster" : 12 + } + ] + } + ] + }, + { + "start-index" : 13, + "length" : 3, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 13, + "length" : 3, + "text" : "bla", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + } + ] + }, + { + "start-index" : 17, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-18.expected b/tests/layouts/valid-18.expected deleted file mode 100644 index ea6aabeb..00000000 --- a/tests/layouts/valid-18.expected +++ /dev/null @@ -1,40 +0,0 @@ -some line breaks
and miscellaneous ignorables - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 3 - ---- attributes - -range 0 57 -0 57 show 7 -range 57 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 16(1) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 26(0) 28(0) 29(0) 30(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 46(0) 47(0) 48(0) 49(0) 53(0) 54(0) 55(0) 56(0) 56(1) 58(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'some line breaks
' -i=2, index=19, paragraph-start=0, dir=ltr 'and miscellaneous ignorables -' -i=3, index=58, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=16, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'some line breaks' -0 57 show 7 -i=2, index=16, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '
' -0 57 show 7 -i=3, index=19, no run, line end -i=4, index=19, chars=32, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'and miscellaneous ignorables' -0 57 show 7 -i=5, index=57, no run, line end -i=6, index=58, no run, line end diff --git a/tests/layouts/valid-18.layout b/tests/layouts/valid-18.layout index 85e9a7d1..2337a562 100644 --- a/tests/layouts/valid-18.layout +++ b/tests/layouts/valid-18.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "some line breaks
and miscellaneous ignorables\n", "attributes" : [ { @@ -7,5 +23,741 @@ "value" : 7 } ], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 5, + "width" : 302080, + "height" : 56320, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "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 + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 19, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 16, + "text" : "some line breaks", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 57, + "type" : "show", + "value" : 7 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1195, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1195, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 15 + } + ] + }, + { + "offset" : 16, + "length" : 3, + "text" : "
", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 57, + "type" : "show", + "value" : 7 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 268443688, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 19, + "length" : 38, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 19, + "length" : 38, + "text" : "and miscellaneous ignorables", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 57, + "type" : "show", + "value" : 7 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1195, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 268435629, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 268435629, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1195, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 268500735, + "width" : 23552, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 27 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 29 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 30 + }, + { + "glyph" : 268443660, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 31 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 34 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 35 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 36 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 37 + } + ] + } + ] + }, + { + "start-index" : 58, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-19.expected b/tests/layouts/valid-19.expected deleted file mode 100644 index 5e115e47..00000000 --- a/tests/layouts/valid-19.expected +++ /dev/null @@ -1,42 +0,0 @@ - a⃠ 😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 © - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 5(0) 6(0) 13(0) 14(0) 21(0) 22(0) 30(0) 31(0) 34(0) 35(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 71(0) 72(0) 72(1) 75(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr ' a⃠ 😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 © -' -i=2, index=75, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=4, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' a⃠ ' -i=2, index=6, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '😊︎ ' -i=3, index=14, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '😊️' -i=4, index=21, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=5, index=22, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '🇩🇪' -i=6, index=30, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=7, index=31, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '✊' -i=8, index=34, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=9, index=35, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '✋🏾' -i=10, index=42, chars=5, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' 0 # ' -i=11, index=47, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '🏴' -i=12, index=71, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ©' -i=13, index=74, no run, line end -i=14, index=75, no run, line end diff --git a/tests/layouts/valid-19.layout b/tests/layouts/valid-19.layout index 32ad1283..c9e6d979 100644 --- a/tests/layouts/valid-19.layout +++ b/tests/layouts/valid-19.layout @@ -1,5 +1,617 @@ { - "text" : " a⃠ 😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 ©\n", - "attributes" : [], - "font" : "Cantarell 11" + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "text" : "😊︎ 😊️ 🇩🇪 ✊ ✋🏾 0 # 🏴 ©\n", + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 649216, + "height" : 150528, + "log-attrs" : [ + { + "char-break" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "sentence-start" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + }, + { }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { }, + { }, + { }, + { }, + { }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 68, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 8, + "text" : "😊︎ ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 5867, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 3, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 7 + } + ] + }, + { + "offset" : 8, + "length" : 7, + "text" : "😊️", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 5867, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + }, + { + "offset" : 15, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 16, + "length" : 8, + "text" : "🇩🇪", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Noto Color Emoji 11", + "checksum" : "cc2ce7351378d5dfa4fce6fd8619e5dcf73693d0089e9223c54e3926cdb8a531", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 20, + "width" : 139264, + "is-cluster-start" : true, + "is-color" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 24, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 25, + "length" : 3, + "text" : "✊", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Noto Color Emoji 11", + "checksum" : "cc2ce7351378d5dfa4fce6fd8619e5dcf73693d0089e9223c54e3926cdb8a531", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 5, + "width" : 139264, + "is-cluster-start" : true, + "is-color" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 28, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 29, + "length" : 7, + "text" : "✋🏾", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Noto Color Emoji 11", + "checksum" : "cc2ce7351378d5dfa4fce6fd8619e5dcf73693d0089e9223c54e3926cdb8a531", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 19, + "width" : 139264, + "is-cluster-start" : true, + "is-color" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 36, + "length" : 5, + "text" : " 0 # ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 964, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1070, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + }, + { + "offset" : 41, + "length" : 24, + "text" : "🏴", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Noto Color Emoji 11", + "checksum" : "cc2ce7351378d5dfa4fce6fd8619e5dcf73693d0089e9223c54e3926cdb8a531", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 22, + "width" : 139264, + "is-cluster-start" : true, + "is-color" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 65, + "length" : 3, + "text" : " ©", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1182, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 1 + } + ] + } + ] + }, + { + "start-index" : 69, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-2.expected b/tests/layouts/valid-2.expected deleted file mode 100644 index 76c4f453..00000000 --- a/tests/layouts/valid-2.expected +++ /dev/null @@ -1,42 +0,0 @@ -test the blue drink after dinner - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 9 -range 9 13 -9 13 style italic -range 13 20 -range 20 25 -20 25 underline single -range 25 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 31(1) 33(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'test the blue drink after dinner -' -i=2, index=33, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=9, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'test the ' -i=2, index=9, chars=4, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'blue' -i=3, index=13, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' drink ' -i=4, index=20, chars=5, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'after' -20 25 underline single -i=5, index=25, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' dinner' -i=6, index=32, no run, line end -i=7, index=33, no run, line end diff --git a/tests/layouts/valid-2.layout b/tests/layouts/valid-2.layout index 303b2b67..7e8fb961 100644 --- a/tests/layouts/valid-2.layout +++ b/tests/layouts/valid-2.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "test the blue drink after dinner\n", "attributes" : [ { @@ -14,5 +30,588 @@ "value" : "single" } ], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 200704, + "height" : 37888, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 32, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 9, + "text" : "test the ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + } + ] + }, + { + "offset" : 9, + "length" : 4, + "text" : "blue", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + } + ] + }, + { + "offset" : 13, + "length" : 7, + "text" : " drink ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 6 + } + ] + }, + { + "offset" : 20, + "length" : 5, + "text" : "after", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 20, + "end" : 25, + "type" : "underline", + "value" : "single" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + }, + { + "offset" : 25, + "length" : 7, + "text" : " dinner", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 6 + } + ] + } + ] + }, + { + "start-index" : 33, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-20.expected b/tests/layouts/valid-20.expected deleted file mode 100644 index e3a68815..00000000 --- a/tests/layouts/valid-20.expected +++ /dev/null @@ -1,40 +0,0 @@ -abcdef - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 3 -0 3 gravity east -0 3 gravity-hint strong -range 3 6 -3 6 gravity south -range 6 2147483647 - ---- directions - -0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 5(1) 7(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'abcdef -' -i=2, index=7, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=3, level=0, gravity=east, flags=0, font=OMITTED, script=latin, language=en-us, 'abc' -0 3 gravity east -0 3 gravity-hint strong -i=2, index=3, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'def' -3 6 gravity south -i=3, index=6, no run, line end -i=4, index=7, no run, line end diff --git a/tests/layouts/valid-20.layout b/tests/layouts/valid-20.layout index bde84b6f..1be94175 100644 --- a/tests/layouts/valid-20.layout +++ b/tests/layouts/valid-20.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "abcdef\n", "attributes" : [ { @@ -18,5 +34,205 @@ "value" : "south" } ], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 76800, + "height" : 44032, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 6, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 3, + "text" : "abc", + "bidi-level" : 0, + "gravity" : "east", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell Rotated-Left 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 3, + "type" : "gravity", + "value" : "east" + }, + { + "end" : 3, + "type" : "gravity-hint", + "value" : "strong" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 18432, + "x-offset" : 33196, + "y-offset" : 3844, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 272, + "width" : 18432, + "x-offset" : 33196, + "y-offset" : 4280, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 273, + "width" : 18432, + "x-offset" : 33196, + "y-offset" : 3506, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + }, + { + "offset" : 3, + "length" : 3, + "text" : "def", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 3, + "end" : 6, + "type" : "gravity", + "value" : "south" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + } + ] + }, + { + "start-index" : 7, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-22.expected b/tests/layouts/valid-22.expected deleted file mode 100644 index 8bbd3620..00000000 --- a/tests/layouts/valid-22.expected +++ /dev/null @@ -1,111 +0,0 @@ -e0 = ooo... - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 1 -range 1 2 -1 2 font-desc "Italic" -1 2 font-scale subscript -1 2 baseline-shift subscript -range 2 6 -range 6 7 -6 11 font-scale superscript -6 11 baseline-shift superscript -range 7 8 -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -range 8 9 -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -range 9 10 -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -9 11 font-scale superscript -9 11 baseline-shift superscript -range 10 11 -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -9 11 font-scale superscript -9 11 baseline-shift superscript -10 11 font-scale superscript -10 11 baseline-shift superscript -range 11 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(1) 12(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'e0 = ooo... -' -i=2, index=12, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'e' -i=2, index=1, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '0' -1 2 font-scale subscript -1 2 baseline-shift subscript -i=3, index=2, chars=4, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' = o' -i=4, index=6, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'o' -6 11 font-scale superscript -6 11 baseline-shift superscript -i=5, index=7, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'o' -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -i=6, index=8, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '.' -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -i=7, index=9, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '.' -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -9 11 font-scale superscript -9 11 baseline-shift superscript -i=8, index=10, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '.' -6 11 font-scale superscript -6 11 baseline-shift superscript -7 11 font-scale superscript -7 11 baseline-shift superscript -8 11 font-scale superscript -8 11 baseline-shift superscript -9 11 font-scale superscript -9 11 baseline-shift superscript -10 11 font-scale superscript -10 11 baseline-shift superscript -i=9, index=11, no run, line end -i=10, index=12, no run, line end diff --git a/tests/layouts/valid-22.layout b/tests/layouts/valid-22.layout index be57d26a..615200cb 100644 --- a/tests/layouts/valid-22.layout +++ b/tests/layouts/valid-22.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "e0 = ooo...\n", "attributes" : [ { @@ -80,5 +96,626 @@ "value" : "superscript" } ], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 49152, + "height" : 41090, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 11, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 1, + "text" : "e", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 1, + "length" : 1, + "text" : "0", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 7.1484375", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 1, + "end" : 2, + "type" : "font-scale", + "value" : "subscript" + }, + { + "start" : 1, + "end" : 2, + "type" : "baseline-shift", + "value" : "subscript" + } + ], + "y-offset" : -3274, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 964, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 2, + "length" : 4, + "text" : " = o", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1147, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + } + ] + }, + { + "offset" : 6, + "length" : 1, + "text" : "o", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 7.1484375", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "y-offset" : 5542, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 370, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 7, + "length" : 1, + "text" : "o", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 4.646484375", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "y-offset" : 9144, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 370, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 8, + "length" : 1, + "text" : ".", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 3.0205078125", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "y-offset" : 11485, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1058, + "width" : 1024, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 9, + "length" : 1, + "text" : ".", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 1.962890625", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "y-offset" : 13007, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1058, + "width" : 1024, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 10, + "length" : 1, + "text" : ".", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 1.2763671875", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 6, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 6, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 7, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 8, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 9, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + }, + { + "start" : 10, + "end" : 11, + "type" : "font-scale", + "value" : "superscript" + }, + { + "start" : 10, + "end" : 11, + "type" : "baseline-shift", + "value" : "superscript" + } + ], + "y-offset" : 13996, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1058, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 12, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-3.expected b/tests/layouts/valid-3.expected deleted file mode 100644 index d090bac0..00000000 --- a/tests/layouts/valid-3.expected +++ /dev/null @@ -1,33 +0,0 @@ -ABC😀️D - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 10(0) 10(1) 12(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'ABC😀️D -' -i=2, index=12, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ABC' -i=2, index=3, chars=2, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '😀️' -i=3, index=10, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'D' -i=4, index=11, no run, line end -i=5, index=12, no run, line end diff --git a/tests/layouts/valid-3.layout b/tests/layouts/valid-3.layout index ef1b1917..c11c2b35 100644 --- a/tests/layouts/valid-3.layout +++ b/tests/layouts/valid-3.layout @@ -1,5 +1,221 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "ABC😀️D\n", - "attributes" : [], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 54272, + "height" : 38912, + "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, + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 11, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 3, + "text" : "ABC", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 29, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 30, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + }, + { + "offset" : 3, + "length" : 7, + "text" : "😀️", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 5857, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + }, + { + "offset" : 10, + "length" : 1, + "text" : "D", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 37, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 12, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-4.expected b/tests/layouts/valid-4.expected deleted file mode 100644 index 4e69d61d..00000000 --- a/tests/layouts/valid-4.expected +++ /dev/null @@ -1,44 +0,0 @@ -This paragraph should actually have multiple lines, unlike all the other wannabe äöü paragraph tests in this ugh test-case. Grow some lines! - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 6 -width: 198656 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 27(0) 28(0) 29(0) 30(0) 30(1) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 51(0) 52(0) 53(0) 54(0) 55(0) 56(0) 57(0) 58(0) 59(0) 60(0) 61(0) 62(0) 62(1) 64(0) 65(0) 66(0) 67(0) 68(0) 69(0) 70(0) 71(0) 72(0) 73(0) 74(0) 75(0) 76(0) 77(0) 78(0) 79(0) 80(0) 81(0) 82(0) 83(0) 84(0) 85(0) 87(0) 89(0) 91(0) 92(0) 93(0) 94(0) 94(1) 97(0) 98(0) 101(0) 102(0) 103(0) 104(0) 105(0) 106(0) 107(0) 108(0) 109(0) 110(0) 111(0) 112(0) 113(0) 114(0) 115(0) 116(0) 117(0) 118(0) 119(0) 120(0) 121(0) 122(0) 123(0) 124(0) 125(0) 126(0) 127(0) 128(0) 128(1) 130(0) 131(0) 132(0) 133(0) 134(0) 135(0) 136(0) 137(0) 138(0) 139(0) 140(0) 141(0) 142(0) 143(0) 144(0) 145(0) 146(0) 147(0) 148(0) 149(0) 150(0) 150(1) 152(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'This paragraph should actual' -i=2, index=32, paragraph-start=0, dir=ltr 'ly have multiple lines, unlike ' -i=3, index=63, paragraph-start=0, dir=ltr 'all the other wannabe äöü pa' -i=4, index=96, paragraph-start=0, dir=ltr 'ragraph tests in this ugh test-' -i=5, index=129, paragraph-start=0, dir=ltr 'case. Grow some lines! -' -i=6, index=152, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=30, level=0, gravity=south, flags=4, font=OMITTED, script=latin, language=en-us, 'This paragraph should actual' -i=2, index=32, no run, line end -i=3, index=32, chars=31, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ly have multiple lines, unlike ' -i=4, index=63, no run, line end -i=5, index=63, chars=29, level=0, gravity=south, flags=4, font=OMITTED, script=latin, language=en-us, 'all the other wannabe äöü pa' -i=6, index=96, no run, line end -i=7, index=96, chars=32, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ragraph tests in this ugh test-' -i=8, index=129, no run, line end -i=9, index=129, chars=22, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'case. Grow some lines!' -i=10, index=151, no run, line end -i=11, index=152, no run, line end diff --git a/tests/layouts/valid-4.layout b/tests/layouts/valid-4.layout index 5504107d..e4358637 100644 --- a/tests/layouts/valid-4.layout +++ b/tests/layouts/valid-4.layout @@ -1,6 +1,1960 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "This paragraph should actually have multiple lines, unlike all the other wannabe äöü paragraph tests in this ugh test-case. Grow some lines!\n", - "attributes" : [], "font" : "Cantarell 11", - "width" : 198656 + "width" : 198656, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 197632, + "height" : 111616, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : 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, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : 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, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "sentence-boundary" : true, + "sentence-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 32, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 32, + "text" : "This paragraph should actual", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 187, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 26 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 27 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 29 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 30 + }, + { + "glyph" : 1081, + "width" : 6144, + "log-cluster" : 30 + } + ] + } + ] + }, + { + "start-index" : 32, + "length" : 31, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 32, + "length" : 31, + "text" : "ly have multiple lines, unlike ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 473, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 466, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 1059, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 25 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 26 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 27 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 29 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 30 + } + ] + } + ] + }, + { + "start-index" : 63, + "length" : 33, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 63, + "length" : 33, + "text" : "all the other wannabe äöü pa", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 4, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 260, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 381, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 444, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 26 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 29 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 30 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 31 + }, + { + "glyph" : 1081, + "width" : 6144, + "log-cluster" : 31 + } + ] + } + ] + }, + { + "start-index" : 96, + "length" : 33, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 96, + "length" : 33, + "text" : "ragraph tests in this ugh test-", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 25 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 26 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 27 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 29 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 30 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 31 + }, + { + "glyph" : 1081, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 32 + } + ] + } + ] + }, + { + "start-index" : 129, + "length" : 22, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 129, + "length" : 22, + "text" : "case. Grow some lines!", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1058, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 69, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1063, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 21 + } + ] + } + ] + }, + { + "start-index" : 152, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-5.expected b/tests/layouts/valid-5.expected deleted file mode 100644 index 20627955..00000000 --- a/tests/layouts/valid-5.expected +++ /dev/null @@ -1,56 +0,0 @@ -A test with multiple paragraphs and with no-break attributes, which might trigger a crash. -If it doesn't the fix has worked. - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 7 -width: 194560 - ---- attributes - -range 0 21 -range 21 31 -21 31 font-features "tnum=1" -range 31 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 20(1) 22(0) 23(0) 24(0) 25(0) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 43(1) 45(0) 46(0) 47(0) 48(0) 49(0) 50(0) 51(0) 52(0) 53(0) 54(0) 55(0) 56(0) 57(0) 58(0) 59(0) 60(0) 61(0) 62(0) 63(0) 64(0) 65(0) 66(0) 67(0) 68(0) 69(0) 70(0) 71(0) 72(0) 73(0) 73(1) 75(0) 76(0) 77(0) 78(0) 79(0) 80(0) 81(0) 82(0) 83(0) 84(0) 85(0) 86(0) 87(0) 88(0) 89(0) 89(1) 91(0) 92(0) 93(0) 94(0) 95(0) 96(0) 97(0) 98(0) 99(0) 100(0) 101(0) 102(0) 103(0) 104(0) 105(0) 106(0) 107(0) 108(0) 109(0) 110(0) 111(0) 112(0) 113(0) 114(0) 115(0) 116(0) 116(1) 118(0) 119(0) 120(0) 121(0) 122(0) 123(0) 123(1) 125(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'A test with multiple ' -i=2, index=21, paragraph-start=0, dir=ltr 'paragraphs and with no-' -i=3, index=44, paragraph-start=0, dir=ltr 'break attributes, which might ' -i=4, index=74, paragraph-start=0, dir=ltr 'trigger a crash. -' -i=5, index=91, paragraph-start=1, dir=ltr 'If it doesn't the fix has ' -i=6, index=117, paragraph-start=0, dir=ltr 'worked. -' -i=7, index=125, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=21, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'A test with multiple ' -21 31 font-features "tnum=1" -i=2, index=21, no run, line end -i=3, index=21, chars=23, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'paragraphs and with no-' -21 31 font-features "tnum=1" -i=4, index=44, no run, line end -i=5, index=44, chars=30, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'break attributes, which might ' -21 31 font-features "tnum=1" -i=6, index=74, no run, line end -i=7, index=74, chars=16, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'trigger a crash.' -21 31 font-features "tnum=1" -i=8, index=90, no run, line end -i=9, index=91, chars=26, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'If it doesn't the fix has ' -i=10, index=117, no run, line end -i=11, index=117, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'worked.' -i=12, index=124, no run, line end -i=13, index=125, no run, line end diff --git a/tests/layouts/valid-5.layout b/tests/layouts/valid-5.layout index e5e96b9a..a861ab30 100644 --- a/tests/layouts/valid-5.layout +++ b/tests/layouts/valid-5.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "A test with multiple paragraphs and with no-break attributes, which might trigger a crash.\nIf it doesn't the fix has worked.\n", "attributes" : [ { @@ -9,5 +25,1764 @@ } ], "font" : "Cantarell 11", - "width" : 194560 + "width" : 194560, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 194560, + "height" : 130048, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "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, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-start" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 21, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 21, + "text" : "A test with multiple ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 21, + "end" : 31, + "type" : "font-features", + "value" : "tnum=1" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 20 + } + ] + } + ] + }, + { + "start-index" : 21, + "length" : 23, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 21, + "length" : 23, + "text" : "paragraphs and with no-", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 21, + "end" : 31, + "type" : "font-features", + "value" : "tnum=1" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 1081, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 22 + } + ] + } + ] + }, + { + "start-index" : 44, + "length" : 30, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 44, + "length" : 30, + "text" : "break attributes, which might ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 21, + "end" : 31, + "type" : "font-features", + "value" : "tnum=1" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 438, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 1059, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 19 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 358, + "width" : 13312, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 25 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 26 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 27 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 28 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 29 + } + ] + } + ] + }, + { + "start-index" : 74, + "length" : 16, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 74, + "length" : 16, + "text" : "trigger a crash.", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 21, + "end" : 31, + "type" : "font-features", + "value" : "tnum=1" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 1058, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 15 + } + ] + } + ] + }, + { + "start-index" : 91, + "length" : 26, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 91, + "length" : 26, + "text" : "If it doesn't the fix has ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 81, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 311, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 1099, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 17 + }, + { + "glyph" : 489, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 18 + }, + { + "glyph" : 472, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 20 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 21 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 22 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 23 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 24 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 25 + } + ] + } + ] + }, + { + "start-index" : 117, + "length" : 7, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 117, + "length" : 7, + "text" : "worked.", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 467, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 280, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1058, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 6 + } + ] + } + ] + }, + { + "start-index" : 125, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-6.expected b/tests/layouts/valid-6.expected deleted file mode 100644 index 040e0fa4..00000000 --- a/tests/layouts/valid-6.expected +++ /dev/null @@ -1,33 +0,0 @@ - 0️⃣ Keycap Digit Zero - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 25(1) 27(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr ' 0️⃣ Keycap Digit Zero -' -i=2, index=27, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' ' -i=2, index=1, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, '0️⃣' -i=3, index=8, chars=18, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' Keycap Digit Zero' -i=4, index=26, no run, line end -i=5, index=27, no run, line end diff --git a/tests/layouts/valid-6.layout b/tests/layouts/valid-6.layout index 4423d068..d74ff4eb 100644 --- a/tests/layouts/valid-6.layout +++ b/tests/layouts/valid-6.layout @@ -1,5 +1,409 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : " 0️⃣ Keycap Digit Zero\n", - "attributes" : [], - "font" : "Cantarell 11" + "font" : "Cantarell 11", + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 1, + "width" : 151552, + "height" : 38912, + "log-attrs" : [ + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "sentence-start" : true, + "word-boundary" : true + }, + { }, + { + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 26, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 1, + "length" : 7, + "text" : "0️⃣", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 19, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 268435455, + "width" : 0, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 268443875, + "width" : 17408, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + }, + { + "offset" : 8, + "length" : 18, + "text" : " Keycap Digit Zero", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 100, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 473, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 406, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 37, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 312, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 12 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 13 + }, + { + "glyph" : 239, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 14 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 15 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 16 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 17 + } + ] + } + ] + }, + { + "start-index" : 27, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-7.expected b/tests/layouts/valid-7.expected deleted file mode 100644 index 13595a75..00000000 --- a/tests/layouts/valid-7.expected +++ /dev/null @@ -1,43 +0,0 @@ -This is a test of the automatic emergency brake! - ---- parameters - -wrapped: 0 -ellipsized: 1 -lines: 2 -width: 204800 -indent: 51200 - ---- attributes - -range 0 22 -range 22 41 -22 41 foreground #00000000ffff -22 41 underline single -range 41 2147483647 - ---- directions - -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 7(0) 8(0) 9(0) 10(0) 11(0) 12(0) 13(0) 14(0) 15(0) 16(0) 17(0) 18(0) 19(0) 20(0) 21(0) 22(0) 23(0) 24(0) 25(0) 26(0) 27(0) 28(0) 29(0) 30(0) 31(0) 32(0) 33(0) 34(0) 35(0) 36(0) 37(0) 38(0) 39(0) 40(0) 41(0) 42(0) 43(0) 44(0) 45(0) 46(0) 47(0) 47(1) 49(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'This is a test of the automatic emergency brake! -' -i=2, index=49, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=12, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'This is a te' -i=2, index=12, chars=26, level=0, gravity=south, flags=2, font=OMITTED, script=common, language=en-us, 'st of the automatic emerge' -0 2147483647 fallback false -i=3, index=38, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'ncy' -22 41 foreground #00000000ffff -22 41 underline single -i=4, index=41, chars=7, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, ' brake!' -i=5, index=48, no run, line end -i=6, index=49, no run, line end diff --git a/tests/layouts/valid-7.layout b/tests/layouts/valid-7.layout index b49484c6..705713ec 100644 --- a/tests/layouts/valid-7.layout +++ b/tests/layouts/valid-7.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "This is a test of the automatic emergency brake!\n", "attributes" : [ { @@ -17,5 +33,612 @@ "font" : "Cantarell 11", "ellipsize" : "middle", "width" : 204800, - "indent" : 51200 + "indent" : 51200, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : true, + "unknown-glyphs" : 0, + "width" : 153600, + "height" : 37888, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "word-end" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 48, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 12, + "text" : "This is a te", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 187, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 319, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 417, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 7 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 430, + "width" : 5120, + "is-cluster-start" : true, + "log-cluster" : 10 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 11 + } + ] + }, + { + "offset" : 12, + "length" : 26, + "text" : "st of the automatic emerge", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "common", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 2, + "extra-attributes" : [ + { + "end" : 2147483647, + "type" : "fallback", + "value" : false + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1062, + "width" : 16384, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 38, + "length" : 3, + "text" : "ncy", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "start" : 22, + "end" : 41, + "type" : "foreground", + "value" : "#00000000ffff" + }, + { + "start" : 22, + "end" : 41, + "type" : "underline", + "value" : "single" + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 360, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 273, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 473, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 2 + } + ] + }, + { + "offset" : 41, + "length" : 7, + "text" : " brake!", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 272, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 409, + "width" : 6144, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 244, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 345, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 5 + }, + { + "glyph" : 1063, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 6 + } + ] + } + ] + }, + { + "start-index" : 49, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-8.expected b/tests/layouts/valid-8.expected deleted file mode 100644 index 185ba373..00000000 --- a/tests/layouts/valid-8.expected +++ /dev/null @@ -1,34 +0,0 @@ -Hello שלום Γειά σας - ---- parameters - -wrapped: 0 -ellipsized: 0 -lines: 2 - ---- attributes - -range 0 2147483647 - ---- directions - -0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 6(0) 12(0) 10(0) 8(0) 14(0) 15(0) 17(0) 19(0) 21(0) 23(0) 24(0) 26(0) 28(0) 28(1) 31(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'Hello שלום Γειά σας -' -i=2, index=31, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Hello ' -i=2, index=12, chars=4, level=1, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, 'שלום' -i=3, index=14, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, ' ' -i=4, index=15, chars=8, level=0, gravity=south, flags=0, font=OMITTED, script=greek, language=el, 'Γειά σας' -i=5, index=30, no run, line end -i=6, index=31, no run, line end diff --git a/tests/layouts/valid-8.layout b/tests/layouts/valid-8.layout index 063ec370..ef463535 100644 --- a/tests/layouts/valid-8.layout +++ b/tests/layouts/valid-8.layout @@ -1,8 +1,416 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "Hello שלום Γειά σας\n", - "attributes" : [], "font" : "Cantarell 11", "auto-dir" : false, "alignment" : "center", - "spacing" : 51200 + "spacing" : 51200, + "output" : { + "is-wrapped" : false, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 134144, + "height" : 90112, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 30, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "Hello ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 76, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 349, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 370, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 5 + } + ] + }, + { + "offset" : 6, + "length" : 8, + "text" : "שלום", + "bidi-level" : 1, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1332, + "width" : 10240, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1324, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1331, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1344, + "width" : 11264, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 14, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 15, + "length" : 15, + "text" : "Γειά σας", + "bidi-level" : 0, + "gravity" : "south", + "language" : "el", + "script" : "greek", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 677, + "width" : 8192, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 808, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 812, + "width" : 4096, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 837, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1109, + "width" : 3072, + "is-cluster-start" : true, + "log-cluster" : 8 + }, + { + "glyph" : 822, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 9 + }, + { + "glyph" : 804, + "width" : 9216, + "is-cluster-start" : true, + "log-cluster" : 11 + }, + { + "glyph" : 821, + "width" : 7168, + "is-cluster-start" : true, + "log-cluster" : 13 + } + ] + } + ] + }, + { + "start-index" : 31, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/layouts/valid-9.expected b/tests/layouts/valid-9.expected deleted file mode 100644 index 5cbbf8fc..00000000 --- a/tests/layouts/valid-9.expected +++ /dev/null @@ -1,49 +0,0 @@ -Hello שלום Γειά σας - ---- parameters - -wrapped: 1 -ellipsized: 0 -lines: 5 -width: 102400 - ---- attributes - -range 0 30 -0 30 letter-spacing 8888 -range 30 2147483647 - ---- directions - -0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 - ---- cursor positions - -0(0) 1(0) 2(0) 3(0) 4(0) 5(0) 5(1) 12(0) 10(0) 8(0) 14(0) 14(1) 17(0) 19(0) 21(0) 23(0) 23(1) 26(0) 28(0) 28(1) 31(0) - ---- lines - -i=1, index=0, paragraph-start=1, dir=ltr 'Hello שלו' -i=2, index=12, paragraph-start=0, dir=ltr 'ם ' -i=3, index=15, paragraph-start=0, dir=ltr 'Γειά ' -i=4, index=24, paragraph-start=0, dir=ltr 'σας -' -i=5, index=31, paragraph-start=1, dir=ltr '' - ---- runs - -i=1, index=0, chars=6, level=0, gravity=south, flags=0, font=OMITTED, script=latin, language=en-us, 'Hello ' -0 30 letter-spacing 8888 -i=2, index=6, no run, line end -i=3, index=12, chars=4, level=1, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, 'שלום' -0 30 letter-spacing 8888 -i=4, index=14, chars=1, level=0, gravity=south, flags=0, font=OMITTED, script=hebrew, language=he, ' ' -0 30 letter-spacing 8888 -i=5, index=15, no run, line end -i=6, index=15, chars=5, level=0, gravity=south, flags=0, font=OMITTED, script=greek, language=el, 'Γειά ' -0 30 letter-spacing 8888 -i=7, index=24, no run, line end -i=8, index=24, chars=3, level=0, gravity=south, flags=0, font=OMITTED, script=greek, language=el, 'σας' -0 30 letter-spacing 8888 -i=9, index=30, no run, line end -i=10, index=31, no run, line end diff --git a/tests/layouts/valid-9.layout b/tests/layouts/valid-9.layout index e3dfa57b..20cf4e84 100644 --- a/tests/layouts/valid-9.layout +++ b/tests/layouts/valid-9.layout @@ -1,4 +1,20 @@ { + "context" : { + "font" : "serif 12", + "language" : "en-us", + "base-gravity" : "south", + "gravity-hint" : "natural", + "base-dir" : "weak-ltr", + "round-glyph-positions" : true, + "transform" : [ + 1.0, + 0.0, + 0.0, + 1.0, + 0.0, + 0.0 + ] + }, "text" : "Hello שלום Γειά σας\n", "attributes" : [ { @@ -8,5 +24,502 @@ } ], "font" : "Cantarell 11", - "width" : 102400 + "width" : 102400, + "output" : { + "is-wrapped" : true, + "is-ellipsized" : false, + "unknown-glyphs" : 0, + "width" : 71392, + "height" : 94208, + "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 + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "backspace-deletes-character" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "backspace-deletes-character" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "expandable-space" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "char-break" : true, + "cursor-position" : true, + "word-start" : true, + "word-boundary" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "cursor-position" : true, + "break-inserts-hyphen" : true + }, + { + "char-break" : true, + "white" : true, + "cursor-position" : true, + "word-end" : true, + "sentence-end" : true, + "word-boundary" : true + }, + { + "line-break" : true, + "mandatory-break" : true, + "char-break" : true, + "white" : true, + "cursor-position" : true, + "sentence-boundary" : true, + "backspace-deletes-character" : true, + "word-boundary" : true + } + ], + "lines" : [ + { + "start-index" : 0, + "length" : 6, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [ + { + "offset" : 0, + "length" : 6, + "text" : "Hello ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "en-us", + "script" : "latin", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 76, + "width" : 15708, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 287, + "width" : 17080, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 1 + }, + { + "glyph" : 349, + "width" : 12984, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 349, + "width" : 12984, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 3 + }, + { + "glyph" : 370, + "width" : 12636, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 268435455, + "width" : 0, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 5 + } + ] + } + ] + }, + { + "start-index" : 6, + "length" : 9, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 6, + "length" : 8, + "text" : "שלום", + "bidi-level" : 1, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "DejaVu Sans 11", + "checksum" : "69ccd07023a72ceb27a5e5c22f728627353b60a198170f5e58dd7014221abf01", + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 1332, + "width" : 14684, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 1324, + "width" : 12984, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 1331, + "width" : 18104, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 1344, + "width" : 20152, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + }, + { + "offset" : 14, + "length" : 1, + "text" : " ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "he", + "script" : "hebrew", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 268435455, + "width" : 0, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 0 + } + ] + } + ] + }, + { + "start-index" : 15, + "length" : 9, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 15, + "length" : 9, + "text" : "Γειά ", + "bidi-level" : 0, + "gravity" : "south", + "language" : "el", + "script" : "greek", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 677, + "width" : 12636, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 808, + "width" : 16056, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 812, + "width" : 12984, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 4 + }, + { + "glyph" : 837, + "width" : 13660, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 6 + }, + { + "glyph" : 268435455, + "width" : 0, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 8 + } + ] + } + ] + }, + { + "start-index" : 24, + "length" : 6, + "paragraph-start" : false, + "direction" : "ltr", + "runs" : [ + { + "offset" : 24, + "length" : 6, + "text" : "σας", + "bidi-level" : 0, + "gravity" : "south", + "language" : "el", + "script" : "greek", + "font" : { + "description" : "Cantarell 11", + "checksum" : "5bcb6ee14ee9d210b2e91d643de1fe456e9d1aea770983fdb05951545efebbe2", + "variations" : { + "wght" : 0 + }, + "matrix" : [ + 1.0, + -0.0, + -0.0, + 1.0, + 0.0, + 0.0 + ] + }, + "flags" : 0, + "extra-attributes" : [ + { + "end" : 30, + "type" : "letter-spacing", + "value" : 8888 + } + ], + "y-offset" : 0, + "start-x-offset" : 0, + "end-x-offset" : 0, + "glyphs" : [ + { + "glyph" : 822, + "width" : 13660, + "is-cluster-start" : true, + "log-cluster" : 0 + }, + { + "glyph" : 804, + "width" : 18104, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 2 + }, + { + "glyph" : 821, + "width" : 11612, + "x-offset" : 4444, + "is-cluster-start" : true, + "log-cluster" : 4 + } + ] + } + ] + }, + { + "start-index" : 31, + "length" : 0, + "paragraph-start" : true, + "direction" : "ltr", + "runs" : [] + } + ] + } } diff --git a/tests/meson.build b/tests/meson.build index 00741a14..1984ed03 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -44,18 +44,28 @@ if cairo_dep.found() [ 'testiter', [ 'testiter.c' ], [ libpangocairo_dep ] ], [ 'test-ellipsize', [ 'test-ellipsize.c' ], [ libpangocairo_dep ] ], [ 'markup-parse', [ 'markup-parse.c' , 'test-common.c' ], [ libpangocairo_dep ] ], - [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep ] ], [ 'test-itemize', [ 'test-itemize.c', 'test-common.c' ], [ libpangocairo_dep ] ], [ 'test-shape', [ 'test-shape.c', 'test-common.c' ], [ libpangocairo_dep ] ], [ 'test-font', [ 'test-font.c' ], [ libpangocairo_dep ] ], [ 'testattributes', [ 'testattributes.c', 'test-common.c' ], [ libpangocairo_dep ] ], - [ 'testmisc', [ 'testmisc.c' ], [ libpangocairo_dep, libpangoft2_dep, glib_dep, harfbuzz_dep ] ], [ 'cxx-test', [ 'cxx-test.cpp' ], [ libpangocairo_dep, gobject_dep, harfbuzz_dep ] ], [ 'test-harfbuzz', [ 'test-harfbuzz.c' ], [ libpangocairo_dep, gobject_dep, harfbuzz_dep ] ], [ 'test-break', [ 'test-break.c', 'test-common.c', 'validate-log-attrs.c' ], [libpangocairo_dep, glib_dep, harfbuzz_dep ] ], [ 'testserialize', [ 'testserialize.c' ], [ libpangocairo_dep ] ], ] + if build_pangoft2 + tests += [ + [ 'testmisc', [ 'testmisc.c' ], [ libpangocairo_dep, libpangoft2_dep, glib_dep, harfbuzz_dep ] ], + ] + + if host_system != 'darwin' + tests += [ + [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep, libpangoft2_dep ] ], + ] + endif + endif + if host_system != 'darwin' tests += [ [ 'testrandom', [ 'testrandom.c' ], [ libpangocairo_dep, gio_dep ] ], diff --git a/tests/test-common.c b/tests/test-common.c index 3821a450..12b22cb4 100644 --- a/tests/test-common.c +++ b/tests/test-common.c @@ -82,6 +82,70 @@ done: return diff; } +char * +diff_bytes (GBytes *b1, + GBytes *b2, + GError **error) +{ + const char *command[] = { "diff", "-u", "-i", NULL, NULL, NULL }; + char *diff, *tmpfile, *tmpfile2; + int fd; + const char *text; + gsize len; + + /* write the text buffer to a temporary file */ + fd = g_file_open_tmp (NULL, &tmpfile, error); + if (fd < 0) + return NULL; + + text = (const char *) g_bytes_get_data (b1, &len); + if (write (fd, text, len) != (int) len) + { + close (fd); + g_set_error (error, + G_FILE_ERROR, G_FILE_ERROR_FAILED, + "Could not write data to temporary file '%s'", tmpfile); + goto done; + } + close (fd); + + fd = g_file_open_tmp (NULL, &tmpfile2, error); + if (fd < 0) + return NULL; + + text = (const char *) g_bytes_get_data (b2, &len); + if (write (fd, text, len) != (int) len) + { + close (fd); + g_set_error (error, + G_FILE_ERROR, G_FILE_ERROR_FAILED, + "Could not write data to temporary file '%s'", tmpfile2); + goto done; + } + close (fd); + + command[3] = tmpfile; + command[4] = tmpfile2; + + /* run diff command */ + g_spawn_sync (NULL, + (char **) command, + NULL, + G_SPAWN_SEARCH_PATH, + NULL, NULL, + &diff, + NULL, NULL, + error); + +done: + unlink (tmpfile); + g_free (tmpfile); + unlink (tmpfile2); + g_free (tmpfile2); + + return diff; +} + gboolean file_has_prefix (const char *filename, const char *str, diff --git a/tests/test-common.h b/tests/test-common.h index 86320236..6fe96133 100644 --- a/tests/test-common.h +++ b/tests/test-common.h @@ -6,6 +6,10 @@ char * diff_with_file (const char *file, gssize len, GError **error); +char * diff_bytes (GBytes *b1, + GBytes *b2, + GError **error); + gboolean file_has_prefix (const char *file, const char *str, GError **error); diff --git a/tests/test-layout.c b/tests/test-layout.c index 7415efe7..62aba460 100644 --- a/tests/test-layout.c +++ b/tests/test-layout.c @@ -29,278 +29,29 @@ #include "config.h" #include <pango/pangocairo.h> +#include <pango/pangocairo-fc.h> +#include <pango/pangofc-fontmap.h> #include "test-common.h" -static PangoContext *context; - -static gboolean opt_show_font; - -static const gchar * -enum_value_nick (GType type, gint value) -{ - GEnumClass *eclass; - GEnumValue *ev; - - eclass = g_type_class_ref (type); - ev = g_enum_get_value (eclass, value); - g_type_class_unref (eclass); - - if (ev) - return ev->value_nick; - else - return "?"; -} - -static const gchar * -direction_name (PangoDirection dir) -{ - return enum_value_nick (PANGO_TYPE_DIRECTION, dir); -} - -static const gchar * -gravity_name (PangoGravity gravity) -{ - return enum_value_nick (PANGO_TYPE_GRAVITY, gravity); -} - -static const gchar * -script_name (PangoScript script) -{ - return enum_value_nick (PANGO_TYPE_SCRIPT, script); -} - -static gchar * -font_name (PangoFont *font) -{ - PangoFontDescription *desc; - gchar *name; - - desc = pango_font_describe (font); - name = pango_font_description_to_string (desc); - pango_font_description_free (desc); - - return name; -} - -static void -dump_lines (PangoLayout *layout, GString *string) -{ - PangoLayoutIter *iter; - const gchar *text; - gint index, index2; - gboolean has_more; - gchar *char_str; - gint i; - PangoLayoutLine *line; - - text = pango_layout_get_text (layout); - iter = pango_layout_get_iter (layout); - - has_more = TRUE; - index = pango_layout_iter_get_index (iter); - index2 = 0; - i = 0; - while (has_more) - { - line = pango_layout_iter_get_line (iter); - has_more = pango_layout_iter_next_line (iter); - i++; - - if (has_more) - { - index2 = pango_layout_iter_get_index (iter); - char_str = g_strndup (text + index, index2 - index); - } - else - { - char_str = g_strdup (text + index); - } - - g_string_append_printf (string, "i=%d, index=%d, paragraph-start=%d, dir=%s '%s'\n", - i, index, line->is_paragraph_start, direction_name (line->resolved_dir), - char_str); - g_free (char_str); - - index = index2; - } - pango_layout_iter_free (iter); -} - -#define ANALYSIS_FLAGS (PANGO_ANALYSIS_FLAG_CENTERED_BASELINE | \ - PANGO_ANALYSIS_FLAG_IS_ELLIPSIS | \ - PANGO_ANALYSIS_FLAG_NEED_HYPHEN) - -static void -dump_runs (PangoLayout *layout, GString *string) -{ - PangoLayoutIter *iter; - PangoLayoutRun *run; - PangoItem *item; - const gchar *text; - gint index; - gboolean has_more; - gchar *char_str; - gint i; - gchar *font = 0; - - text = pango_layout_get_text (layout); - iter = pango_layout_get_iter (layout); - - has_more = TRUE; - i = 0; - while (has_more) - { - run = pango_layout_iter_get_run (iter); - index = pango_layout_iter_get_index (iter); - has_more = pango_layout_iter_next_run (iter); - i++; - - if (run) - { - item = ((PangoGlyphItem*)run)->item; - char_str = g_strndup (text + item->offset, item->length); - font = font_name (item->analysis.font); - g_string_append_printf (string, "i=%d, index=%d, chars=%d, level=%d, gravity=%s, flags=%d, font=%s, script=%s, language=%s, '%s'\n", - i, index, item->num_chars, item->analysis.level, - gravity_name (item->analysis.gravity), - item->analysis.flags & ANALYSIS_FLAGS, - opt_show_font ? font : "OMITTED", /* for some reason, this fails on build.gnome.org, so leave it out */ - script_name (item->analysis.script), - pango_language_to_string (item->analysis.language), - char_str); - print_attributes (item->analysis.extra_attrs, string); - g_free (font); - g_free (char_str); - } - else - { - g_string_append_printf (string, "i=%d, index=%d, no run, line end\n", - i, index); - } - } - pango_layout_iter_free (iter); -} - -static void -dump_directions (PangoLayout *layout, GString *string) -{ - const char *text, *p; - - text = pango_layout_get_text (layout); - for (p = text; *p; p = g_utf8_next_char (p)) - { - g_string_append_printf (string, "%d ", pango_layout_get_direction (layout, p - text)); - } - g_string_append (string, "\n"); -} - -static void -dump_cursor_positions (PangoLayout *layout, GString *string) -{ - const char *text; - int index, trailing; - - text = pango_layout_get_text (layout); - - index = 0; - trailing = 0; - - while (index < G_MAXINT) - { - g_string_append_printf (string, "%d(%d) ", index, trailing); - - while (trailing--) - index = g_utf8_next_char (text + index) - text; - - pango_layout_move_cursor_visually (layout, TRUE, index, 0, 1, &index, &trailing); - } - - g_string_append (string, "\n"); -} - -static void -test_file (const char *filename, GString *string) -{ - char *contents; - gsize length; - GBytes *bytes; - GError *error = NULL; - PangoLayout *layout; - - if (context == NULL) - context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - - g_file_get_contents (filename, &contents, &length, &error); - g_assert_no_error (error); - - bytes = g_bytes_new_take (contents, length); - - layout = pango_layout_deserialize (context, bytes, &error); - g_assert_no_error (error); - - g_bytes_unref (bytes); - - /* generate the dumps */ - g_string_append (string, pango_layout_get_text (layout)); - - g_string_append (string, "\n--- parameters\n\n"); - - g_string_append_printf (string, "wrapped: %d\n", pango_layout_is_wrapped (layout)); - g_string_append_printf (string, "ellipsized: %d\n", pango_layout_is_ellipsized (layout)); - g_string_append_printf (string, "lines: %d\n", pango_layout_get_line_count (layout)); - if (pango_layout_get_width (layout) > 0) - g_string_append_printf (string, "width: %d\n", pango_layout_get_width (layout)); - if (pango_layout_get_height (layout) > 0) - g_string_append_printf (string, "height: %d\n", pango_layout_get_height (layout)); - if (pango_layout_get_indent (layout) != 0) - g_string_append_printf (string, "indent: %d\n", pango_layout_get_indent (layout)); - - g_string_append (string, "\n--- attributes\n\n"); - print_attr_list (pango_layout_get_attributes (layout), string); - - g_string_append (string, "\n--- directions\n\n"); - dump_directions (layout, string); - - g_string_append (string, "\n--- cursor positions\n\n"); - dump_cursor_positions (layout, string); - - g_string_append (string, "\n--- lines\n\n"); - dump_lines (layout, string); - - g_string_append (string, "\n--- runs\n\n"); - dump_runs (layout, string); - - g_object_unref (layout); -} - -static gchar * -get_expected_filename (const char *filename) -{ - char *f, *p, *expected; - - f = g_strdup (filename); - p = strstr (f, ".layout"); - if (p) - *p = 0; - expected = g_strconcat (f, ".expected", NULL); - - g_free (f); - - return expected; -} - static void test_layout (gconstpointer d) { const char *filename = d; - char *expected_file; GError *error = NULL; - GString *dump; char *diff; - PangoFontFamily **families; - int n_families; - gboolean found_cantarell; + GBytes *bytes; + char *contents; + gsize length; + GBytes *orig; + PangoContext *context; + PangoLayout *layout; + + if (!PANGO_IS_FC_FONT_MAP (pango_cairo_font_map_get_default ())) + { + g_test_skip ("Not an fc fontmap. Skipping..."); + return; + } char *old_locale = g_strdup (setlocale (LC_ALL, NULL)); setlocale (LC_ALL, "en_US.UTF-8"); @@ -313,39 +64,25 @@ test_layout (gconstpointer d) return; } - if (context == NULL) - context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); - - found_cantarell = FALSE; - pango_context_list_families (context, &families, &n_families); - for (int i = 0; i < n_families; i++) - { - if (strcmp (pango_font_family_get_name (families[i]), "Cantarell") == 0) - { - found_cantarell = TRUE; - break; - } - } - g_free (families); - - if (!found_cantarell) - { - char *msg = g_strdup_printf ("Cantarell font not available, skipping itemization %s", filename); - g_test_skip (msg); - g_free (msg); - g_free (old_locale); - return; - } + g_file_get_contents (filename, &contents, &length, &error); + g_assert_no_error (error); + orig = g_bytes_new_take (contents, length); - expected_file = get_expected_filename (filename); + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + layout = pango_layout_deserialize (context, orig, PANGO_LAYOUT_DESERIALIZE_CONTEXT, &error); + g_assert_no_error (error); - dump = g_string_sized_new (0); + bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_CONTEXT | PANGO_LAYOUT_SERIALIZE_OUTPUT); - test_file (filename, dump); + g_object_unref (layout); + g_object_unref (context); - diff = diff_with_file (expected_file, dump->str, dump->len, &error); + diff = diff_bytes (orig, bytes, &error); g_assert_no_error (error); + g_bytes_unref (bytes); + g_bytes_unref (orig); + setlocale (LC_ALL, old_locale); g_free (old_locale); @@ -365,8 +102,37 @@ test_layout (gconstpointer d) } g_free (diff); - g_string_free (dump, TRUE); - g_free (expected_file); +} + +static void +install_fonts (const char *dir) +{ + FcConfig *config; + PangoFontMap *map; + char *conf; + + map = g_object_new (PANGO_TYPE_CAIRO_FC_FONT_MAP, NULL); + + config = FcConfigCreate (); + + conf = g_strdup_printf ("<?xml version=\"1.0\"?>\n" + "<!DOCTYPE fontconfig SYSTEM \"urn:fontconfig:fonts.dtd\">\n" + "<fontconfig>\n" + " <cachedir>%s/cache</cachedir>\n" + "</fontconfig>", dir); + + if (!FcConfigParseAndLoadFromMemory (config, (const FcChar8 *) conf, TRUE)) + g_error ("Failed to parse fontconfig configuration"); + + g_free (conf); + + FcConfigAppFontAddDir (config, (const FcChar8 *) dir); + pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (map), config); + FcConfigDestroy (config); + + pango_cairo_font_map_set_default (PANGO_CAIRO_FONT_MAP (map)); + + g_object_unref (map); } int @@ -374,11 +140,12 @@ main (int argc, char *argv[]) { GDir *dir; GError *error = NULL; + char *opt_fonts = NULL; const gchar *name; char *path; GOptionContext *option_context; GOptionEntry entries[] = { - { "show-fonts", '0', 0, G_OPTION_ARG_NONE, &opt_show_font, "Print font names in dumps", NULL }, + { "fonts", 0, 0, G_OPTION_ARG_FILENAME, &opt_fonts, "Fonts to use", "DIR" }, { NULL, 0 }, }; @@ -394,24 +161,49 @@ main (int argc, char *argv[]) } g_option_context_free (option_context); - if (g_getenv ("PANGO_TEST_SHOW_FONT")) - opt_show_font = TRUE; + if (opt_fonts) + install_fonts (opt_fonts); /* allow to easily generate expected output for new test cases */ if (argc > 1 && argv[1][0] != '-') { - GString *string; + char *contents; + gsize length; + GError *error = NULL; + GBytes *orig; + GBytes *bytes; + PangoContext *context; + PangoLayout *layout; - string = g_string_sized_new (0); - test_file (argv[1], string); - g_print ("%s", string->str); - g_string_free (string, TRUE); + g_file_get_contents (argv[1], &contents, &length, &error); + g_assert_no_error (error); + orig = g_bytes_new_take (contents, length); + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + layout = pango_layout_deserialize (context, orig, PANGO_LAYOUT_DESERIALIZE_CONTEXT, &error); + g_assert_no_error (error); + + bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_CONTEXT | PANGO_LAYOUT_SERIALIZE_OUTPUT); + + g_object_unref (layout); + g_object_unref (context); + + g_print ("%s", (const char *)g_bytes_get_data (bytes, NULL)); + + g_bytes_unref (bytes); + g_bytes_unref (orig); return 0; } g_test_init (&argc, &argv, NULL); + if (!opt_fonts) + { + path = g_test_build_filename (G_TEST_DIST, "fonts", NULL); + install_fonts (path); + g_free (path); + } + path = g_test_build_filename (G_TEST_DIST, "layouts", NULL); dir = g_dir_open (path, 0, &error); g_free (path); diff --git a/tests/testserialize.c b/tests/testserialize.c index 5fb7543a..bd962a56 100644 --- a/tests/testserialize.c +++ b/tests/testserialize.c @@ -19,6 +19,7 @@ */ #include "config.h" + #include <glib.h> #include <pango/pangocairo.h> #include <gio/gio.h> @@ -129,7 +130,7 @@ test_serialize_layout_minimal (void) const char *test = "{\n" " \"text\" : \"Almost nothing\"\n" - "}"; + "}\n"; PangoContext *context; GBytes *bytes; @@ -142,7 +143,7 @@ test_serialize_layout_minimal (void) bytes = g_bytes_new_static (test, -1); - layout = pango_layout_deserialize (context, bytes, &error); + layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error); g_assert_no_error (error); g_assert_true (PANGO_IS_LAYOUT (layout)); g_assert_cmpstr (pango_layout_get_text (layout), ==, "Almost nothing"); @@ -152,7 +153,7 @@ test_serialize_layout_minimal (void) g_assert_cmpint (pango_layout_get_alignment (layout), ==, PANGO_ALIGN_LEFT); g_assert_cmpint (pango_layout_get_width (layout), ==, -1); - out_bytes = pango_layout_serialize (layout); + out_bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_DEFAULT); str = g_bytes_get_data (out_bytes, NULL); g_assert_cmpstr (str, ==, test); @@ -200,7 +201,7 @@ test_serialize_layout_valid (void) " \"alignment\" : \"center\",\n" " \"width\" : 350000,\n" " \"line-spacing\" : 1.5\n" - "}"; + "}\n"; PangoContext *context; GBytes *bytes; @@ -208,14 +209,13 @@ test_serialize_layout_valid (void) PangoTabArray *tabs; GError *error = NULL; GBytes *out_bytes; - const char *str; char *s; context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); bytes = g_bytes_new_static (test, -1); - layout = pango_layout_deserialize (context, bytes, &error); + layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error); g_assert_no_error (error); g_assert_true (PANGO_IS_LAYOUT (layout)); g_assert_cmpstr (pango_layout_get_text (layout), ==, "Some fun with layouts!"); @@ -230,12 +230,47 @@ test_serialize_layout_valid (void) g_assert_cmpint (pango_layout_get_width (layout), ==, 350000); g_assert_cmpfloat_with_epsilon (pango_layout_get_line_spacing (layout), 1.5, 0.0001); - out_bytes = pango_layout_serialize (layout); - str = g_bytes_get_data (out_bytes, NULL); + out_bytes = pango_layout_serialize (layout, PANGO_LAYOUT_SERIALIZE_DEFAULT); - g_assert_cmpstr (str, ==, test); + g_assert_cmpstr (g_bytes_get_data (out_bytes, NULL), ==, g_bytes_get_data (bytes, NULL)); g_bytes_unref (out_bytes); + g_bytes_unref (bytes); + + g_object_unref (layout); + g_object_unref (context); +} + +static void +test_serialize_layout_context (void) +{ + const char *test = + "{\n" + " \"context\" : {\n" + " \"base-gravity\" : \"east\",\n" + " \"language\" : \"de-de\",\n" + " \"round-glyph-positions\" : \"false\"\n" + " },\n" + " \"text\" : \"Some fun with layouts!\"\n" + "}\n"; + + PangoContext *context; + GBytes *bytes; + PangoLayout *layout; + GError *error = NULL; + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + + bytes = g_bytes_new_static (test, -1); + + layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_CONTEXT, &error); + g_assert_no_error (error); + g_assert_true (PANGO_IS_LAYOUT (layout)); + g_assert_cmpstr (pango_layout_get_text (layout), ==, "Some fun with layouts!"); + + g_assert_cmpint (pango_context_get_base_gravity (context), ==, PANGO_GRAVITY_EAST); + g_assert_true (pango_context_get_language (context) == pango_language_from_string ("de-de")); + g_assert_false (pango_context_get_round_glyph_positions (context)); g_object_unref (layout); g_bytes_unref (bytes); @@ -256,8 +291,8 @@ test_serialize_layout_invalid (void) " \"type\" : \"caramba\"\n" " }\n" " ]\n" - "}", - PANGO_LAYOUT_SERIALIZE_INVALID_VALUE + "}\n", + PANGO_LAYOUT_DESERIALIZE_INVALID_VALUE }, { "{\n" @@ -266,8 +301,8 @@ test_serialize_layout_invalid (void) " \"type\" : \"weight\"\n" " }\n" " ]\n" - "}", - PANGO_LAYOUT_SERIALIZE_MISSING_VALUE + "}\n", + PANGO_LAYOUT_DESERIALIZE_MISSING_VALUE }, { "{\n" @@ -277,14 +312,22 @@ test_serialize_layout_invalid (void) " \"value\" : \"nonsense\"\n" " }\n" " ]\n" - "}", - PANGO_LAYOUT_SERIALIZE_INVALID_VALUE + "}\n", + PANGO_LAYOUT_DESERIALIZE_INVALID_VALUE }, { "{\n" " \"alignment\" : \"nonsense\"\n" - "}", - PANGO_LAYOUT_SERIALIZE_INVALID_VALUE + "}\n", + PANGO_LAYOUT_DESERIALIZE_INVALID_VALUE + }, + { + "{\n" + " \"attributes\" : {\n" + " \"name\" : \"This is wrong\"\n" + " }\n" + "}\n", + PANGO_LAYOUT_DESERIALIZE_INVALID_SYNTAX } }; @@ -299,9 +342,9 @@ test_serialize_layout_invalid (void) GError *error = NULL; bytes = g_bytes_new_static (test[i].json, -1); - layout = pango_layout_deserialize (context, bytes, &error); + layout = pango_layout_deserialize (context, bytes, PANGO_LAYOUT_DESERIALIZE_DEFAULT, &error); g_assert_null (layout); - g_assert_error (error, PANGO_LAYOUT_SERIALIZE_ERROR, test[i].expected_error); + g_assert_error (error, PANGO_LAYOUT_DESERIALIZE_ERROR, test[i].expected_error); g_bytes_unref (bytes); g_clear_error (&error); } @@ -317,6 +360,7 @@ main (int argc, char *argv[]) g_test_add_func ("/serialize/tab-array", test_serialize_tab_array); g_test_add_func ("/serialize/layout/minimal", test_serialize_layout_minimal); g_test_add_func ("/serialize/layout/valid", test_serialize_layout_valid); + g_test_add_func ("/serialize/layout/context", test_serialize_layout_context); g_test_add_func ("/serialize/layout/invalid", test_serialize_layout_invalid); return g_test_run (); |