summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of extra widthline-breaking-fixes4Matthias Clasen2021-11-221-5/+23
| | | | | | | When handling items that fix completely, we were not consistently taking extra width into account, leading to hyphens sticking out in some cases.
* break: Fix hyphen conditionMatthias Clasen2021-11-2210-27/+32
| | | | | | | When looking at scripts, we want to look at the script of the *previous* character. And then we need to exclude SHY from the common script.
* Fix a case of unintended hyphenationMatthias Clasen2021-11-223-1/+55
| | | | | | | | | | | | | 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
* Add more autoptr definitionsMatthias Clasen2021-11-225-0/+14
|
* Merge branch 'matthiasc/for-main' into 'main'Matthias Clasen2021-11-206-6/+30
|\ | | | | | | | | | | | | Don't replace | with hyphens Closes #630 See merge request GNOME/pango!516
| * ci: Allow the win32 render run to failMatthias Clasen2021-11-192-2/+2
| | | | | | | | | | | | I don't know why it started to fail, and am not in a position to debug it. So, let it fail, like we already do with the testsuite :(
| * Make summary work with meson 0.55Matthias Clasen2021-11-191-1/+1
| | | | | | | | That is what we have in ci.
| * build: Add a summaryMatthias Clasen2021-11-191-0/+25
| | | | | | | | | | I hope this will give some insight into what is happening in ci builds.
| * Don't replace | with hyphensMatthias Clasen2021-11-193-4/+3
|/ | | | | | | | | | | 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
* Merge branch 'matthiasc/for-main' into 'main'Matthias Clasen2021-11-193-4/+37
|\ | | | | | | | | Tweak word and sentence attributes See merge request GNOME/pango!515
| * pango-view: Allow loading serialized layoutsMatthias Clasen2021-11-191-1/+34
| | | | | | | | | | | | | | | | | | You can now do pango-view --serialized file All layout-related options will be overwritten by the serialized data. Other options can still be used.
| * pango-view: Fix display of char extentsMatthias Clasen2021-11-191-1/+1
| |
| * Tweak word and sentence attributesMatthias Clasen2021-11-191-2/+2
|/ | | | | | The value does not really matter for these, but it looks more natural if they have a value of 1, and not 0.
* Merge branch 'serializer2' into 'main'Matthias Clasen2021-11-1855-344/+1540
|\ | | | | | | | | Add layout serialization api See merge request GNOME/pango!513
| * Add a json-glib subprojectserializer2Matthias Clasen2021-11-182-1/+7
| | | | | | | | This is necessary for ci on MacOs to build.
| * Improve valgrind suppressionsMatthias Clasen2021-11-181-0/+15
| | | | | | | | | | Also suppress pango_language_from_string and GLib thread creation.
| * Make test-layout use layout serializationMatthias Clasen2021-11-1846-372/+416
| | | | | | | | | | Now that we have this api, lets use it for our tests.
| * Add layout serialization apiMatthias Clasen2021-11-186-3/+1133
| | | | | | | | | | | | | | | | Add api to serialize PangoLayout, for the benefit of testing and debugging. Currently, this uses json, but that is an implementation detail. Some tests included.
| * ci: Add json-glib to the imageMatthias Clasen2021-11-182-1/+2
|/ | | | This is needed now for the serialization code.
* Merge branch 'take-out-gdebug' into 'main'Matthias Clasen2021-11-181-35/+37
|\ | | | | | | | | Neuter g_debug in line-breaking See merge request GNOME/pango!514
| * Neuter g_debug in line-breakingtake-out-gdebugMatthias Clasen2021-11-181-35/+37
|/ | | | | | This code gets run for gtks size-allocation, and we don't want it to be any slower than it has to be, when not debugging it.
* Merge branch 'serialize-attrs-and-tabs' into 'main'Matthias Clasen2021-11-1748-905/+1435
|\ | | | | | | | | Add pango_attr_list_to/from_string See merge request GNOME/pango!512
| * Add pango_tab_array_to/from_stringserialize-attrs-and-tabsMatthias Clasen2021-11-173-0/+154
| |
| * Use serialization api in testattributesMatthias Clasen2021-11-173-552/+337
| |
| * tests: Reuse attribute serialization codeMatthias Clasen2021-11-1740-353/+309
| | | | | | | | Update affected test outputs.
| * Add pango_attr_list_to/from_stringMatthias Clasen2021-11-174-0/+635
|/ | | | | | Add an api to serialize PangoAttrList. This will be useful in testing and debugging.
* Merge branch 'rewrite-line-breaking' into 'main'Matthias Clasen2021-11-173-216/+640
|\ | | | | | | | | Rewrite process_item See merge request GNOME/pango!509
| * Fix a thinko in zero_line_final_spaceMatthias Clasen2021-11-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | We must not add the width of the space back to remaining_width, since we're just correcting the glyphs to match the accounting that process_item has already done. This was showing up as justification operating on wrong numbers when justifying lines with a final space, leading to uneven margins.
| * Correct the extra_width accountingMatthias Clasen2021-11-161-2/+5
| |
| * ci: Don't run testrandom on macOsMatthias Clasen2021-11-161-1/+6
| | | | | | | | | | It fails there (although it shouldn't), and I don't have the means to debug it.
| * CosmeticsMatthias Clasen2021-11-161-1/+1
| |
| * Another small leak fixMatthias Clasen2021-11-161-0/+1
| |
| * Fix a small memleakMatthias Clasen2021-11-161-1/+3
| | | | | | | | | | Our asan ci is unforgiving, and point out every memory leak.
| * Rewrite process_itemMatthias Clasen2021-11-161-214/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not an entire rewrite, the basic approach to fitting items is still the same. The main difference here is that we shape and measure a possible breakpoint before accepting it as candidate for breaking. This is necessary to ensure that we have accurate width information when making decisions about this breakpoint - the width we are calculating based on log widths is only an approximation (due to things like clusters, hyphens, final spaces, etc). To avoid excessive shaping, we only do this extra work when we are close to the end of the line.
| * tests: Add spiced up wrapping testsBenjamin Otte2021-11-152-1/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Generate random string that looks like a sentence. * Measure the size at 100 random widths. * assert that for those widths, when sorted, the measured widths are increasing and the heights are decreasing. * Generate random string that looks like a sentence. * Generate a 2nd string adding hyphen + newline after every char of original string. * Assert that wrap-char wrap with width=0 is not larger than the width of the 2nd string The tests also generate random strings in LTR, RTL or both at the same time to spice the test up even more. It does that by picking random words out of hunspell directories, and if none are installed, it falls back to lorem ipsum.
* | Merge branch 'matthiasc/for-main' into 'main'Matthias Clasen2021-11-172-9/+5
|\ \ | | | | | | | | | | | | build: Bump the harfbuzz req See merge request GNOME/pango!511
| * | build: Bump the harfbuzz reqMatthias Clasen2021-11-162-9/+5
|/ / | | | | | | | | | | | | We are using the hb metrics api in more places now, so just require 2.6.0 where it was introduced. That version is almost 2 years old now, so that is hopefully not too much of a burden.
* | Merge branch 'matthiasc/for-main' into 'main'Matthias Clasen2021-11-161-3/+0
|\ \ | |/ |/| | | | | pango-view: Remove debug spew See merge request GNOME/pango!508
| * pango-view: Remove debug spewMatthias Clasen2021-11-161-3/+0
|/
* Merge branch 'line-breaking-fixes3' into 'main'Matthias Clasen2021-11-152-38/+78
|\ | | | | | | | | More line breaking fixes See merge request GNOME/pango!507
| * Update affected testsline-breaking-fixes3Matthias Clasen2021-11-151-6/+6
| | | | | | | | Some of the layout tests now get better line breaks.
| * More tweaks, and commentsMatthias Clasen2021-11-151-15/+22
| |
| * Go back to an array for disabled breakpointsMatthias Clasen2021-11-151-10/+24
| | | | | | | | | | It turns out that we do need to look for longer breakpoints after all if we want to find optimal solutions.
| * Fix line-break accounting moreMatthias Clasen2021-11-151-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When looking for breakpoints, we were assuming that there is no point to keep looking forward once we hit a spot where the broken off part is too long. But with hyphen insertion, that is no longer true, necessarily. Consider 'bli '. Breaking after 'bl' will insert 'bl-', which might be longer than 'bli', which is what will be inserted when we break after the i. To fix this, keep looking for breakpoints as long as there is still a chance to find one.
| * Improve the BREAK_ALL_FIT caseMatthias Clasen2021-11-151-9/+30
| | | | | | | | | | We always need to check if we still fit, after shaping. The width we use before is just an estimate.
| * layout: Simplify things one more timeMatthias Clasen2021-11-141-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | The key insight here is that if we find a broken item does not fit, we are only interested in finding an *earlier* breakpoint - the later ones aren't going to produce a shorter run. So we can just keep track of the last char we want to allow breaking at. This fixes the case of finding the minimum width with wrap mode PANGO_WRAP_WORD.
| * CosmeticsMatthias Clasen2021-11-141-1/+0
|/
* Merge branch 'fix-itemize-crash' into 'main'Matthias Clasen2021-11-132-2/+32
|\ | | | | | | | | | | | | Fix a bug in Small Caps handling Closes #627 See merge request GNOME/pango!505
| * Skip the test on macOSfix-itemize-crashMatthias Clasen2021-11-131-0/+6
| |
| * Fix a bug in Small Caps handlingMatthias Clasen2021-11-132-2/+26
|/ | | | | | | | | We were not passing the correct split_offset to pango_item_split(). Testcase included. Fixes: #627