| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
| |
The COMMON characters like symbol only line don't need hyphen.
|
|
|
|
|
| |
Some languages like CJK languages,
usually don't use the hyphen character.
|
|
|
|
|
|
|
| |
Fix an oversight in the calculation of log
attributes. This was showing up as allow-breaks
attributes being applied to the wrong ranges
in later runs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we are splitting attributes into those that
are relevant for itemization and shaping, we need to
make sure to pass the right ones along when ellipsizing,
or we risk picking a wildly mismatching font for the
ellipsis run, causing things to shift vertically.
Test included.
Closes: https://gitlab.gnome.org/GNOME/pango/issues/397
Thanks to Jorge Luis Martinez Gomez for his help
in tracking this down.
|
|
|
|
|
|
|
|
|
| |
Add a text attribute that allows to suppress
insertion of hyphens at intra-word line breaks.
This is useful for non-paragraph-like contexts,
where line breaks are needed, but hyphens are not
expected.
|
|
|
|
|
| |
Take the glyph rounding option from PangoContext
and translate it into a shape flag.
|
|
|
|
|
|
|
|
|
| |
Default the new line-spacing property to 0, so
spacing continues to work. Applications can opt
in to the new line-spacing behavior by setting
a non-zero value.
This should make spacing in the Gimp work again.
|
|
|
|
|
|
|
|
|
| |
We were inserting hyphens after spaces, and in
some other places where they are not desirable.
Fix this by looking at the characters on both
sides of the break when deciding whether to
insert a hyphen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't zero out a line separator at the end of line
if we turned it into an unknown glyph to render
it.
And if we zero out whitespace at the end of the line,
make sure we don't draw anything there by setting
the glyph to EMPTY.
Without this, we are getting the [LS] hex box
rendered on top of the last character in a line,
when the line separator ends up being visible.
|
|
|
|
|
|
| |
When the 'show space' attribute is present,
arrange for tab characters to be passed on
to the rendering layer as non-empty.
|
|
|
|
|
| |
Use an attribute to show line breaks in
single-paragraph mode.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of filtering out the attributes we don't
want to influence itemization, explicitly filter
only those attributes that we want to affect itemization.
This makes us no longer break items for custom
attributes, such as GtkTextAppearance attributes
that are created by GtkTextLayout.
Update expected output for layout testcases.
|
|
|
|
|
|
|
| |
What I called no_break_attrs are really
no_itemize_attrs - some of them explicitly
influence line breaking. So fix the misleading
naming and call them what they are.
|
| |
|
| |
|
|
|
|
| |
This is necessary to interpret the attributes.
|
|
|
|
|
|
| |
Look for whether the char before the break
is not whitespace and doesn't look like a
hyphen.
|
|
|
|
|
|
|
|
|
| |
Instead, reshape the pre-break run with the
soft hyphen replaced by an actual hyphen.
This is unfortunately inefficient, we copy
the entire text for this. The alternative
(scatter-gather populating the harfbuzz
buffer) is too hard to manage.
|
|
|
|
| |
These are clang warnings.
|
|
|
|
|
|
| |
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.
|