"First character must be the start of a cluster ..." assertion failure with pango-graphite

RESOLVED FIXED

Status

()

Core
Layout: Text
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

({regression})

Trunk
x86_64
Linux
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

http://hg.mozilla.org/mozilla-central/annotate/2b44a6a3bfd8/gfx/thebes/gfxFont.cpp#l3917

When pango-graphite is installed, it adds a PangoEngineLang, which changes the
behavior of pango_break.

The behaviour differs enough that it leads to failed assertions that the first
character of a run begins a cluster, and it is not possible to move the cursor
to the beginning of text if Graphite fonts are used.

This is because Graphite's break does not set is_cursor_position for the
position before the first character.

STR:

1. Install pango-graphite and Dai Banna SIL Book
   http://scripts.sil.org/DaiBannaSIL

2. Copy 'ᦎᦷ ᦑᦺ' to the search bar.
   See assertion failures (with debug builds).

3. Try to use arrow keys to move cursor to beginning of the text.
   Fail.
(Assignee)

Comment 1

7 years ago
I suspect assertions would fail even in very old builds.
The cursor behavior is a regression since 2010-10-14.
Keywords: regression
(Assignee)

Comment 2

7 years ago
I'm tempted to blacklist GraphiteEngineLang because it claims support for
multiple scripts, but, for non-graphite fonts (Engine selection is not
font-dependent), it merely runs the basic pango_default_break, overriding
script-specific Engines - and it runs pango_default_break twice.
See graphite_engine_break at
http://scripts.sil.org/svn-public/graphite/graphite/trunk/wrappers/pangographite/silgraphite-break.c

However, I think it is a bug in our code to rely on specific behavior from
pango_break, and we should fix that.
http://hg.mozilla.org/mozilla-central/annotate/2b44a6a3bfd8/gfx/thebes/gfxPangoFonts.cpp#l2571
(Assignee)

Comment 3

7 years ago
Created attachment 495735 [details] [diff] [review]
ignore is_cursor_position for the position before the first character
Assignee: nobody → karlt
Attachment #495735 - Flags: review?(jfkthame)
With the improvements we've made to gfxPlatform::SetupClusterBoundaries() (see bug 553981), do we really still need to be calling pango_break here, or could we remove the static SetupClusterBoundaries function from the gfxPangoFonts.cpp code altogether (thereby resolving both this and bug 614476)?
(Assignee)

Comment 5

6 years ago
We now only call pango_break (this static SetupClusterBoundaries()) when using Pango for shaping.

Pango's indic PangoEngineLangs has some special breaking rules that I assume gfxPlatform::SetupClusterBoundaries() does not handle, and it seems appropriate to use pango_break when using pango_shape (as I assume we do for indic scripts).
(Assignee)

Comment 6

5 years ago
This code was removed in bug 703100.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Attachment #495735 - Flags: review?(jfkthame)
You need to log in before you can comment on or make changes to this bug.