all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
@ 2024-10-12 19:10 Rodrigo Morales
  2024-10-18  6:27 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Rodrigo Morales @ 2024-10-12 19:10 UTC (permalink / raw)
  To: 73777


I am using GNU Emacs 29.4 in Ubuntu 22.04.5 LTS.

Today, I was trying to change the font size for the character =“= (#x201C, LEFT DOUBLE QUOTATION MARK) using the sexp shown below. I noticed an inconsistency: that sexp only sets the size for the character =“= when specific fonts are used.

#+BEGIN_SRC elisp
(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))
#+END_SRC

In the section below, I describe minimal reproducible experiments. In the experiments, I use the file =/tmp/a.txt= containing the contents of the code block below:

#+HEADER: :tangle /tmp/a.txt
#+BEGIN_SRC text
a “ b
#+END_SRC

** Experiment 1 (:size for #x201C is not set): Set :size for #x201C

I started Emacs using the command shown below:

#+HEADER: :eval no
#+BEGIN_SRC sh
./src/emacs -Q /tmp/a.txt
#+END_SRC

The code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.is/9LxOH

#+BEGIN_SRC text
a: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x44)
“: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x209)
b: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x45)
#+END_SRC

Then, I evaluated the sexp shown below. Upon evaluating it, the size of the character “ (#x201C, LEFT DOUBLE QUOTATION MARK) didn't seem to increase. The second code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.ph/rVZSt

#+begin_src elisp
(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))
#+end_src

#+BEGIN_SRC text
a: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x44)
“: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x209)
b: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-16-*-*-*-*-0-iso10646-1 (#x45)
#+END_SRC

** Experiment 2 (:size for #x201C is not set): Pass "Noto Sans Mono 10" to set-frame-font, then set :size for #x201C

I started Emacs using the command shown below:

#+HEADER: :eval no
#+BEGIN_SRC sh
./src/emacs -Q /tmp/a.txt
#+END_SRC

First, I evaluated the sexp shown in the first code block below. The second code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.ph/PVc8q

#+begin_src elisp
(set-frame-font "Noto Sans Mono 10" nil t)
#+end_src

#+BEGIN_SRC text
a: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x44)
“: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x209)
b: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x45)
#+END_SRC

Then, I evaluated the sexp shown below. Upon evaluating it, the size of the character “ (#x201C, LEFT DOUBLE QUOTATION MARK) didn't seem to increase. The second code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.is/AIuP0

#+begin_src elisp
(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))
#+end_src

#+BEGIN_SRC text
a: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x44)
“: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x209)
b: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-15-*-*-*-*-0-iso10646-1 (#x45)
#+END_SRC

** Experiment 3 (:size for #x201C is set): Pass "Fixed 5" to set-frame-font, then set :family and :size for #x201C

I started Emacs using the command shown below:

#+HEADER: :eval no
#+BEGIN_SRC sh
./src/emacs -Q /tmp/a.txt
#+END_SRC

First, I evaluated the sexp shown in the first code block below. The second code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.is/v4Sr9

#+begin_src elisp
(set-frame-font "Fixed 5" nil t)
#+end_src

#+BEGIN_SRC text
a: ftcrhb:-Misc-Fixed-regular-normal-normal-*-7-*-*-*-c-50-iso10646-1 (#x62)
“: ftcrhb:-Misc-Fixed-medium-normal-normal-ja-13-*-*-*-c-120-iso10646-1 (#x3A3)
b: ftcrhb:-Misc-Fixed-regular-normal-normal-*-7-*-*-*-c-50-iso10646-1 (#x63)
#+END_SRC

Then, I evaluated the sexp shown below. Upon evaluating it, the size of the character “ (#x201C, LEFT DOUBLE QUOTATION MARK) significantly increased. The second code block below shows the font reported for each character by calling =what-cursor-position= with a prefix argument. Screenshot: https://archive.is/KYRGd

#+begin_src elisp
(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))
#+end_src

#+BEGIN_SRC text
a: ftcrhb:-Misc-Fixed-regular-normal-normal-*-7-*-*-*-c-50-iso10646-1 (#x62)
“: ftcrhb:-GOOG-Noto Sans Mono-regular-normal-normal-*-50-*-*-*-*-0-iso10646-1 (#x209)
b: ftcrhb:-Misc-Fixed-regular-normal-normal-*-7-*-*-*-c-50-iso10646-1 (#x63)
#+END_SRC

** Conclusion

When the default font is not changed (see experiment 1) or is set using =(set-frame-font "Noto Sans Mono 10" nil t)= (see experiment 2), the sexp =(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))= didn't seem to increase the size of the character “ (#x201C, LEFT DOUBLE QUOTATION MARK).

When the default font is set using =(set-frame-font "Fixed 5" nil t)= (see experiment 3), the sexp =(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))= significantly increased the size of the character “ (#x201C, LEFT DOUBLE QUOTATION MARK).

To me, the expected behavior is that =(set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))= sets =:family= and =:size= for “ (#x201C, LEFT DOUBLE QUOTATION MARK) regardless of the font that is being used.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-12 19:10 bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts Rodrigo Morales
@ 2024-10-18  6:27 ` Eli Zaretskii
  2024-10-19  0:55   ` Rodrigo Morales
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2024-10-18  6:27 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: 73777

> From: Rodrigo Morales <rodrigo-mailing-lists@morales.pe>
> Date: Sat, 12 Oct 2024 14:10:25 -0500
> 
> 
> I am using GNU Emacs 29.4 in Ubuntu 22.04.5 LTS.
> 
> Today, I was trying to change the font size for the character =“= (#x201C, LEFT DOUBLE QUOTATION MARK) using the sexp shown below. I noticed an inconsistency: that sexp only sets the size for the character =“= when specific fonts are used.
> 
> #+BEGIN_SRC elisp
> (set-fontset-font t ?“ (font-spec :family "Noto Sans Mono" :size 50))
> #+END_SRC

Before I start digging into how we handle :size in a fontset, I have
two questions:

 . did you reset use-default-font-for-symbols to nil? without that,
   Emacs prefers to use the default face's font for punctuation and
   symbols, effectively disregarding the fontsets
 . which fonts did you find problematic in this case? you say
   "specific fonts", but it is not clear which fonts exhibit this
   behavior

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-18  6:27 ` Eli Zaretskii
@ 2024-10-19  0:55   ` Rodrigo Morales
  2024-10-19  6:36     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Rodrigo Morales @ 2024-10-19  0:55 UTC (permalink / raw)
  To: Eli Zaretskii, Rodrigo Morales; +Cc: 73777

>  . did you reset use-default-font-for-symbols to nil? without that,
>    Emacs prefers to use the default face's font for punctuation and
>    symbols, effectively disregarding the fontsets

No. I didn't know that the variable use-default-font-for-symbols existed
when I wrote that message. Now that I know of its existence, I believe
that Emacs behaves consistently with regards to what I mentioned in my
first message.

>  . which fonts did you find problematic in this case? you say
>    "specific fonts", but it is not clear which fonts exhibit this
>    behavior

I thought that the font which was problematic was "Noto Sans Mono"
because when I used that font (in "Experiment 1" and "Experiment 2"), I
could not increase the size of the character “ (#x201C, LEFT DOUBLE
QUOTATION MARK) by evaluating (set-fontset-font t ?“ (font-spec :family
"Noto Sans Mono" :size 50)), . However, when I used "Fixed 5" (in
"Experiment 3"), evaluating (set-fontset-font t ?“ (font-spec :family
"Noto Sans Mono" :size 50)) did increase the size of the character
(#x201C, LEFT DOUBLE QUOTATION MARK).

Now that I know that the variable use-default-font-for-symbols controls
whether Emacs should honor fontsets, I don't think there's a problematic
font, instead it was my fault for not correctly knowing the variable
that instruct Emacs that it shoud honor fontsets.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-19  0:55   ` Rodrigo Morales
@ 2024-10-19  6:36     ` Eli Zaretskii
  2024-10-19 16:17       ` Rodrigo Morales
  2024-10-21  9:47       ` Robert Pluim
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-10-19  6:36 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: 73777

> From: Rodrigo Morales <rodrigo-mailing-lists@morales.pe>
> CC: <73777@debbugs.gnu.org>
> Date: Fri, 18 Oct 2024 19:55:39 -0500
> 
> >  . did you reset use-default-font-for-symbols to nil? without that,
> >    Emacs prefers to use the default face's font for punctuation and
> >    symbols, effectively disregarding the fontsets
> 
> No. I didn't know that the variable use-default-font-for-symbols existed
> when I wrote that message. Now that I know of its existence, I believe
> that Emacs behaves consistently with regards to what I mentioned in my
> first message.
> 
> >  . which fonts did you find problematic in this case? you say
> >    "specific fonts", but it is not clear which fonts exhibit this
> >    behavior
> 
> I thought that the font which was problematic was "Noto Sans Mono"
> because when I used that font (in "Experiment 1" and "Experiment 2"), I
> could not increase the size of the character “ (#x201C, LEFT DOUBLE
> QUOTATION MARK) by evaluating (set-fontset-font t ?“ (font-spec :family
> "Noto Sans Mono" :size 50)), . However, when I used "Fixed 5" (in
> "Experiment 3"), evaluating (set-fontset-font t ?“ (font-spec :family
> "Noto Sans Mono" :size 50)) did increase the size of the character
> (#x201C, LEFT DOUBLE QUOTATION MARK).
> 
> Now that I know that the variable use-default-font-for-symbols controls
> whether Emacs should honor fontsets, I don't think there's a problematic
> font, instead it was my fault for not correctly knowing the variable
> that instruct Emacs that it shoud honor fontsets.

It's an obscure variable, not mentioned in any manuals (because we
don't believe someone will want to specify a separate font for
punctuation characters).  It's a little wonder you didn't know about
it.

So does this mean we can now close this bug?  Or are there any
left-overs we still need to handle?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-19  6:36     ` Eli Zaretskii
@ 2024-10-19 16:17       ` Rodrigo Morales
  2024-10-19 16:19         ` Eli Zaretskii
  2024-10-21  9:47       ` Robert Pluim
  1 sibling, 1 reply; 7+ messages in thread
From: Rodrigo Morales @ 2024-10-19 16:17 UTC (permalink / raw)
  To: Eli Zaretskii, Rodrigo Morales; +Cc: 73777

Eli Zaretskii <eliz@gnu.org> writes:

> So does this mean we can now close this bug?  Or are there any
> left-overs we still need to handle?

We can close this bug.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-19 16:17       ` Rodrigo Morales
@ 2024-10-19 16:19         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2024-10-19 16:19 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: 73777-done

> From: Rodrigo Morales <rodrigo-mailing-lists@morales.pe>
> CC: <73777@debbugs.gnu.org>
> Date: Sat, 19 Oct 2024 11:17:22 -0500
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > So does this mean we can now close this bug?  Or are there any
> > left-overs we still need to handle?
> 
> We can close this bug.

Thanks, closing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts
  2024-10-19  6:36     ` Eli Zaretskii
  2024-10-19 16:17       ` Rodrigo Morales
@ 2024-10-21  9:47       ` Robert Pluim
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2024-10-21  9:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73777, Rodrigo Morales

>>>>> On Sat, 19 Oct 2024 09:36:51 +0300, Eli Zaretskii <eliz@gnu.org> said:
    >> 
    >> Now that I know that the variable use-default-font-for-symbols controls
    >> whether Emacs should honor fontsets, I don't think there's a problematic
    >> font, instead it was my fault for not correctly knowing the variable
    >> that instruct Emacs that it shoud honor fontsets.

    Eli> It's an obscure variable, not mentioned in any manuals (because we
    Eli> don't believe someone will want to specify a separate font for
    Eli> punctuation characters).  It's a little wonder you didn't know about
    Eli> it.

Itʼs in the docstring for `set-fontset-font' and in the manuals as of
emacs-30.

Robert
-- 





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-21  9:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-12 19:10 bug#73777: set-fontset-font doesn't set :size for specific characters when using some fonts Rodrigo Morales
2024-10-18  6:27 ` Eli Zaretskii
2024-10-19  0:55   ` Rodrigo Morales
2024-10-19  6:36     ` Eli Zaretskii
2024-10-19 16:17       ` Rodrigo Morales
2024-10-19 16:19         ` Eli Zaretskii
2024-10-21  9:47       ` Robert Pluim

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.