[Top][All Lists]

[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 20:58:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> How do you know which fonts are used by SVG?  They use similar font
> selection machinery as Emacs with similar fallbacks.  The font that is
> stated in the SVG file will not necessarily be used.

There will be some differences; yes, but it should be near enough.

>> (insert (propertize "FOO" 'face (list :font (find-font (font-spec
>> :name "futura:size=40")))))
>> Does not work.
> It does work, sort of.  Try describe-text-properties on :FOO, and see
> for yourself.

I does not work in that it doesn't give me the font I want.

Anyway, `load-font' almost gets me to where I want to be

(insert (propertize "FOO" 'face (list :font (open-font (find-font (font-spec 
:family "futura" :size 20))))))

gives me text with:

#<font-object "-adobe-Futura-ultrabold-normal-normal-*-2-*-*-*-*-0-iso10646-1">

That's pretty close, although the size is 2 instead of 20...  *sigh*

:size doesn't seem to have any effect at all here.

(font-info (find-font (font-spec :family "futura" :size 20)))
 2 4 0 0 0 1 3 1 1 1 "/usr/share/fonts/X11/Type1/pfud8a.pfa" (opentype)]

(font-spec :family "futura" :size 20)
=> #<font-spec nil nil futura nil nil nil nil nil 20 nil nil nil nil>

(find-font (font-spec :family "futura" :size 20))
=> #<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))>

So...  something got lost in the `find-font' call?

> What if you use just :font "font-name-as-a-string", does that do what
> you want?

:font "futura:size=20" does not work.  If you mean

(insert (propertize "FOO" 'face (list :font 

that doesn't work either.

(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]