| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Add an api to serialize PangoAttrList.
This will be useful in testing and debugging.
|
|\
| |
| |
| |
| | |
Rewrite process_item
See merge request GNOME/pango!509
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
It turns out that we do need to look for longer breakpoints
after all if we want to find optimal solutions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We always need to check if we still fit, after shaping.
The width we use before is just an estimate.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
We were not passing the correct split_offset to
pango_item_split().
Testcase included.
Fixes: #627
|
| |
|
|
|
|
| |
This keeps spiraling :(
|
|
|
|
|
|
| |
If the break is at the end of the item, we
were forgetting to check for the space before
the break.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
When unsplitting an item, we were sometimes
calculating the remaining_width incorrectly.
|
|
|
|
| |
We can use the log_widths that we already have.
|
|
|
|
|
|
| |
We only want this inside process_item, so we can
make this a purely local thing, without modifying
log_attrs.
|
| |
|
|\
| |
| |
| |
| | |
coretext: correctly clamp the core text weights at min/max values
See merge request GNOME/pango!502
|
| |
| |
| |
| | |
Addresses bug found in #624
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
This undoes the effect of pango_item_split.
We will use this in future commits.
Private for now.
|
| |
| |
| |
| | |
This will let us use some of them during layout.
|
| | |
|
|/
|
|
|
| |
In some cases, we were forgetting to account
for the width of a hyphen.
|
|\
| |
| |
| |
| | |
Bump fontconfig dep to 2.13.0
See merge request GNOME/pango!499
|
| |
| |
| |
| | |
We are requiring a new enough fontconfig now.
|
|/
|
|
|
| |
This is useful information for Harfbuzz to have,
so pass it along.
|
|
|
|
| |
Add the new variant values to the docs.
|
|
|
|
|
|
| |
Take text transforms into account when emulating
Small Caps. This requires us to have log attrs
to determine word starts.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Move private API out of the 'Public API' section.
|
|
|
|
| |
pango_itemize_with_font belongs into pango-item-private.h.
|
|
|
|
| |
We want last-one-wins semantics here.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Pass all the PangoVariant values through the
FcPattern by translating them into suitable
OpenType features in the pattern.
|
|
|
|
|
| |
Add values for all the css casing variants to
the PangoVariant enum.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Factor out the 'consider as space' part from the
itemization code, so we can reuse it when breaking
items into upper- and lowercase runs.
|
|
|
|
| |
This is not used by anything yet.
|
|
|
|
|
| |
This will be used in the implementation of emulated
Small Caps.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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 some more directional formatting characters
to the list of default-ignorables that we make
visible when requested: ALM, LRI, RLI, FSI, PDI.
|