summaryrefslogtreecommitdiff
path: root/pango
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug in Small Caps handlingMatthias Clasen2021-11-131-2/+2
| | | | | | | | | We were not passing the correct split_offset to pango_item_split(). Testcase included. Fixes: #627
* 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.
* 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
* | 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.
* | CosmeticsMatthias Clasen2021-11-111-2/+2
| |
* | 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.
* Merge branch 'newer-fontconfig' into 'main'Matthias Clasen2021-11-093-29/+16
|\ | | | | | | | | 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.
* | 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.
* 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.
* shape: Be consistent when getting text transformsMatthias Clasen2021-11-071-2/+3
| | | | We want last-one-wins semantics here.
* itemize: Emulate other casing variantsMatthias Clasen2021-11-071-67/+130
| | | | | | | | | | | | When we detect that one of the other casing variants is requested, but not available via OpenType font features, emulate it by splitting the item into lowercase and uppercase runs and apply a suitable font scale and text transform to the runs to get the desired effect. Still to do: resolve conflics with preexisting text transform attributes.
* fc: Implement the other casing variantsMatthias Clasen2021-11-071-5/+66
| | | | | | Pass all the PangoVariant values through the FcPattern by translating them into suitable OpenType features in the pattern.
* Add more casing variantsMatthias Clasen2021-11-072-3/+30
| | | | | Add values for all the css casing variants to the PangoVariant enum.
* itemize: Implement emulated Small CapsMatthias Clasen2021-11-071-1/+181
| | | | | | | | | | | When we detect that Small Caps are requested, but not available via OpenType font features, emulate Small Caps by splitting the item into lowercase and uppercase runs and add text transform and font scale attributes to the lowercase runs to get the effect of Small Caps. Still to do: resolve conflicts with preexisting text transform attributes.
* itemize: Break out a helperMatthias Clasen2021-11-071-27/+32
| | | | | | Factor out the 'consider as space' part from the itemization code, so we can reuse it when breaking items into upper- and lowercase runs.
* itemize: Handle PANGO_FONT_SCALE_SMALL_CAPSMatthias Clasen2021-11-071-17/+39
| | | | This is not used by anything yet.
* Add PANGO_FONT_SCALE_SMALL_CAPSMatthias Clasen2021-11-071-1/+3
| | | | | This will be used in the implementation of emulated Small Caps.
* shape: Use the new helperMatthias Clasen2021-11-061-68/+2
|
* pango-item: Add a helperMatthias Clasen2021-11-062-0/+73
| | | | | | Add a helper function that used to live with the Harfbuzz shaping code in shape.c. It will be used in the itemize code too, in the future.
* fc: Implement PANGO_VARIANT_SMALL_CAPSMatthias Clasen2021-11-051-0/+21
| | | | | | | Arrange for PANGO_VARIANT_SMALL_CAPS to be translated into the OpenType feature smcp=1 and back. This makes small caps survive a roundtrip from font description to font and back.
* Fix advance widths with transformsadvance-transformMatthias Clasen2021-11-051-29/+13
| | | | | | | | | | The hb_font_t we were passing to Harfbuzz for shaping was not taking context transforms into account, and therefore was not scaling advance widths as necessary. Always go through pangos glyph extents to fix this. Fixes: #620
* Add a few more default-ignorablesmore-default-ignorablesMatthias Clasen2021-11-031-0/+5
| | | | | | Add some more directional formatting characters to the list of default-ignorables that we make visible when requested: ALM, LRI, RLI, FSI, PDI.
* fontset: Add a missing annotationMatthias Clasen2021-10-311-1/+3
| | | | | pango_fontset_simple_append consumes the font that it is given.
* Make logical glyph extents betterMatthias Clasen2021-10-311-0/+2
| | | | | For east and west gravity, the logical glyph extents were still misaligned with the ink extents.
* Merge branch 'glyph-extents-fixes' into 'main'Matthias Clasen2021-10-312-27/+66
|\ | | | | | | | | cairo: Produce meaningful logical glyph extents See merge request GNOME/pango!490
| * cairo: Small fixupglyph-extents-fixesMatthias Clasen2021-10-301-1/+1
| | | | | | | | | | | | cf_priv->scaled_font is initialized on demand, it may be NULL. So better call the getter. This was showing up as failure in the asan test in ci.
| * Use harfbuzz metrics for cairo fontsMatthias Clasen2021-10-301-14/+37
| | | | | | | | | | Without this, we end up with differences in metrics of empty runs.
| * cairo: fix hinting of metricsMatthias Clasen2021-10-301-4/+3
| | | | | | | | | | | | | | We were looking at the wrong font options here, causing metrics to not be hinted when they should be. This was causing some of the empty line height tests to fail.
| * cairo: Produce meaningful logical glyph extentsMatthias Clasen2021-10-301-11/+28
| | | | | | | | | | Depending on gravity, our logical glyph extents were empty and mis-aligned. Fix that.
* | gi: add array annotations to get_languages Bilal Elmoussaoui2021-10-301-2/+1
|/ | | | Also drops the null-terminated doc comment as gi-docgen shows that already if the function is annotated properly
* Flesh out some doc commentsMatthias Clasen2021-10-292-3/+16
| | | | | Add some missing details about new enumerations and run baselines.
* pango: backport an old since annotationBilal Elmoussaoui2021-10-291-0/+2
| | | | from a manual override in gtk-rs
* add missing since 1.50 annotationsBilal Elmoussaoui2021-10-293-0/+15
|
* Revert "Use harfbuzz metrics for cairo fonts"Matthias Clasen2021-10-271-22/+21
| | | | | | This broke glyph extents with gravity north or west. This reverts commit 20ec670e124e4461075a2967faa29603d25106cc.
* Support for Catalan middle dot in word start and endJordi Mas2021-10-272-0/+67
|