From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Changing font weight with buffer-face-mode-invoke Date: Thu, 27 Jun 2024 16:49:20 +0000 Message-ID: References: <86sewz983b.fsf@gnu.org> <86r0cj7dmh.fsf@gnu.org> <86jzib6js5.fsf@gnu.org> <864j9e65uo.fsf@gnu.org> <86y16q4lfa.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24223"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 27 18:50:39 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sMsKU-00064a-Oo for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Jun 2024 18:50:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMsJT-0005vH-Oc; Thu, 27 Jun 2024 12:49:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMsJL-0005Xp-N3 for help-gnu-emacs@gnu.org; Thu, 27 Jun 2024 12:49:27 -0400 Original-Received: from mail-4325.protonmail.ch ([185.70.43.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMsJJ-0001RR-Lx; Thu, 27 Jun 2024 12:49:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719506961; x=1719766161; bh=Jrr03KTfsVWCLaPLl0Y8h+defepylrIysZyjElxIojE=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Z8KXMqVNkVLS0VmbF5rLjJ9s/UC/l/L9DhPuUtq9Z0h9/Qag3HGsyavIgG3a3s8E0 Uprbg39wFWUO59eoWzpVhOe1rxErDRwoeZfvF3T3BnqYAuzGRo1wSya8jLa1q/MYhB lo6x25WO4ta+nzWr4vHDZ4wR6Uh1XN7uZ/dNsLwGZUkE0OWWh1GiPDFdEsWhuKuzhK 7nxwHubGsCqQ3VZqGbtdeWfPo9Q0AhE+ex594oAVRpflE0KfNCIZJcMfHSqlaHu9mq 2anDDCe1RMhbLbk98ocgCwWVldJ+C9lnW7w7347ZZezsdPKwNwx/xTvqjrLLE/G0Xy fh8AJFSvwZCow== In-Reply-To: <86y16q4lfa.fsf@gnu.org> Feedback-ID: 57735886:user:proton X-Pm-Message-ID: cbca1634617b8be5341c073ab07cccd14dd08962 Received-SPF: pass client-ip=185.70.43.25; envelope-from=heimeborgia@protonmail.com; helo=mail-4325.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147011 Archived-At: On Thursday, June 27th, 2024 at 12:31 PM, Eli Zaretskii wrot= e: > > Date: Thu, 27 Jun 2024 10:59:46 +0000 > > From: Heime heimeborgia@protonmail.com > > Cc: help-gnu-emacs@gnu.org > >=20 > > > > > Emacs was not designed to support selection of fonts by fine-tuni= ng their > > > > > weight, slant, and other similar attributes, so specifying such f= onts works > > > > > in some cases but doesn't work in others. > > > >=20 > > > > If you do S- to use "Change Buffer Font", one can sel= ect those attributes. > > > > I just want to do the same automatically in elisp code. > > >=20 > > > There's no practical reason for doing so, that's all I'm saying. > >=20 > > Somehow, the "Change Buffer Font" tool allows selection of that informa= tion and > > gets things to work. >=20 >=20 > 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. >=20 > > 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 ? >=20 >=20 > 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 enha= nced contrast=20 (Levels AA and AAA). For acessibility, a working :weight setting is quite desirable. A useful t= ool in this regard is a function one can call that is similar to (font-family-l= ist) which we can call font-weight-list to which one can pass the font family=20 (font-weight-list :family family) Or perhaps some other way convenient you might suggest.