emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supporting stylistic sets


From: Eli Zaretskii
Subject: Re: Supporting stylistic sets
Date: Sat, 24 Sep 2022 09:55:25 +0300

> From: समीर सिंह Sameer Singh <lumarzeli30@gmail.com>
> Date: Sat, 24 Sep 2022 10:13:47 +0530
> Cc: emacs-devel@gnu.org
> 
>  That means all text that uses the font will use that stylistic-set.
>  Is that good enough?  What if you want to have the same font with and
>  without a specific stylistic-set in the same document?.
> 
> Isn't the point of stylistic-set is that if you don't like a particular glyph 
> of a font you can interchange it for
> another, therefore I don't
> see why someone would have the same font with and without the stylistic-set 
> in the same document.

You are thinking about one particular use case.  There might be
others.

> For example: Tiro Bangla had set the stylistic set because the users could 
> not agree how the হ্+ন and হ্+ণ
> conjuncts should look[1].
> It is the case for FiraCode too, simple variations of glyphs which the user 
> can switch out according to their
> preference.

If we want to support the use case of "just change the appearance of a
particular character", then a much simpler implementation would be to
use the existing character-composition machinery.  Specifically:

  . add a suitable entry to composition-function-table, with a regexp
    that matches the characters you want to affect
  . provide a new variable that can be used to specify which, if any,
    stylistic feature to use for each character (this could be a
    char-table, for example)
  . modify hbfont_shape to consult the above variable and apply the
    requested features to the affected character(s)

Btw, is it always the case that, when using a particular font, users
will want to apply the same stylistic-set feature to all of the
characters from the font that have alternative glyphs?  If not, then
font-level feature sets are not going to solve that, and we will need
to be able to specify this for each character individually.

>  And if the font is not the default face's font, it means you need to
>  setup a special face for using it anyway.
> 
> You mean for scripts like Bangla, Devanagari etc?
> For them defining their font-spec wouldn't work?

I meant that the way to use a special font in Emacs, for ASCII
characters, is to define a special face that uses that font.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]