help-gnu-emacs
[Top][All Lists]
Advanced

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

How much is one em (image size unit)?


From: Akib Azmain Turja
Subject: How much is one em (image size unit)?
Date: Fri, 31 Mar 2023 19:38:25 +0600

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: signature.asc
Description: PGP signature


reply via email to

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