From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?4KS44KSu4KWA4KSwIOCkuOCkv+CkguCkuSBTYW1lZXIgU2luZ2g=?= Newsgroups: gmane.emacs.devel Subject: Re: Supporting stylistic sets Date: Sat, 24 Sep 2022 13:30:00 +0530 Message-ID: References: <83wn9up0es.fsf@gnu.org> <83illeou0j.fsf@gnu.org> <83r101ntwi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001c92af05e967afdd" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20088"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 24 10:03:12 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oc080-00051S-CN for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Sep 2022 10:03:12 +0200 Original-Received: from localhost ([::1]:45346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oc07y-0002I8-TL for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Sep 2022 04:03:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oc05A-0000u8-Iz for emacs-devel@gnu.org; Sat, 24 Sep 2022 04:00:16 -0400 Original-Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]:43652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oc058-0003ZS-1P; Sat, 24 Sep 2022 04:00:16 -0400 Original-Received: by mail-yb1-xb2d.google.com with SMTP id e187so2503201ybh.10; Sat, 24 Sep 2022 01:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Pn9PkLlHqK+06yNpt1+FvXUg+65A+7UIW+itw9/5l5U=; b=Dup/SabvzTSRfMk/lUenXDWwh1Lc7YK5SM+Uof91uISetNstq7qjWn6NCOGMweHiZD TkU/Yj5/x0LEjtFb3C5n3yI0mTqi7vwPEf3u/TnTZLKk/zZTqgwNfVaaXCx+aK72htHg DzXrjp0aOpE6Yz/tuDJXio6dv1b+FJpc8kJy/H2CXuJEfFUld4JlhL96Uu9wH97GPQqT CImuQnK7mNuhVy66ARxGI8lbsT3799HGzDFvzrtjd6ZpWkgMJsKSc3stY9xC3PDrSmdk D9Cv1MHlM+FEH4snGOo61hvN7w9COzr3AGREBIew8Cw+diWu35isGyn5rbcGEOLTCqIs GvRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Pn9PkLlHqK+06yNpt1+FvXUg+65A+7UIW+itw9/5l5U=; b=SQPmN1VaGO948+P3AX3MZuluzaikuCr/DBgSlIfWGCh5Kx7jhMPHmAV/AkeblSrHhc GxoHyfWfMjcQlU10fUgog4xStA3q5dVY3e0kx/11XjAizffoUJuxWCuSDgeeqKTo853N DVK0lGRu0z9KWs6F1C6Isy92egvPRsk00CwzwwUY+Bxe+AOiEnVlJmRaVNzXyTD9SXd1 08xvdhlaKnmbzqcxIzE/t3/19jLEqk42+hRyWoQPB1vuIls5Ub9ZPM0maLoadNZnJyzw u915gi6x6rU1g8iXoVQOCGMea5tBBVUwBIqTy3LT+/WI1s8kIu2BP5HbxqREE01iX/ee dncQ== X-Gm-Message-State: ACrzQf3FJ8KhagMaJbYMOsTF+eUxY+b+FWD4QdHwQTD0h3/oPv4nuDgi XPwB4CRYKfJPF6lYP3pyX6xaILyYQX6AzpV7Y6UD1OBZbac2gM7o X-Google-Smtp-Source: AMsMyM5oj45OsdSrow87SVZjiNWfJjSTIXj3MfMBN1P2GQie4ZNBsiAZyX+ymFVxVioxjT3NgiJ+8ld4q0fHIqxAMbQ= X-Received: by 2002:a05:6902:13c7:b0:695:84d9:c5da with SMTP id y7-20020a05690213c700b0069584d9c5damr13070767ybu.650.1664006412340; Sat, 24 Sep 2022 01:00:12 -0700 (PDT) In-Reply-To: <83r101ntwi.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::b2d; envelope-from=lumarzeli30@gmail.com; helo=mail-yb1-xb2d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296127 Archived-At: --0000000000001c92af05e967afdd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > You are thinking about one particular use case. There might be > others. What might be the other use cases? 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. > There are different stylistic-set features for different glyphs. For example in FiraCode to change "a" there is cv01, for "g" cv02 etc. or am I misunderstanding the question? (most likely) On Sat, Sep 24, 2022 at 12:25 PM Eli Zaretskii wrote: > > From: =E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0 =E0=A4=B8=E0=A4=BF=E0=A4=82= =E0=A4=B9 Sameer Singh > > 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 =E0=A6=B9=E0=A7=8D+=E0=A6=A8 and =E0=A6=B9=E0=A7= =8D+=E0=A6=A3 > > 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. > --0000000000001c92af05e967afdd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You are = thinking about one particular use case.=C2=A0 There might be
others.

What might be the other use cases?= =C2=A0



There are differ= ent stylistic-set features for different glyphs.
For example in F= iraCode to change "a" there is cv01, for "g" cv02 etc.<= /div>
or am I misunderstanding the question? (most likely)

On= Sat, Sep 24, 2022 at 12:25 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: =E0=A4=B8=E0=A4=AE=E0=A5=80=E0=A4=B0 =E0=A4=B8= =E0=A4=BF=E0=A4=82=E0=A4=B9 Sameer Singh <lumarzeli30@gmail.com>
> Date: Sat, 24 Sep 2022 10:13:47 +0530
> Cc: emacs-dev= el@gnu.org
>
>=C2=A0 That means all text that uses the font will use that stylistic-s= et.
>=C2=A0 Is that good enough?=C2=A0 What if you want to have the same fon= t with and
>=C2=A0 without a specific stylistic-set in the same document?.
>
> Isn't the point of stylistic-set is that if you don't like a p= articular 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 stylisti= c-set in the same document.

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

> For example: Tiro Bangla had set the stylistic set because the users c= ould not agree how the =E0=A6=B9=E0=A7=8D+=E0=A6=A8 and =E0=A6=B9=E0=A7=8D+= =E0=A6=A3
> 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<= br> use the existing character-composition machinery.=C2=A0 Specifically:

=C2=A0 . add a suitable entry to composition-function-table, with a regexp<= br> =C2=A0 =C2=A0 that matches the characters you want to affect
=C2=A0 . provide a new variable that can be used to specify which, if any,<= br> =C2=A0 =C2=A0 stylistic feature to use for each character (this could be a<= br> =C2=A0 =C2=A0 char-table, for example)
=C2=A0 . modify hbfont_shape to consult the above variable and apply the =C2=A0 =C2=A0 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?=C2=A0 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.

>=C2=A0 And if the font is not the default face's font, it means you= need to
>=C2=A0 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.
--0000000000001c92af05e967afdd--