From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Accessing rendered image data Date: Tue, 28 Jun 2016 20:29:58 +0200 Message-ID: References: <83r3bhw7km.fsf@gnu.org> <83mvm5w5fi.fsf@gnu.org> <83k2h9w4wn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467138887 9398 80.91.229.3 (28 Jun 2016 18:34:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jun 2016 18:34:47 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 28 20:34:37 2016 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 1bHxqH-0006rz-2m for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2016 20:34:37 +0200 Original-Received: from localhost ([::1]:38775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHxqG-0001Xb-EE for ged-emacs-devel@m.gmane.org; Tue, 28 Jun 2016 14:34:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHxlv-0003fy-Gf for emacs-devel@gnu.org; Tue, 28 Jun 2016 14:30:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHxlr-0003zY-M4 for emacs-devel@gnu.org; Tue, 28 Jun 2016 14:30:06 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:59057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHxlr-0003y9-FS; Tue, 28 Jun 2016 14:30:03 -0400 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.84_2) (envelope-from ) id 1bHxlm-00064D-Ti; Tue, 28 Jun 2016 20:30:01 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXNysfj4d/39vW7kY// ///+//7+/v3YXpzkAAACY0lEQVQ4jWWTTZObMAyGJZvN2XI8nG3i2bMTOj3HXq3v7bQ9Q+rm//+E CgL70b7MAPaD0Keh43/U5BJBx/X+pj/7S1vAOB7HMY2jXu/ykHtcgF7AWbZ3pVH/qCs4jen8YVu0 +iAgrRQknQBAG0oaYAVrJBUOKC+v9yEfeItqUUnQtRw5HzGn9g4K4FV2XbaksrW3uAMzO1/utVGs ndUWd5CdsEFxGC5MGLRpGyAOXK2ao0RxJYhq99ExNHZsehJHerRuA6XjyXFsHrxsoTZL/Au4BsT+ lfAA1jIPttvDFWswSJK3KkKK28uukz35ZO+kE8GN+WkDJTkuNpAdAgUw3Mz8CLd+lQ9ugx+srL11 7pS3BB3Xnue5Nln70NF0HR6g41dDwZMSrz7h9JLtDvLMfhqeBQQLV1NU24C3AuxiMSiEocIOggBv +8XCnOt0N24Fim+uGC8JIlE2t2c1rVPCM3OfgX9yLx1h6xpOD+dL62HpuBmLgMZ39QBHvJfiBchs WSKp1taoY0LSC1BD7ScxHbbqetBolj7rEY20r26Nyup2HJ+SfGHbjULk0DYAsR5JX+SfYmHZ0N7a 545f/GSiVNNiTwafNlAV5x5Rccw4h2DMbsEUizsRuIJR8jc+vgGs3enyHczzrPpbWSzqCpTpu+uI TUpoYp+pvQ11fjrzN0QDFOdI/fu0Vxy7cj4KQsq0HJD1V2J5NaPR8SVZA/A+cKKppARf6m+TOsSP IB8vGptHgE5B/AAY7pKBBn3AED+DdNFajqvUMnwGB0lZ9oN7rOsGrnJUf5GJvGsHuePP2sF/qn8B cLPQkdhv/lcAAAAASUVORK5CYII= In-Reply-To: <83k2h9w4wn.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Jun 2016 21:21:28 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:204887 Archived-At: Eli Zaretskii writes: > And you should trust me that I don't like wasting my time on digging > into problems whose purpose I don't fully understand ;-) As I said earlier in this thread, I wanted to figure out how much space text rendered in an SVG takes. Since Emacs doesn't expose this data back to Elisp land, I hit upon the idea of rendering the text in a buffer instead (with the same fonts that would have been used in the SVG). This will give me approximate sizes that'll be good enough. > How should I know? This stuff is not documented at all, so you are > asking me to step in a debugger through gobs of unfamiliar and > complicated code, without ever understanding what is it that I'm > trying to accomplish. That's not in my job description. > > If you want my help, try telling more. It is documented in (info "(lisp)Low-Level Font") In particular: -- Function: font-spec &rest arguments Return a new font spec using the specifications in ARGUMENTS, which should come in `property'-`value' pairs. The possible specifications are as follows: `:name' The font name (a string), in either XLFD, Fontconfig, or GTK format. *Note Fonts: (emacs)Fonts. [...] `:size' The font size--either a non-negative integer that specifies the pixel size, or a floating-point number that specifies the point size. An XLFD would look like "futura:size=40". (insert (propertize "FOO" 'face (list :font (find-font (font-spec :name "futura:size=40"))))) Does not work. Either this is a bug, or there are missing bits in the manual that says what find-font and/or 'face wants here. Or there's something else I'm missing. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no