Subject: bug#79285: [Patch] support :font-features in face

From: Eli Zaretskii <[email-masked]>
Date: Sun, 31 Aug 2025 12:25:32 +0300

> Cc: [email-masked]
> Date: Sun, 31 Aug 2025 12:08:18 +0300
> From: Eli Zaretskii <[email-masked]>
> 
> > From: Binbin YE <[email-masked]>
> > Date: Sun, 31 Aug 2025 11:42:50 +0900
> > Cc: [email-masked]
> > 
> > Thanks for the review and explanation, I addressed the issues you brought up and it should be ready for the
> > next round.
> 
> Thanks, see further comments below.

One more comment: did you try this code with text that we normally
don't pass to the shaping engine to display, like plain-ASCII text?
Emacs normally calls the shaping engine only for characters whose
slots in composition-function-table are non-nil.  Otherwise we display
the font glyphs directly without shaping.  (This is an optimization:
using the shaping engine slows down redisplay, because it is
implemented by calling to Lisp, which then calls back into C.)  So,
for example, if someone places a face with :font-features attribute on
plain-ASCII text, they will probably not see any effect.

If I'm right, then we will need to make changes in display-engine
functions like composition_compute_stop_pos, composition_reseat_it,
find_composition, and others, to force the text which has such a face
attribute to be handed to HarfBuzz for shaping.  An alternative is to
require that use of this face attribute needs special setup of
composition-function-table, but that is IMO worse because it will slow
down display of the relevant characters even if they don't have the
face with this attribute.