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.
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 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
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.