emacs-devel
[Top][All Lists]
Advanced

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

Re: Determining size of a propertised string


From: martin rudalics
Subject: Re: Determining size of a propertised string
Date: Tue, 29 Nov 2016 15:16:17 +0100

> 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 via email to

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