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.
1. Install pango-graphite and Dai Banna SIL Book
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.
I suspect assertions would fail even in very old builds.
The cursor behavior is a regression since 2010-10-14.
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
However, I think it is a bug in our code to rely on specific behavior from
pango_break, and we should fix that.
Created attachment 495735 [details] [diff] [review]
ignore is_cursor_position for the position before the first character
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)?
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).
This code was removed in bug 703100.