| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
We were using the font metrics height, which is
scaled by the ctm, so we need to take the font
scale factors into account here.
Fixes: #691
|
|
|
|
|
|
|
| |
We only want line separators at the line end
to be visible when the show flags say so. This
was not working before, because the shaping always
marks LS as unknown glyph.
|
|
|
|
| |
This showed up as wrong slopes with font size > 60.
|
| |
|
|
|
|
|
|
|
|
| |
No great typography can be expected without fonts,
but we should try not to crash, since this situation
can apparently happen on Windows.
Fixes: #680
|
|
|
|
|
|
|
|
|
|
| |
When moving the cursor off the paragraph end to
the left in RTL text, we were moving to the previous
line, and not to the next line, as expected.
Test included.
Fixes: #679
|
|
|
|
|
|
| |
It is not really needed.
Fixes: #674
|
|
|
|
|
|
|
| |
During post-processing for lines, take into
account the baselines for each run, and shift
them vertically to align them on the dominant
baseline.
|
|
|
|
| |
Fixes: #650
|
|
|
|
|
|
|
|
| |
When the font matrix has uneven scales, we need
to factor that into the slope that we get from
the font metrics.
Tested with a condensed italic Cantarell.
|
|
|
|
|
|
|
|
| |
When we change font scale for emulating small caps,
keep the original font around in the analysis, and use
it for calculating the run height.
Fixes: #622
|
|
|
|
|
|
|
| |
We want to avoid trading chars for hyphens
in the margin beyond the set width.
Fixes: #646
|
|
|
|
|
| |
We don't collapse space at the very end, so we should
count such spaces towards the line width.
|
|
|
|
|
|
|
|
|
| |
We can't break in a tab run.
This fixes an assertion found by afl.
Testcase included.
Fixes: #638
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Don't calculate line width the hard way when
we can do it much easier.
|
|
|
|
|
|
| |
We don't need to iterate the entire tab array
every time, we just continue from the previous
tab stop position.
|
|
|
|
|
| |
We want to optimize access to tab stops,
and will assume they are ordered.
|
|
|
|
| |
Introduce a LastTab struct, and use it.
|
|
|
|
|
|
|
| |
This is useful for PANGO_TAB_DECIMAL.
Implement this in PangoLayout, in the
serializer, and update tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the other tab alignments by adjusting
the tab width as we go.
Based on an old patch by Itai Bar-Haim.
This also includes a fix for the previously
supported left tab alignment in the presence
of indent.
Fixes: #34
|
|
|
|
|
| |
Explain that tabs really only work with
PANGO_ALIGN_LEFT.
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
We can only use the width of the previous char
if we are not at the first char. Found by asan.
|
|
|
|
|
| |
The alternative is random test failures, now
that we check all these fields in test-layout.
|
|
|
|
|
|
|
| |
When handling items that fix completely,
we were not consistently taking extra width
into account, leading to hyphens sticking
out in some cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
In some cases, we were forgetting to account
for the width of a hyphen.
|