all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Ouellet-payeur <nicolaso@google.com>
To: "समीर सिंह Sameer Singh" <lumarzeli30@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Supporting stylistic sets
Date: Fri, 23 Sep 2022 13:31:30 -0400	[thread overview]
Message-ID: <CADuLPF5Qc2_2pDjzKndn_f8i41SWkYuCV4L7EYCr4uCEueB7Ww@mail.gmail.com> (raw)
In-Reply-To: <CAOR1sLzdAphPzBoT7V4A+i+-Srfa4f1CcU63ROcOOudipBfjUg@mail.gmail.com>

> How did you envision this font property to be used in Emacs?
>
> The etc/TODO item for that suggests to implement this as a text
> property instead.  That is, of course, not carved in stone, but I
> think we should in any case decide on how this will be used from Lisp
> before we talk about how to expose it to Lisp.

Personally, I think a font property is easier to configure. I can use
customize or set-face-attribute to set how I want a font to look.
Ideally, I would like to do something like this:

  (set-face-attribute
   'default nil
   :stylistic-sets '("cv01" "cv02" "cv03"))

This uses my chosen stylistic sets everywhere with a single line of
Lisp. If I don't like having it *everywhere* (e.g. minibuffer,
mode-line), I can still set it separately for each face.

With a text property, I'd have to hook into everything that displays
text, somehow, and add the text property there.

> Thanks.  We have a TODO item for that, please see it.

Also, while we're on this topic: I'm working on a patch to pass *all*
strings/buffer contents to hbfont_shape() during redisplay, and making
all text a composition. That way we could have stylistic sets for Latin
scripts as well (and most other scripts), not just "composed" scripts
like Bengali and Arabic. It'd also achieve "Support ligatures out of the
box" from etc/TODO, by giving HarfBuzz the means to shape text properly.

This would be nice for fonts like Fira Code [1], which has both
ligatures and stylistic sets.

My patch is very experimental (i.e. hacky) at this point though, and it
crashes all the time. I don't want to derail this discussion, so I'll
share my work in another thread once it stops crashing so much.

[1] https://github.com/tonsky/FiraCode

On Fri, Sep 23, 2022 at 1:29 PM समीर सिंह Sameer Singh
<lumarzeli30@gmail.com> wrote:
>>
>> > I was trying to add stylistic sets in Emacs.
>>
>> Thanks.  We have a TODO item for that, please see it.
>
>
> Yes I had read it and also the mailing list discussion linked there.
>
>> How did you envision this font property to be used in Emacs?
>>
>> The etc/TODO item for that suggests to implement this as a text
>> property instead.  That is, of course, not carved in stone, but I
>> think we should in any case decide on how this will be used from Lisp
>> before we talk about how to expose it to Lisp.
>
>
> I imagined that it would be something like this:
>
>
>   (set-fontset-font t 'bengali
>    (font-spec :family "Tiro Bangla"
>       :stylistic-set '("ss03")))
>
>
>   (set-face-attribute 'default nil
>      :font "Fira Code"
>      :weight 'regular
>      :height 170
>      :stylistic-set '("cv01" "ss05" "ss03"))
>
> Just like how weight, foundry, size etc are set and they seem to be font properties.
>
> On Fri, Sep 23, 2022 at 9:07 PM Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> > From: समीर सिंह Sameer Singh
>> >  <lumarzeli30@gmail.com>
>> > Date: Fri, 23 Sep 2022 18:24:48 +0530
>> >
>> > I was trying to add stylistic sets in Emacs.
>>
>> Thanks.  We have a TODO item for that, please see it.
>>
>> > I was able to successfully able to switch to a different set of a Bengali font by hardcoding it  to the hbfont.c
>> > file, but that is obviously not a solution.
>> >
>> > Should I try adding a new font property name "stylistic-set" which would accept a list of values for a font. If so
>> > could I get some pointers on how to add a new font property to emacs.
>>
>> How did you envision this font property to be used in Emacs?
>>
>> The etc/TODO item for that suggests to implement this as a text
>> property instead.  That is, of course, not carved in stone, but I
>> think we should in any case decide on how this will be used from Lisp
>> before we talk about how to expose it to Lisp.



  reply	other threads:[~2022-09-23 17:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 12:54 Supporting stylistic sets समीर सिंह Sameer Singh
2022-09-23 15:37 ` Eli Zaretskii
2022-09-23 17:27   ` समीर सिंह Sameer Singh
2022-09-23 17:31     ` Nicolas Ouellet-payeur [this message]
2022-09-23 18:09       ` Eli Zaretskii
2022-09-23 19:20         ` Nicolas Ouellet-payeur
2022-09-23 20:10           ` Eli Zaretskii
     [not found]             ` <CADuLPF5sKi4NMcGSdy1GAi8=KHBfUcVa3tV=XwnhPfWxroAJCA@mail.gmail.com>
2022-09-26 17:07               ` Eli Zaretskii
2022-09-26 17:46                 ` Nicolas Ouellet-payeur
2022-09-26 18:28                   ` Eli Zaretskii
2022-09-26 19:06                     ` Yuri Khan
2022-09-26 19:20                       ` Eli Zaretskii
2022-09-23 17:55     ` Eli Zaretskii
2022-09-23 18:26       ` Visuwesh
2022-09-23 18:55         ` Eli Zaretskii
2022-09-24  4:59           ` Visuwesh
2022-09-24  6:33             ` Eli Zaretskii
2022-09-24  8:42               ` Visuwesh
2022-09-24  4:43       ` समीर सिंह Sameer Singh
2022-09-24  6:55         ` Eli Zaretskii
2022-09-24  8:00           ` समीर सिंह Sameer Singh
2022-09-24  8:27             ` Eli Zaretskii
2022-09-24  8:34               ` समीर सिंह Sameer Singh
2022-09-24  8:38                 ` Eli Zaretskii
2022-09-24  8:41                   ` समीर सिंह Sameer Singh
2022-09-24  8:50                   ` समीर सिंह Sameer Singh
2022-09-24 12:09                     ` समीर सिंह Sameer Singh
2022-09-24 12:35                       ` Eli Zaretskii
2022-09-24 12:45                         ` समीर सिंह Sameer Singh
2022-09-24 13:00                           ` Eli Zaretskii
2022-09-24 13:10                             ` समीर सिंह Sameer Singh
2022-09-24 14:18                               ` Eli Zaretskii
2022-09-24 14:26                                 ` समीर सिंह Sameer Singh
2022-09-24 15:01                                   ` Eli Zaretskii
2022-09-24 15:02                                     ` समीर सिंह Sameer Singh
2022-09-24 15:21                                       ` Eli Zaretskii
2022-09-24 15:50                                         ` समीर सिंह Sameer Singh
2022-09-24 16:14                                           ` Eli Zaretskii
2022-09-24 16:42                                             ` Yuri Khan
2022-09-24 17:02                                               ` Eli Zaretskii
2022-09-24 17:09                                             ` समीर सिंह Sameer Singh
2022-09-24 17:11                                               ` समीर सिंह Sameer Singh
2022-09-25 22:19                                             ` Clément Pit-Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADuLPF5Qc2_2pDjzKndn_f8i41SWkYuCV4L7EYCr4uCEueB7Ww@mail.gmail.com \
    --to=nicolaso@google.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lumarzeli30@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.