all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Elias Mårtenson" <lokedhs@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Determining size of a propertised string
Date: Tue, 29 Nov 2016 15:16:17 +0100	[thread overview]
Message-ID: <583D8DB1.6060102@gmx.at> (raw)
In-Reply-To: <CADtN0WJPdyvXMXn1Tu5Q1sTB47ceV-se1CAaZjdvde13tcj6=w@mail.gmail.com>

 > So in the interest of satisfying my own curiosity, is there a way to
 > determine the height of a given string?

"A given string" doesn't have a height per se.  It's assigned a height
only when you put it into a buffer and put that buffer in a window on a
display.  This may wrap the string and assigns the corresponding font,
text, overlay and other properties to that string's constituents.  You
can use the function ‘window-text-pixel-size’ in order to determine the
size of the string it would occupy, in pixels, at a given buffer
position on your display.  That's what ‘fit-window-to-buffer’ does.

martin




      reply	other threads:[~2016-11-29 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 10:39 Determining size of a propertised string Elias Mårtenson
2016-11-29 11:00 ` martin rudalics
2016-11-29 11:05   ` Elias Mårtenson
2016-11-29 14:16     ` martin rudalics [this message]

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=583D8DB1.6060102@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=lokedhs@gmail.com \
    /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.