Subject: bug#20173: 24.4; Rendering misallocates combining marks on ligatures

From: Eli Zaretskii <[email-masked]>
Date: Tue, 24 Mar 2015 19:03:38 +0200

> Date: Tue, 24 Mar 2015 08:28:28 +0000
> From: Richard Wordingham <[email-masked]>
> Cc: [email-masked]
> 
> On Tue, 24 Mar 2015 05:42:18 +0200
> Eli Zaretskii <[email-masked]> wrote:
> 
> > If the setting of composition
> > rules for Arabic is not the culprit, then what is?  AFAIK, there are
> > no rules that guide Emacs's shaping except what's in
> > composition-function-table.  Beyond that, the only other factor is the
> > font backend and how it shapes glyphs given the chunks of text Emacs
> > presents to it.
> 
> The font backend on Unixy systems consists of three components - m17n
> (shaping control), libotf (OTL look-up implementation) and Freetype
> (glyph rendering).  The glue between them is in Emacs,
> most relevantly in function ftfont_drive_otf() in ftfont.c.
> 
> My analysis of the problem, which could quite easily be wrong, is as
> follows.  To control the positioning of marks for the mark2ligature
> lookup, it is necessary to record in some fashion which component of
> the ligature a mark applies to.  I cannot see this information being
> stored.  The information should be generated and used by libotf, but
> needs to be stored between callbacks of ftfont_drive_otf() by m17n.
> (The initial settings are implicit in the sequence of codepoints.)
> Storing this information would, so far as I can see, require a change to
> ftfont_drive_otf().

So this means that on Windows this problem does not exist?

> You might want to first check whether composed Arabic is
> usable. Doesn't making each word a grapheme cluster makes editing
> unpleasant?

I don't know; I don't speak or write any of the languages that use the
Arabic script.  I expect the users that do to come up and ask for
features they miss.  We already allow deletion of single codepoints,
even when they are composed; we might as well provide similar features
for movement or whatever.  But the requests (and, perhaps, even the
code) should come from people who actually use these scripts,
otherwise it's a sure way to white elephants and other similar
creatures.

Thanks.