* Q: Custom fontsets and using a non-default fontset
@ 2024-09-02 20:49 Soham Gumaste
2024-09-03 12:18 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Soham Gumaste @ 2024-09-02 20:49 UTC (permalink / raw)
To: emacs-devel
Hello,
Recently I got too curious for my own good while messing with emacs
(as one does) and discovered fontsets and transparent usage of
multiple fonts for different unicode points/scripts/ranges.
I discovered this [1] reply by Eli about *not* messing with creating
your own fontset and rather just using the default "fontset-default".
I did notice I am unable to set my own fontset as the default or the
one in use as given by the frame-parameter 'font.
How do I learn more about emacs fontsets? Is support for user defined
fontsets something thats in the works, or is it just an internal API?
The reply in [1] is around 6y old which is why I am curious about the
current state of this. A use-case I have in mind is switching to a
non-programmer fontset for presenting Org mode documents with
org-present.
[1]: https://www.reddit.com/r/emacs/comments/9l3n3y/comment/e750a2x/
Thanks
--
Soham Gumaste
sohamg2@gmail.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-02 20:49 Q: Custom fontsets and using a non-default fontset Soham Gumaste
@ 2024-09-03 12:18 ` Eli Zaretskii
2024-09-03 14:00 ` Ship Mints
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-03 12:18 UTC (permalink / raw)
To: Soham Gumaste; +Cc: emacs-devel
> From: Soham Gumaste <sohamg2@gmail.com>
> Date: Mon, 2 Sep 2024 15:49:41 -0500
>
> Recently I got too curious for my own good while messing with emacs
> (as one does) and discovered fontsets and transparent usage of
> multiple fonts for different unicode points/scripts/ranges.
>
> I discovered this [1] reply by Eli about *not* messing with creating
> your own fontset and rather just using the default "fontset-default".
I wrote that for the case that the user wants to customize the fonts
Emacs choses for different scripts. In that case, customizing the
default font is the best alternative.
> I did notice I am unable to set my own fontset as the default or the
> one in use as given by the frame-parameter 'font.
If you tried to use the fontset you created as the 'font' parameter of
a frame, please show the simplest test case to reproduce this
(preferably as a bug report), and let's take it from there. It should
work, but without knowing what you tried and how it failed, it is
impossible to answer your questions intelligently.
> How do I learn more about emacs fontsets?
It depends on what you want to learn. Assuming you already read what
we have about fontsets in the Emacs user manual and in the ELisp
reference manual, further info is only in the sources, I'm afraid.
> Is support for user defined
> fontsets something thats in the works, or is it just an internal API?
It is a working API that should just work.
> The reply in [1] is around 6y old which is why I am curious about the
> current state of this. A use-case I have in mind is switching to a
> non-programmer fontset for presenting Org mode documents with
> org-present.
Fontsets were added to Emacs a long time ago, much longer than 6
years, so I don't think there were any significant changes.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-03 12:18 ` Eli Zaretskii
@ 2024-09-03 14:00 ` Ship Mints
2024-09-03 17:50 ` Soham Gumaste
0 siblings, 1 reply; 7+ messages in thread
From: Ship Mints @ 2024-09-03 14:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Soham Gumaste, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]
Yuan Fu wrote about fontsets on his blog and this article might be helpful:
https://archive.casouri.cc/note/2021/fontset/
On Tue, Sep 3, 2024 at 8:19 AM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Soham Gumaste <sohamg2@gmail.com>
> > Date: Mon, 2 Sep 2024 15:49:41 -0500
> >
> > Recently I got too curious for my own good while messing with emacs
> > (as one does) and discovered fontsets and transparent usage of
> > multiple fonts for different unicode points/scripts/ranges.
> >
> > I discovered this [1] reply by Eli about *not* messing with creating
> > your own fontset and rather just using the default "fontset-default".
>
> I wrote that for the case that the user wants to customize the fonts
> Emacs choses for different scripts. In that case, customizing the
> default font is the best alternative.
>
> > I did notice I am unable to set my own fontset as the default or the
> > one in use as given by the frame-parameter 'font.
>
> If you tried to use the fontset you created as the 'font' parameter of
> a frame, please show the simplest test case to reproduce this
> (preferably as a bug report), and let's take it from there. It should
> work, but without knowing what you tried and how it failed, it is
> impossible to answer your questions intelligently.
>
> > How do I learn more about emacs fontsets?
>
> It depends on what you want to learn. Assuming you already read what
> we have about fontsets in the Emacs user manual and in the ELisp
> reference manual, further info is only in the sources, I'm afraid.
>
> > Is support for user defined
> > fontsets something thats in the works, or is it just an internal API?
>
> It is a working API that should just work.
>
> > The reply in [1] is around 6y old which is why I am curious about the
> > current state of this. A use-case I have in mind is switching to a
> > non-programmer fontset for presenting Org mode documents with
> > org-present.
>
> Fontsets were added to Emacs a long time ago, much longer than 6
> years, so I don't think there were any significant changes.
>
>
[-- Attachment #2: Type: text/html, Size: 2874 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-03 14:00 ` Ship Mints
@ 2024-09-03 17:50 ` Soham Gumaste
2024-09-04 11:16 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Soham Gumaste @ 2024-09-03 17:50 UTC (permalink / raw)
To: Ship Mints; +Cc: Eli Zaretskii, emacs-devel
Thanks for the reply, Eli!
>
> On Tue, Sep 3, 2024 at 8:19 AM Eli Zaretskii <eliz@gnu.org> wrote:
>>
>>
>> > I did notice I am unable to set my own fontset as the default or the
>> > one in use as given by the frame-parameter 'font.
>>
>> If you tried to use the fontset you created as the 'font' parameter of
>> a frame, please show the simplest test case to reproduce this
>> (preferably as a bug report), and let's take it from there. It should
>> work, but without knowing what you tried and how it failed, it is
>> impossible to answer your questions intelligently.
>>
I used this [1] as init.el and ran `emacs --init-directory=.`. I
checked the frame font with (frame-parameter nil 'font) and the output
was NOT "fontset-mine" but rather a XLFD string representing the ascii
font I chose. My 'emoji script font worked. Please let me know if this
is a bug report or an error in my expectation of the output.
[1]:
(create-fontset-from-fontset-spec
(font-xlfd-name
(font-spec
:name "Fira Code" :height 130 :weight 'medium
:registry "fontset-mine")))
(set-fontset-font "fontset-mine" 'emoji
(font-spec :family "Noto Color Emoji" :foundry "NONE"))
(setq default-frame-alist '((font . "fontset-mine")))
Thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-03 17:50 ` Soham Gumaste
@ 2024-09-04 11:16 ` Eli Zaretskii
2024-09-08 3:44 ` Yuan Fu
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-04 11:16 UTC (permalink / raw)
To: Soham Gumaste; +Cc: shipmints, emacs-devel
> From: Soham Gumaste <sohamg2@gmail.com>
> Date: Tue, 3 Sep 2024 12:50:29 -0500
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>
> I used this [1] as init.el and ran `emacs --init-directory=.`. I
> checked the frame font with (frame-parameter nil 'font) and the output
> was NOT "fontset-mine" but rather a XLFD string representing the ascii
> font I chose. My 'emoji script font worked. Please let me know if this
> is a bug report or an error in my expectation of the output.
>
> [1]:
> (create-fontset-from-fontset-spec
> (font-xlfd-name
> (font-spec
> :name "Fira Code" :height 130 :weight 'medium
> :registry "fontset-mine")))
>
> (set-fontset-font "fontset-mine" 'emoji
> (font-spec :family "Noto Color Emoji" :foundry "NONE"))
>
> (setq default-frame-alist '((font . "fontset-mine")))
What you see is the expected behavior. That's what setting a frame's
'font' parameter does when the value is a fontset.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-04 11:16 ` Eli Zaretskii
@ 2024-09-08 3:44 ` Yuan Fu
2024-09-08 4:48 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Yuan Fu @ 2024-09-08 3:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Soham Gumaste, shipmints, emacs-devel
> On Sep 4, 2024, at 4:16 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Soham Gumaste <sohamg2@gmail.com>
>> Date: Tue, 3 Sep 2024 12:50:29 -0500
>> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>>
>> I used this [1] as init.el and ran `emacs --init-directory=.`. I
>> checked the frame font with (frame-parameter nil 'font) and the output
>> was NOT "fontset-mine" but rather a XLFD string representing the ascii
>> font I chose. My 'emoji script font worked. Please let me know if this
>> is a bug report or an error in my expectation of the output.
>>
>> [1]:
>> (create-fontset-from-fontset-spec
>> (font-xlfd-name
>> (font-spec
>> :name "Fira Code" :height 130 :weight 'medium
>> :registry "fontset-mine")))
>>
>> (set-fontset-font "fontset-mine" 'emoji
>> (font-spec :family "Noto Color Emoji" :foundry "NONE"))
>>
>> (setq default-frame-alist '((font . "fontset-mine")))
>
> What you see is the expected behavior. That's what setting a frame's
> 'font' parameter does when the value is a fontset.
You need to use the (undocumented) :fontset keyword. Also the :fontset keyword doesn’t work for ‘default face. You need to use (set-fontset-font "fontset-default" …).
Yuan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Q: Custom fontsets and using a non-default fontset
2024-09-08 3:44 ` Yuan Fu
@ 2024-09-08 4:48 ` Eli Zaretskii
0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-09-08 4:48 UTC (permalink / raw)
To: Yuan Fu; +Cc: sohamg2, shipmints, emacs-devel
> From: Yuan Fu <casouri@gmail.com>
> Date: Sat, 7 Sep 2024 20:44:01 -0700
> Cc: Soham Gumaste <sohamg2@gmail.com>,
> shipmints@gmail.com,
> emacs-devel@gnu.org
>
> >> (create-fontset-from-fontset-spec
> >> (font-xlfd-name
> >> (font-spec
> >> :name "Fira Code" :height 130 :weight 'medium
> >> :registry "fontset-mine")))
> >>
> >> (set-fontset-font "fontset-mine" 'emoji
> >> (font-spec :family "Noto Color Emoji" :foundry "NONE"))
> >>
> >> (setq default-frame-alist '((font . "fontset-mine")))
> >
> > What you see is the expected behavior. That's what setting a frame's
> > 'font' parameter does when the value is a fontset.
>
> You need to use the (undocumented) :fontset keyword.
That's for a face, not for a frame. IOW, it will not affect all the
faces used on a frame, only that single face.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-09-08 4:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 20:49 Q: Custom fontsets and using a non-default fontset Soham Gumaste
2024-09-03 12:18 ` Eli Zaretskii
2024-09-03 14:00 ` Ship Mints
2024-09-03 17:50 ` Soham Gumaste
2024-09-04 11:16 ` Eli Zaretskii
2024-09-08 3:44 ` Yuan Fu
2024-09-08 4:48 ` Eli Zaretskii
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.