emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing rendered image data


From: Lars Magne Ingebrigtsen
Subject: Re: Accessing rendered image data
Date: Tue, 28 Jun 2016 17:37:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Lars Magne Ingebrigtsen <address@hidden> writes:

> If I have an image in a buffer, is there a way to access the displayed
> image glyph data from Emacs Lisp?
>
> The glyph is presumably a ... block of bytes with a width/height
> number...  or something.

The reason I'm asking is because I'm trying to asses the width of
rendered text in an SVG image, but perhaps I can just render the text
normally in Emacs.

However, I can't make head or tails or the "advanced" face/font stuff in
the manual.

If I say

emacs -nw "futura:size=40"

I get all the text rendered in Futura.

(find-font (font-spec :name "futura" :size 40))
#<font-entity xft adobe Futura nil iso10646-1 ultra-bold normal normal 0 nil 
nil 0 ((:font-entity "/usr/share/fonts/X11/Type1/pfud8a.pfa" . 0) (:name . 
"futura"))>

That's seems OK, doesn't it?

But if I say

(insert (propertize "FOO" 'face (list :font (find-font (font-spec :name 
"futura" :size 40)))))
FOO

and then say (font-at (point)) on that FOO, I get:

#<font-object "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1">

Same with

(insert (propertize "FOO" 'face (list :font (find-font (font-spec :name 
"futura:size=40")))))

which is supposed to work, according to the manual.

What am I missing?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]