From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Ping! Re: `font-spec` unable to retrieve :name of font Date: Sat, 24 Oct 2015 11:04:42 -0700 (PDT) Message-ID: References: <87bnc3plb9.fsf@gmail.com> <87r3kngugm.fsf@gmail.com> <83k2qft0ej.fsf@gnu.org> <87h9lhucxx.fsf@gmail.com> <87611wcg97.fsf@esperi.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1445709923 4097 80.91.229.3 (24 Oct 2015 18:05:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2015 18:05:23 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Nix , Alexis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 24 20:05:10 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zq3Bd-0001OJ-Uu for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2015 20:05:02 +0200 Original-Received: from localhost ([::1]:45221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq3Bd-0002bC-87 for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2015 14:05:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq3Ba-0002av-76 for emacs-devel@gnu.org; Sat, 24 Oct 2015 14:04:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zq3BZ-0001j1-D6 for emacs-devel@gnu.org; Sat, 24 Oct 2015 14:04:58 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:22898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq3BV-0001iO-7R; Sat, 24 Oct 2015 14:04:53 -0400 Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t9OI4hon012360 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 24 Oct 2015 18:04:43 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t9OI4hF8024643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 24 Oct 2015 18:04:43 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t9OI4hCD021698; Sat, 24 Oct 2015 18:04:43 GMT In-Reply-To: <87611wcg97.fsf@esperi.org.uk> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: aserv0022.oracle.com [141.146.126.234] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192572 Archived-At: > after all, the XLFD variant is never going to be displayed to the user, > nor passed to Fontconfig: it's just an internal thing for parts of > Emacs expecting XLFDs. Just a comment on this part of what you wrote. XLFD format _is_ visible to users. And it can be used by them. I use it, for example, to transform a font to another of a different size, resulting also in a frame of a different size. This use case is quite important to my use of Emacs, FWIW. ---- (defun frcmds-enlarged-font-name (fontname frame increment) "FONTNAME, after enlarging font size of FRAME by INCREMENT. FONTNAME is the font of FRAME." (when (query-fontset fontname) (let ((ascii (assq 'ascii (aref (fontset-info fontname frame) 2)))) (when ascii (setq fontname (nth 2 ascii))))) (let ((xlfd-fields (x-decompose-font-name fontname))) (unless xlfd-fields (error "Cannot decompose font name")) (let ((new-size (+ (string-to-number (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) increment))) (unless (> new-size 0) (signal 'font-too-small (list new-size))) (aset xlfd-fields xlfd-regexp-pixelsize-subnum (number-to-string new-size))) ;; Set point size & width to "*", so frame width will adjust to ;; new font size (aset xlfd-fields xlfd-regexp-pointsize-subnum "*") (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*") (x-compose-font-name xlfd-fields)))