summaryrefslogtreecommitdiff
path: root/tests/layouts
Commit message (Collapse)AuthorAgeFilesLines
* serializer: Improve font serializationMatthias Clasen2022-01-285-0/+11
| | | | | | | Include index and instance_id in the output when serializing fonts. Update all affected tests.
* Add a test for letterspacingMatthias Clasen2022-01-021-0/+135
| | | | | This tests that we turn off ligatures when letterspacing is enabled.
* Make missing space smallersmaller-spaceMatthias Clasen2021-12-222-7/+7
| | | | | | | The Microsoft paper I was citing actually recommends 1/4 em for ASCII space. Make it so... Update affected tests.
* Use a better size for missing spaceMatthias Clasen2021-12-212-7/+7
| | | | | | | | | | Follow the Microsoft Typography recommendations from https://docs.microsoft.com/en-us/typography/develop/character-design-standards/whitespace and use half of an em for missing space. Update affected tests. Fixes: #647
* Add a test for the previous commitsmisc-cleanupsMatthias Clasen2021-12-181-0/+295
| | | | | This test verifies the fixes for the situation described in #646.
* serializer: Fix a typoMatthias Clasen2021-12-1835-35/+35
| | | | | | Oops, we were not serializing the height at all. Update all affected tests.
* cairo: Work harder to measure spacemore-space-tweaksMatthias Clasen2021-12-172-18/+12
| | | | | | | | | | | When coming up with a width for a missing space, we were just measuring the hex digits. But in subsetted fonts, such as the ones we use for ci, hex digits might well be missing. Take that into account and still provide some nonzero width for space. Update affected tests.
* shape: More tweaks to space handlingMatthias Clasen2021-12-172-18/+24
| | | | | | | | | | | | | | It is a difficult dance between HarfBuzz and pango which glyphs we let hb synthesize, and which ones we need to fake ourselves. HarfBuzz knows how to create other spaces from 0x20, so if the font is lacking spaces, we want to tell HarfBuzz that we don't have that glyph *except* for 0x20 where we need to fake one, and provide HarfBuzz with a suitable width. Update affected tests.
* Revert "Fix advance widths with transforms"fix-vertical-regressionMatthias Clasen2021-12-1714-41/+301
| | | | | | | | | This reverts commit ccb651dd2a876a4f4a4cb9351f05332173e709ba. This broke vertical text rendering, see https://gitlab.com/inkscape/inkscape/-/issues/2950. Update affected tests and add a vertical test.
* Fix handling of space-less fontsfix-spaceless-fontsMatthias Clasen2021-12-162-13/+149
| | | | | | | | | | | HarfBuzz knows how to synthesize spaces, we just need to tickle it in the right way. Test included. Update affected tests. Fixes: #641
* Add a test for 0x6ddarabic-formatMatthias Clasen2021-12-161-0/+89
| | | | This tests the fix in the previous commit.
* layout: Handle a corner caseMatthias Clasen2021-12-091-0/+183
| | | | | | | | | We can't break in a tab run. This fixes an assertion found by afl. Testcase included. Fixes: #638
* Fix line width computationMatthias Clasen2021-12-061-0/+363
| | | | | | | | | | We an only use the line_width - remaining_width shortcut if we are actually maintaining remaining_width, i.e. not if we don't wrap lines. Testcase included. Fixes: #635
* Add a monospace font for ciMatthias Clasen2021-12-062-16/+16
| | | | Update affected test outputs.
* Fix a crash in tab handlingtab-crash-fixMatthias Clasen2021-12-051-0/+1429
| | | | | | | | | | When we uninsert the current tab run, we need to reset our tab state to prevent last_tab->glyphs to become a dangling pointer. Test included. Fixes: #634
* Update tests for small changes in outputMatthias Clasen2021-12-0229-1225/+1204
|
* layout: Small optimizationMatthias Clasen2021-12-022-14/+14
| | | | | Don't calculate line width the hard way when we can do it much easier.
* Add a test with tab alignmentstab-alignMatthias Clasen2021-11-291-0/+1836
|
* tabs: Add a decimal pointMatthias Clasen2021-11-292-10/+20
| | | | | | | This is useful for PANGO_TAB_DECIMAL. Implement this in PangoLayout, in the serializer, and update tests.
* serializer: Support tab alignmentsMatthias Clasen2021-11-292-10/+40
| | | | | | | | | Serialize tab alignment in addition to tab position. We still accept the old format and default alignment to left. Update testserialize and layout tests for this.
* Never show variation selectorsMatthias Clasen2021-11-281-0/+170
| | | | | | | | Even when we show ignorables, we still want to ignore variation selectors and other ignorables that we don't have nicks for. Test included.
* Fix line heights in improper gravitiesgravity-fixesMatthias Clasen2021-11-271-4/+4
| | | | | | | | | | | Without this, we end up with line height being zero in gravity north or west. The visible symptom is that wrapped lines are drawn on top of each other with line-height != 0. Affected tests have been updated. Fixes: #631
* Update tests one more timeMatthias Clasen2021-11-2622-1375/+1230
|
* Add a newline to serialization resultsMatthias Clasen2021-11-2527-203/+85
| | | | | | | | Otherwise editing the output in an editor is likely to make the data not match anymore, since most editors will add a final newline. Update all tests
* Make test-layout use included fontsMatthias Clasen2021-11-2527-152/+1615
| | | | | | | | | Add Cantarell, DejaVu Sans and a subset of Noto Color Emoji to git, and make test-layout use just those fonts. This should help with keeping the ci from breaking due to different system fonts. Update tests.
* Add more testsMatthias Clasen2021-11-246-9/+1049
| | | | | These were produced with the help of http://gitlab.gnome.org/matthiasc/layout-editor
* Update test-layoutMatthias Clasen2021-11-2423-95/+13764
| | | | | | Use the new output serialization in test-layout to store both the input and output in the same file.
* Optionally serialize outputMatthias Clasen2021-11-2421-916/+0
| | | | | | | If requested, serialize lines, runs, and log attrs. This will let us use the serialization format to record not just the test inputs, but outputs as well.
* Fix a case of unintended hyphenationMatthias Clasen2021-11-222-0/+53
| | | | | | | | | | | | | When we take a complete item because there are no breakpoints, we were inserting a hyphen at the end even though there may not be a breakpoint there, and ending up with a hyphen in the middle of an (overlong) line: Brat-wurst. Test included. This but was discovered with the help of http://gitlab.gnome.org/matthiasc/layout-editor
* Don't replace | with hyphensMatthias Clasen2021-11-191-1/+1
| | | | | | | | | | | I went a bit overboard in #603. The vertical bar is too common, and this usage to specialized to do it by default. To enable this, we should rather make log attrs tweakable. We still replace hyphenation points with hyphens. Fixes: #630
* Make test-layout use layout serializationMatthias Clasen2021-11-1844-81/+343
| | | | | Now that we have this api, lets use it for our tests.
* tests: Reuse attribute serialization codeMatthias Clasen2021-11-1714-120/+120
| | | | Update affected test outputs.
* Update affected testsline-breaking-fixes3Matthias Clasen2021-11-151-6/+6
| | | | Some of the layout tests now get better line breaks.
* Update affected testsfix-hyphen-widthMatthias Clasen2021-11-102-8/+8
|
* Be more forgiving about attribute orderingMatthias Clasen2021-09-012-0/+113
| | | | | | | | | | | | We don't really have firm control over the way attributes are ordered in the list, so the assumtion that we see proper nesting for baseline shifts was a bit optimistic. Just look through all open stack items for a match, and remove that. Test included.
* Refine hyphenationMatthias Clasen2021-08-251-1/+1
| | | | | | | | Replace ‧ and | with a - when we break there. Update affected test output. Fixes: #603
* Reimplement pango_layout_move_cursor_visuallyMatthias Clasen2021-08-082-2/+2
| | | | | | | | Reimplement this function based on pango_layout_get_cursor_pos. This is a bit less efficient, but it fixes cases where the old implementation would get stuck. Fixes: #587, #585, #157
* itemize: Ignore width in horizontal contextignore-width-in-horizontal2Matthias Clasen2021-08-035-28/+61
| | | | | | | | | Changes in width only need to break runs in vertical context. Update tests and add a new test. Fixes: #503
* itemize: Fix up gravity state initializationgravity-fixMatthias Clasen2021-08-022-0/+42
| | | | | | | | itemize_state_init was setting gravity-related fields to their initial values too late, after update_attr_iterator has already set them to the values for the first run. Test included.
* break: Fix handling of tag sequencestests-and-fixesMatthias Clasen2021-07-071-1/+1
| | | | | | | | Correctly classify tag characters as Grapheme_Extend, so that we don't end up putting grapheme boundaries in the middle of tag sequences. Includes a test.
* tests: Add some more layout testsMatthias Clasen2021-07-076-0/+127
|
* tests: Check more layout propertiesMatthias Clasen2021-07-0626-0/+466
| | | | | | | | Allow setting more layout properties in test-layout, and check their values after setting them. Also print out directions and cursor positions. Update existing tests, and add more.
* Fix a thinkoMatthias Clasen2021-05-101-2/+2
| | | | | | | | | The commit message for d476d2a944500f8553 said "word boundaries", but the code checked for line breaks. That was wrong, since it also made hyphens disappear at SHY, where we very much want them. Update affected tests.
* layout: Don't insert hyphens at word boundariesword-break-hyphensMatthias Clasen2021-05-081-2/+2
| | | | | | | | | | We only want to insert hyphens when we are breaking inside a word. Update affected tests (hyphen-or-not shows up in the analysis flags in the output of test-layout). Fixes: #558
* Add a test for keycap sequencesfix-keycap-sequencesMatthias Clasen2020-09-172-0/+27
| | | | | This tests that we are not breaking items up in the middle of a keycap sequence.
* Try to make the layout test less sensitiveMatthias Clasen2020-06-102-2/+2
| | | | | | Try not to pick a width that makes line-breaking decisions depend on rounding. Lets see if this works better, it makes the test pass locally.
* Revert "tests: Update expected output"Matthias Clasen2020-06-102-0/+2
| | | | This reverts commit 4d8e71471984fb0fc147d1a64695ad5f18576fde.
* tests: Update expected outputTimm Bäder2020-06-082-2/+0
| | | | | We don't set an attribute list in these cases anymore, so reflect that in the output.
* Adjust expected test outputsMatthias Clasen2019-10-281-2/+2
| | | | The change is a harmless change in attribute list ordering.
* Pass the right attributes when shaping ellipsesMatthias Clasen2019-08-061-1/+1
| | | | | | | | | | | | | | | Now that we are splitting attributes into those that are relevant for itemization and shaping, we need to make sure to pass the right ones along when ellipsizing, or we risk picking a wildly mismatching font for the ellipsis run, causing things to shift vertically. Test included. Closes: https://gitlab.gnome.org/GNOME/pango/issues/397 Thanks to Jorge Luis Martinez Gomez for his help in tracking this down.