all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Changing font weight with buffer-face-mode-invoke
Date: Thu, 27 Jun 2024 16:49:20 +0000	[thread overview]
Message-ID: <J3hbsbT7g_bJYyvjYzawfAqsL-pUTtvta5XzEbIv-LXutgEV7TuoYkB2mmCEhIjemz3mmrIIIlPc50KN0d03H5uVTG3Y3gN2mhZmlmdO_fk=@protonmail.com> (raw)
In-Reply-To: <86y16q4lfa.fsf@gnu.org>


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	other threads:[~2024-06-27 16:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 21:58 Changing font weight with buffer-face-mode-invoke Heime
2024-06-26 12:55 ` Eli Zaretskii
2024-06-26 17:08   ` Heime
2024-06-26 18:39     ` Eli Zaretskii
2024-06-26 19:32       ` Heime
2024-06-27  4:56         ` Eli Zaretskii
2024-06-26 20:54       ` Heime
2024-06-27  5:23         ` Eli Zaretskii
2024-06-27  8:48           ` Heime
2024-06-27  9:30             ` Yuri Khan
2024-06-27 10:24             ` Eli Zaretskii
2024-06-27 10:59               ` Heime
2024-06-27 12:31                 ` Eli Zaretskii
2024-06-27 16:49                   ` Heime [this message]

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='J3hbsbT7g_bJYyvjYzawfAqsL-pUTtvta5XzEbIv-LXutgEV7TuoYkB2mmCEhIjemz3mmrIIIlPc50KN0d03H5uVTG3Y3gN2mhZmlmdO_fk=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.