From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Protesilaos Stavrou Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] Add new 'show-font' package? Date: Fri, 06 Sep 2024 09:23:43 +0300 Message-ID: <874j6tgv0w.fsf@protesilaos.com> References: <87msknu635.fsf@protesilaos.com> <87jzfqjtdh.fsf@posteo.net> <867cbq4cun.fsf@gnu.org> <87zfol4a5t.fsf@protesilaos.com> <86ttet1fbe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 06 08:24:47 2024 Return-path: Envelope-to: ged-emacs-devel@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 1smSOk-000AbP-UX for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Sep 2024 08:24:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smSNt-00043V-UO; Fri, 06 Sep 2024 02:23:53 -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 1smSNs-00043J-Bb for emacs-devel@gnu.org; Fri, 06 Sep 2024 02:23:52 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smSNp-0007x7-T0; Fri, 06 Sep 2024 02:23:52 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C9076240002; Fri, 6 Sep 2024 06:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protesilaos.com; s=gm1; t=1725603825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dvwM0UddlKVLn9YloBSfWD6QWVL2bZcZgBNxauqECxg=; b=nFejbAVIOTjYK+BciFEIIlRZVCsmBx7/tJT521dwQK6ailpSDg64n8etaaPzIcjAES0raK 8xQ33wKHigvdDOnSf2KHu5keIq3a7mch7JEqbDI3OrKiRs4idUtRkrSyWzwRDsQxxesZNc +xa4+Et6akaNvzBXHUCqpbTO8IZ785e88qGBHyJCjgRgSMNkwDaf0KefPu6etCzTCG4mOQ RSg3r/Pkq0WwHV9IHvuAvhyAlnwHRCiO9JuR+WCNhKxmbKgViWsh7mGl9+ukoAHiDwW7vt NJgYz33xvItrq8B3P8ZgFXvY3uxlEbZdKmgx33ocR0jWdbHjbkPhbQe7g47OXg== In-Reply-To: <86ttet1fbe.fsf@gnu.org> X-GND-Sasl: info@protesilaos.com Received-SPF: pass client-ip=217.70.183.193; envelope-from=info@protesilaos.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323446 Archived-At: > From: Eli Zaretskii > Date: Fri, 6 Sep 2024 09:12:05 +0300 > [... 15 lines elided] >> > Do we really need fc-list? can't we use the built-in x-family-fonts >> > instead? >> >> I thought that function was only for X. It also is defined in a file >> which again has X in its name. If it works everywhere, then I am happy >> to use it. > > x-family-fonts is defined in xfaces.c, which is not specific to X. > That function is supported by every font back-end that Emacs can use, > so it is platform-independent. Very well! I am experimenting with it right now. It seems to do what I want. All I need is to figure out how to get/guess the name of a font based on the file name (ideally without depending on an external program that may not be installed on the user's end). > The only disadvantage in using it is that it will only know about font > families that are installed. If you intend to support fonts that are > not installed, you will need something else. But then fc-list doesn't > know about uninstalled fonts, either. Also, fc-list is unlikely to be > installed on systems that do not run X Window System, anyway. Yes, I know. It is why I had a TODO for how to make this work on all systems. But with x-family-fonts we are good to go. -- Protesilaos Stavrou https://protesilaos.com