From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Changing font weight with buffer-face-mode-invoke Date: Thu, 27 Jun 2024 15:31:05 +0300 Message-ID: <86y16q4lfa.fsf@gnu.org> References: <86sewz983b.fsf@gnu.org> <86r0cj7dmh.fsf@gnu.org> <86jzib6js5.fsf@gnu.org> <864j9e65uo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40229"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 27 14:32:48 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 1sMoIx-000AA9-JO for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 27 Jun 2024 14:32:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMoHT-0001Vh-LV; Thu, 27 Jun 2024 08:31:15 -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 1sMoHP-0001Tb-3a for help-gnu-emacs@gnu.org; Thu, 27 Jun 2024 08:31:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sMoHO-0004VG-NZ for help-gnu-emacs@gnu.org; Thu, 27 Jun 2024 08:31:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/vp78Nq6VhnyAlF0H9rUEw/gxEStyqLndb52vwDzWVg=; b=fS0dc4oS5lYB GCjY4ECts94/U5jbiPascChVLD2RomCa1UU3GYSbXHPGia9jOoW7VxB5eIEDoXPuegoWUI0xh92Sl 74B78lRSvj8dJHlZLNSYU4f31JumKTTtGzPGo4iTdJhwHcd5By8VcVQpRTFf3H1h0FkdpNKoQcs7p FJo2hyd8ZeVIhIfN9SWoI6OgedFMMl3JM2KWZHKI/axy3f7e9oFx5KYH9qH1WLA5hVYppX9PkIeEm sJ27Fil7YlVY2VEO90PUSbJ6NDScXqwMMNjhe+7p87q+7h2Tkqw8gfS0jvoI9+aul2Pcnw7HU/S1h ZXNP6+Hm1DPlWmb56ScXHw==; In-Reply-To: (message from Heime on Thu, 27 Jun 2024 10:59:46 +0000) 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:147010 Archived-At: > Date: Thu, 27 Jun 2024 10:59:46 +0000 > From: Heime > 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- 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.