| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
When we are uninserting a hyphen run, we need
to undo the modifications of the item we split
it off from.
|
|
|
|
|
|
| |
We were sometimes adding a hyphen width when the
break we were taking did not actually require a
hyphen, causing us to break prematurely.
|
|\
| |
| |
| |
| | |
Tailor break
See merge request GNOME/pango!86
|
| |
| |
| |
| |
| |
| | |
Call pango_default_break on the entire text,
and then pango_tailor_break on segments with
homogeneous language and script.
|
|/
|
|
|
| |
We use them in a loop. Don't free them before
the loop is done.
|
|
|
|
|
| |
insert_run (... TRUE) frees the need_hyphen array,
so we need to check for the hyphen beforehand.
|
|
|
|
|
|
|
|
|
|
|
| |
Point the item that we create for the inserted hyphen
at the SHY in the paragraph text, shortening the previous
run by one character.
It would be nicer to not insert an extra run at all
and just reshape the previous one in a way that maps
the SHY to a hyphen, but that is more difficult to do
as long as we are going through the shape engine API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had some sad cases where we used a char offset
as a byte index, with the expected bad results once
there are multibyte characters in the mix.
Instead of poking at the text in the middle of
line-breaking, go back to keeping a plain array
of positions that need a hyphen inserted. We
maintain this array in parallel to the existing
log_widths array, so hopefully the offset math
is working out now.
It is tempting to look at log_attrs.is_white for this,
but that gives us double hyphens when breaks are taken
at explicit hyphens. So, keep this information separately.
|
|
|
|
|
| |
We had a boolean member in ParaBreakState that
was used as an int. Oops
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Don't pass font_features attributes into the itemize
run, since we don't need to break runs for this.
Split them off, and reapply them after itemization.
We rapply them before line breaking, since we want
them to affect the shaping.
Closes: https://gitlab.gnome.org/GNOME/pango/issues/242
|
|
|
|
|
|
| |
We already count foreground and background color
as no-shape attributes, so it makes sense to
treat alpha the same.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Remove lang engine use
See merge request GNOME/pango!73
|
| |
| |
| |
| |
| | |
Drop all internal use of language engines.
The lang_engine field in PangoAnalysis is now unused.
|
| |
| |
| |
| |
| | |
Instead, look at the pre- and post-break
text to figure out what is needed.
|
|/
|
|
| |
Move things into some helper functions.
|
|
|
|
|
| |
When we take a break at a soft hyphen, insert
a visible hyphen.
|
|
|
|
| |
Make a new image for layout parameters.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If line-spacing is set to a non-zero value,
we place lines so that
baseline2 = baseline1 + line-spacing * height2
where height2 is the line height of the
second line. In this case, we ignore
spacing.
If line-spacing is set to zero, spacing
is applied as before.
|
|
|
|
| |
Add a getter for the line height of a layout line.
|
|
|
|
|
|
|
| |
Make it clear that all text input must be valid UTF-8,
except in the case pango_layout_set_text, which we now
officially document as accepting and handling invalid
input.
|
|
|
|
|
|
|
| |
PangoDirection is still used in some public apis,
so just keep it around.
Closes: #339
|
|
|
|
|
| |
It should have been included in
feff5a6e2682048a07a6ba09af83254e290bf394 .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The baseline is the baseline of the first line of text in the layout, so
we can simply _get_extents_internal and use the extents of the first
line we get from that.
This is not a perfect solution (e.g. gtk+ calls pango_layout_get_extents
before a pango_layout_get_baseline call and the former calls
get_extents_internal anyway, so we compute the extents twice...) but it
improves the situation pointed out by the comment in
pango_layout_get_baseline.
https://bugzilla.gnome.org/show_bug.cgi?id=788643
|
|
|
|
|
|
|
|
| |
Since PangoLayout caches the amount of lines it contains in
->line_count, we can use this to pre-allocate an Extents array of the
appropriate size.
https://bugzilla.gnome.org/show_bug.cgi?id=788643
|
|
|
|
|
|
|
| |
Use the new _pango_layout_get_iter and _pango_layout_iter_destroy
instead.
https://bugzilla.gnome.org/show_bug.cgi?id=788643
|
|
|
|
|
|
|
| |
And add _pango_layout_get_iter as well as _pango_layout_iter_destroy
that can be used for internal, stack allocated PangoLayoutIters.
https://bugzilla.gnome.org/show_bug.cgi?id=788643
|
|
|
|
|
| |
The compiler complains that rightmost_space may be used
uninitialized. And it may be right.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In pango_layout_index_to_pos(), it looks like layout_line could be
dereferenced while still NULL in the first loop iteration. This is not
the case, as other bits of PangoLayout ensure its start_index is always
0, so this branch is never taken. Add an assertion to clarify that and
guide static analysis.
Coverity ID: 1391700
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=778656
|
|
|
|
|
| |
It was referring to itself for further description, but I assume the
intent was to refer to pango_layout_line_x_to_index().
|
|
|
|
|
|
| |
Much better now.
Now I see issues in justify_words() again :(.
|
| |
|
|
|
|
| |
Was totally b0rked. Much better now. Should be good enough...
|
|
|
|
|
|
|
| |
Bug 753772 - Justify option inserts spaces in wrong positions
https://bugzilla.gnome.org/show_bug.cgi?id=753772
Went unnoticed for 8 years...
|
|
|
|
| |
Ouch!
|
|
|
|
|
| |
Instead of relying on the fact that marks have the same cluster number
as their bases, which will change in the next commit.
|
|
|
|
|
|
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=738505
Patch from Matthias Clasen, based on early patch from Akira TAGOH.
There's room for improvement in how this is done, but it works now
for simple cases, which is what most people will be using it for.
Finally!
|
| |
|
| |
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=748822
https://bugzilla.gnome.org/show_bug.cgi?id=744836
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=731022
|
|
|
|
| |
This reverts commit 19a252d9a3d63e7816f9a77bab65bd161675440a.
|
| |
|
|
|
|
| |
Untested.
|
|
|
|
| |
Patch from Rafał Mużyło.
|
|
|
|
|
|
| |
The annotation for pango_layout_set_attributes should be
'transfer none', not 'transfer full'. Pointed out in
https://bugzilla.gnome.org/show_bug.cgi?id=707874
|
|
|
|
|
|
|
|
|
|
|
| |
layouts get initialized with text == NULL as an optimization (avoid a
malloc). But pango_layout_set_text (layout, NULL, 0); will set the text
to "", so it is impossible to set a NULL text.
Fxies crashers in various places that assume NULL return values never
happen.
https://bugzilla.gnome.org/show_bug.cgi?id=707659
|