all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Accessing rendered image data
Date: Tue, 28 Jun 2016 20:58:22 +0200	[thread overview]
Message-ID: <m34m8d87jl.fsf@gnus.org> (raw)
In-Reply-To: <83h9cdw3o8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Jun 2016 21:48:07 +0300")

Eli Zaretskii <eliz@gnu.org> 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)))
=>
["-adobe-Futura-ultrabold-normal-normal-*-2-*-*-*-*-0-iso10646-1" "Futura:pixelsize=2:foundry=adobe:weight=ultra-bold:slant=normal:width=normal:scalable=true" 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 "-adobe-Futura-ultrabold-normal-normal-*-20-*-*-*-*-0-iso10646-1")))

that doesn't work either.

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



  reply	other threads:[~2016-06-28 18:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-28 13:52 Accessing rendered image data Lars Magne Ingebrigtsen
2016-06-28 15:37 ` Lars Magne Ingebrigtsen
2016-06-28 16:36   ` Eli Zaretskii
2016-06-28 16:46     ` Lars Magne Ingebrigtsen
2016-06-28 17:23   ` Eli Zaretskii
2016-06-28 17:37     ` Lars Magne Ingebrigtsen
2016-06-28 18:10       ` Eli Zaretskii
2016-06-28 18:15         ` Lars Magne Ingebrigtsen
2016-06-28 18:21           ` Eli Zaretskii
2016-06-28 18:29             ` Lars Magne Ingebrigtsen
2016-06-28 18:48               ` Eli Zaretskii
2016-06-28 18:58                 ` Lars Magne Ingebrigtsen [this message]
2016-06-28 19:06                   ` Lars Magne Ingebrigtsen
2016-06-28 19:38                     ` Lars Magne Ingebrigtsen
2016-06-28 20:17                       ` Lars Magne Ingebrigtsen
2016-06-28 20:26                         ` Robert Weiner
2016-06-30 15:08                       ` Eli Zaretskii
2016-06-30 15:12               ` Ted Zlatanov
2016-06-30 15:38                 ` Lars Magne Ingebrigtsen
2016-06-30 16:11                   ` Ted Zlatanov
2016-06-28 18:35             ` Lars Magne Ingebrigtsen
2016-06-28 18:51               ` Eli Zaretskii
2016-06-28 16:25 ` Eli Zaretskii
2016-06-28 16:30   ` Lars Magne Ingebrigtsen
2016-06-28 17:03     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34m8d87jl.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.