all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How much is one em (image size unit)?
@ 2023-03-31 13:38 Akib Azmain Turja
  2023-03-31 14:40 ` Manuel Giraud via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 13+ messages in thread
From: Akib Azmain Turja @ 2023-03-31 13:38 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]


I'm trying to show an image such that it has same height as the text and
resizes relatively with text scale.  I've achieved this with the 'em'
unit as described in (elisp)Image Descriptors.  But 1 em seems to be
pretty smaller than the font size.  How to figure out correct value in
em unit such that image and the text has correct height?

So far I've reached till this:

--8<---------------cut here---------------start------------->8---
(insert (propertize "f" 'display '(image :type xpm :height (1 . em) :ascent center :data "/* XPM */
static char * blarg_xpm[] = {
\"16 7 2 1\",
\"* c #000000\",
\". c #ffffff\",
\"**..*...........\",
\"*.*.*...........\",
\"**..*..**.**..**\",
\"*.*.*.*.*.*..*.*\",
\"**..*..**.*...**\",
\"...............*\",
\".............**.\"
};")))
--8<---------------cut here---------------end--------------->8---

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib@hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-04-05 11:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 13:38 How much is one em (image size unit)? Akib Azmain Turja
2023-03-31 14:40 ` Manuel Giraud via Users list for the GNU Emacs text editor
2023-03-31 16:32   ` Akib Azmain Turja
2023-03-31 17:36     ` Manuel Giraud via Users list for the GNU Emacs text editor
2023-03-31 17:57     ` Eli Zaretskii
2023-03-31 18:15       ` Akib Azmain Turja
2023-04-01 12:59         ` Eli Zaretskii
2023-04-02 22:27         ` Fu Yuan
2023-04-04  9:41           ` Akib Azmain Turja
2023-04-04 13:51             ` [External] : " Drew Adams
2023-04-04 18:13               ` Akib Azmain Turja
2023-04-04 18:46                 ` Drew Adams
2023-04-05 11:52               ` Michael Heerdegen

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.