summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Revert "testrandom: Disable assertions I can't make work"line-breaking-fixes2Matthias Clasen2021-11-151-7/+2
| | | | This reverts commit 3bacb9c23b211ffe6674f9d0ce3e6dbecdb4808f.
* More tweaks, and commentsMatthias Clasen2021-11-151-15/+22
|
* testrandom: Updates from BenjaminMatthias Clasen2021-11-141-6/+16
|
* testrandom: Disable assertions I can't make workMatthias Clasen2021-11-141-2/+7
|
* Go back to an array for disabled breakpointsMatthias Clasen2021-11-141-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-141-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-141-9/+30
| | | | | We always need to check if we still fit, after shaping. The width we use before is just an estimate.
* testrandom: Quiet a compiler warningMatthias Clasen2021-11-141-1/+1
|
* tests: Add a spiced up wrapping testBenjamin Otte2021-11-142-1/+278
| | | | | | | | | | | | * Generate 20 random strings that look like sentences. * For each of them, measure the size at 100 random widths. * assert that for those widths, when sorted, the measured widths are increasing and the heights are decreasing. The test alsogenerates 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.
* 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
* Merge branch 'ltr-line-breaking-fixes' into 'main'Matthias Clasen2021-11-121-68/+51
|\ | | | | | | | | Simplify breakpoint disabling See merge request GNOME/pango!504
| * Fix a thinkoltr-line-breaking-fixesMatthias Clasen2021-11-121-1/+1
| |
| * Fix another corner case of space-handlingMatthias Clasen2021-11-121-5/+17
| | | | | | | | This keeps spiraling :(
| * Fix up one more case of break-after-spaceMatthias Clasen2021-11-121-11/+11
| | | | | | | | | | | | If the break is at the end of the item, we were forgetting to check for the space before the break.
| * Handle break-after-space correctlyMatthias Clasen2021-11-121-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are breaking after a space, we must not count the width of the space towards the line, since we are zeroing it later. It is a bit annoying that there are multiple places where this has to be taken into account. Another missing bit in this code is that we are only looking at a single whitespace character before the break, when we should really look for a sequence of spaces.
| * Correctly reinstate remaining_widthMatthias Clasen2021-11-121-1/+3
| | | | | | | | | | When unsplitting an item, we were sometimes calculating the remaining_width incorrectly.
| * Simplify find_break_extra_widthMatthias Clasen2021-11-121-25/+1
| | | | | | | | We can use the log_widths that we already have.
| * Simplify breakpoint disablingMatthias Clasen2021-11-121-30/+9
|/ | | | | | We only want this inside process_item, so we can make this a purely local thing, without modifying log_attrs.
* Merge branch 'matthiasc/for-main' into 'main'Matthias Clasen2021-11-121-1/+2
|\ | | | | | | | | Cosmetics See merge request GNOME/pango!503
| * CosmeticsMatthias Clasen2021-11-121-1/+2
|/
* Merge branch 'ctweight' into 'main'Matthias Clasen2021-11-121-4/+5
|\ | | | | | | | | coretext: correctly clamp the core text weights at min/max values See merge request GNOME/pango!502
| * coretext: correctly clamp the core text weights at min/max valuesJeremy Tan2021-11-121-4/+5
| | | | | | | | Addresses bug found in #624
* | Merge branch 'avoid-overlong-lines' into 'main'Matthias Clasen2021-11-125-9/+112
|\ \ | | | | | | | | | | | | layout: Try harder to not produce overlong lines See merge request GNOME/pango!501
| * | Try harder to not produce overlong linesavoid-overlong-linesMatthias Clasen2021-11-111-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our accounting for run lengths is imperfect (mainly due to log widths for clusters being evenly distributed), so it can happen that after reshaping the split item, we find that it does not actually fit in the remaining width. Previously, we would just use the split run at that point and produce an overlong line. Instead, undo the split, disable the breakpoint we used, and try again.
| * | Add pango_item_unsplitMatthias Clasen2021-11-112-1/+30
| | | | | | | | | | | | | | | | | | This undoes the effect of pango_item_split. We will use this in future commits. Private for now.
| * | Reserve the remaining bits in PangoLogAttrMatthias Clasen2021-11-111-0/+2
| | | | | | | | | | | | This will let us use some of them during layout.
| * | pango-view: Accept width 0Matthias Clasen2021-11-111-2/+2
| | | | | | | | | | | | | | | | | | GTK frequently uses this width during measuring, so it is good if we can reproduce what happens in this case.
| * | pango-view: Add --pango-unitsMatthias Clasen2021-11-111-4/+28
| | | | | | | | | | | | This can make it easier to reproduce problems.
| * | CosmeticsMatthias Clasen2021-11-111-2/+2
|/ /
* | Merge branch 'fix-hyphen-width' into 'main'Matthias Clasen2021-11-114-16/+39
|\ \ | |/ |/| | | | | layout: Fix a poblem with hyphen width See merge request GNOME/pango!500
| * Update affected testsfix-hyphen-widthMatthias Clasen2021-11-102-8/+8
| |
| * Add a test for layout widthMatthias Clasen2021-11-101-0/+26
| | | | | | | | This checks behavior that is required by GTK.
| * layout: Fix a poblem with hyphen widthMatthias Clasen2021-11-101-8/+5
|/ | | | | In some cases, we were forgetting to account for the width of a hyphen.
* docs: Small additionMatthias Clasen2021-11-101-3/+3
| | | | Mention new attribute values in markup docs.
* Merge branch 'newer-fontconfig' into 'main'Matthias Clasen2021-11-094-30/+17
|\ | | | | | | | | Bump fontconfig dep to 2.13.0 See merge request GNOME/pango!499
| * fc: Drop unnecessary ifdefsMatthias Clasen2021-11-083-29/+16
| | | | | | | | We are requiring a new enough fontconfig now.
| * Bump fontconfig dep to 2.13.0Matthias Clasen2021-11-081-1/+1
| | | | | | | | | | This version of fontconfig has all the API we are using, and was released in 2018.
* | Merge branch 'set-ptem' into 'main'Matthias Clasen2021-11-091-21/+20
|\ \ | |/ |/| | | | | Call hb_font_set_ptem when creating fonts See merge request GNOME/pango!498
| * Call hb_font_set_ptem when creating fontsset-ptemMatthias Clasen2021-11-081-21/+20
|/ | | | | This is useful information for Harfbuzz to have, so pass it along.
* Update docsMatthias Clasen2021-11-081-1/+2
| | | | Add the new variant values to the docs.
* 1.49.31.49.3Matthias Clasen2021-11-082-1/+9
|
* Merge branch 'small-caps' into 'main'Matthias Clasen2021-11-0812-170/+661
|\ | | | | | | | | Emulate Small Caps if not available from the font See merge request GNOME/pango!497
| * itemize: Handle text transformssmall-capsMatthias Clasen2021-11-081-17/+70
| | | | | | | | | | | | Take text transforms into account when emulating Small Caps. This requires us to have log attrs to determine word starts.
| * Reshuffle itemize APIMatthias Clasen2021-11-083-31/+59
| | | | | | | | | | | | | | | | | | | | | | Split the post-processing off into a separate function that can take log attrs in addition. This will allow us to handle word starts when dealing with text transforms for emulated Small Caps. So far, this is all private API that is used from PangoLayout. Please file an issue if you want to access Small Caps emulation without PangoLayout.
| * Cosmetics: Add the right sectionMatthias Clasen2021-11-071-1/+4
| | | | | | | | Move private API out of the 'Public API' section.
| * Reshuffle private headers a bitMatthias Clasen2021-11-073-14/+15
| | | | | | | | pango_itemize_with_font belongs into pango-item-private.h.