unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Font selection depending on the face weight
@ 2023-05-22 12:20 Nicolas Martyanoff
  2023-05-22 13:00 ` Robert Pluim
  2023-05-22 13:40 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Martyanoff @ 2023-05-22 12:20 UTC (permalink / raw)
  To: emacs-devel


Hi,

I stumbled upon a strange behaviour. With the IntelOne Mono font [1],
Emacs (Emacs 28.2 GUI on Linux) maps font faces as follows:

'((t :font "IntelOne Mono-11" :weight light))      -> "Light"
'((t :font "IntelOne Mono-11" :weight semi-light)) -> "Light"
'((t :font "IntelOne Mono-11" :weight normal))     -> "Medium"
'((t :font "IntelOne Mono-11" :weight medium))     -> "Medium"
'((t :font "IntelOne Mono-11" :weight semi-bold))  -> "Bold"

None of the Emacs weight maps to the "Normal" font weight (Light,
Medium, Normal and Bold are the name of the weights as reported by all
other applications).

From a quick search, Emacs uses font-weight-table to map numeric font
weights to symbolic weights, but I cannot find any link between these
numeric values and the weight names reported by other applications.

Is there something I can do to control (or at least understand) the way
weights are mapped?

[1] https://github.com/intel/intel-one-mono

Best,

-- 
Nicolas Martyanoff
https://n16f.net
nicolas@n16f.net



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

* Re: Font selection depending on the face weight
  2023-05-22 12:20 Font selection depending on the face weight Nicolas Martyanoff
@ 2023-05-22 13:00 ` Robert Pluim
  2023-05-22 13:29   ` Nicolas Martyanoff
  2023-05-22 13:40 ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2023-05-22 13:00 UTC (permalink / raw)
  To: Nicolas Martyanoff; +Cc: emacs-devel

>>>>> On Mon, 22 May 2023 14:20:05 +0200, Nicolas Martyanoff <nicolas@n16f.net> said:

    Nicolas> Hi,

    Nicolas> I stumbled upon a strange behaviour. With the IntelOne Mono font [1],
    Nicolas> Emacs (Emacs 28.2 GUI on Linux) maps font faces as follows:

    Nicolas> '((t :font "IntelOne Mono-11" :weight light))      -> "Light"
    Nicolas> '((t :font "IntelOne Mono-11" :weight semi-light)) -> "Light"
    Nicolas> '((t :font "IntelOne Mono-11" :weight normal))     -> "Medium"
    Nicolas> '((t :font "IntelOne Mono-11" :weight medium))     -> "Medium"
    Nicolas> '((t :font "IntelOne Mono-11" :weight semi-bold))  -> "Bold"

    Nicolas> None of the Emacs weight maps to the "Normal" font weight (Light,
    Nicolas> Medium, Normal and Bold are the name of the weights as reported by all
    Nicolas> other applications).

This has changed in emacs-29. From etc/NEWS:

*** Emacs now supports 'medium' fonts.
Emacs previously didn't distinguish between the 'regular'/'normal'
weight and the 'medium' weight, but it now also supports the (heavier)
'medium' weight.  However, this means that if you specify a weight of
'normal' and the font doesn't have this weight, Emacs won't find the
font spec.  In these cases, replacing ":weight 'normal" with ":weight
'medium" should fix the issue.

Would it be possible to check with emacs-29?

    Nicolas> From a quick search, Emacs uses font-weight-table to map numeric font
    Nicolas> weights to symbolic weights, but I cannot find any link between these
    Nicolas> numeric values and the weight names reported by other applications.

    Nicolas> Is there something I can do to control (or at least understand) the way
    Nicolas> weights are mapped?

I once understood some of it, but Iʼve long since repressed that info
:-)

Robert
-- 



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

* Re: Font selection depending on the face weight
  2023-05-22 13:00 ` Robert Pluim
@ 2023-05-22 13:29   ` Nicolas Martyanoff
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Martyanoff @ 2023-05-22 13:29 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Nicolas Martyanoff, emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

> This has changed in emacs-29. From etc/NEWS:
>
> *** Emacs now supports 'medium' fonts.
> Emacs previously didn't distinguish between the 'regular'/'normal'
> weight and the 'medium' weight, but it now also supports the (heavier)
> 'medium' weight.  However, this means that if you specify a weight of
> 'normal' and the font doesn't have this weight, Emacs won't find the
> font spec.  In these cases, replacing ":weight 'normal" with ":weight
> 'medium" should fix the issue.
>
> Would it be possible to check with emacs-29?

The problem seems to be fixed with a freshly built Emacs from emacs-29.
Thank you!

-- 
Nicolas Martyanoff
https://n16f.net
nicolas@n16f.net



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

* Re: Font selection depending on the face weight
  2023-05-22 12:20 Font selection depending on the face weight Nicolas Martyanoff
  2023-05-22 13:00 ` Robert Pluim
@ 2023-05-22 13:40 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-05-22 13:40 UTC (permalink / raw)
  To: Nicolas Martyanoff; +Cc: emacs-devel

> From: Nicolas Martyanoff <nicolas@n16f.net>
> Date: Mon, 22 May 2023 14:20:05 +0200
> 
> >From a quick search, Emacs uses font-weight-table to map numeric font
> weights to symbolic weights, but I cannot find any link between these
> numeric values and the weight names reported by other applications.
> 
> Is there something I can do to control (or at least understand) the way
> weights are mapped?

See the beginning of src/font.c.



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

end of thread, other threads:[~2023-05-22 13:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 12:20 Font selection depending on the face weight Nicolas Martyanoff
2023-05-22 13:00 ` Robert Pluim
2023-05-22 13:29   ` Nicolas Martyanoff
2023-05-22 13:40 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).