help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing font weight with buffer-face-mode-invoke


From: Heime
Subject: Re: Changing font weight with buffer-face-mode-invoke
Date: Thu, 27 Jun 2024 16:49:20 +0000

On Thursday, June 27th, 2024 at 12:31 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Thu, 27 Jun 2024 10:59:46 +0000
> > From: Heime heimeborgia@protonmail.com
> > Cc: help-gnu-emacs@gnu.org
> > 
> > > > > Emacs was not designed to support selection of fonts by fine-tuning 
> > > > > their
> > > > > weight, slant, and other similar attributes, so specifying such fonts 
> > > > > works
> > > > > in some cases but doesn't work in others.
> > > > 
> > > > If you do S-<down-mouse-1> to use "Change Buffer Font", one can select 
> > > > those attributes.
> > > > I just want to do the same automatically in elisp code.
> > > 
> > > There's no practical reason for doing so, that's all I'm saying.
> > 
> > Somehow, the "Change Buffer Font" tool allows selection of that information 
> > and
> > gets things to work.
> 
> 
> No, it doesn't. It sets things up to use a single font in a single
> buffer as the default face's font in that buffer, that's all. There
> are many other situations where fonts are used or passed to various
> functions in Emacs, and in quite a few of those using an arbitrary
> font with an arbitrary weight or slamt or width will not do what you
> expect.
> 
> > Could it be that using the :family, :height, :weight is not so rodust, and 
> > it is better
> > to just use :font ? How would I call buffer-face-mode-invoke with :font or 
> > similar ?
> 
> 
> You should use just :family, and perhaps also specify :height.


The "Pick a Font" of "Change Buffer Font" displays not just the family and 
size,  but also
the Style (e.g. Oblique, Regular, Bold, Bold Oblique).

The Web Content Accessibility Guidelines (WCAG) refer to 14 point Bold Text or 
larger to
define a different set of colour contrast values for both midrange and enhanced 
contrast 
(Levels AA and AAA).

For acessibility, a working :weight setting is quite desirable.  A useful tool
in this regard is a function one can call that is similar to (font-family-list) 
which
we can call font-weight-list to which one can pass the font family 

(font-weight-list :family family)

Or perhaps some other way convenient you might suggest.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]