all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Determining line-height in pixels
@ 2012-06-29  1:50 Dmitry Gutov
  2012-06-29 12:35 ` Doug Lewan
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2012-06-29  1:50 UTC (permalink / raw
  To: help-gnu-emacs

Hi all!

How can I programmatically determine full line height in pixels?

I'm planning to use that value for fringe bitmaps, so it needs to
include line spacing.

The docs are saying that it can change from line to line, but the
default value should be good enough.

  (face-attribute 'default :height)

seems to return what I want, only in typographic points. Can I convert
that to pixels?

Best regards,
Dmitry




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

* RE: Determining line-height in pixels
  2012-06-29  1:50 Determining line-height in pixels Dmitry Gutov
@ 2012-06-29 12:35 ` Doug Lewan
  2012-06-29 13:57   ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Lewan @ 2012-06-29 12:35 UTC (permalink / raw
  To: Dmitry Gutov, help-gnu-emacs@gnu.org

To get font height in pixels I suspect you're going to have to do the arithmetic yourself.

You might want to look at (display-pixel-height).

,Doug

> -----Original Message-----
> From: help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org
> [mailto:help-gnu-emacs-bounces+dougl=shubertticketing.com@gnu.org] On
> Behalf Of Dmitry Gutov
> Sent: Thursday, 2012 June 28 21:50
> To: help-gnu-emacs@gnu.org
> Subject: Determining line-height in pixels
> 
> Hi all!
> 
> How can I programmatically determine full line height in pixels?
> 
> I'm planning to use that value for fringe bitmaps, so it needs to
> include line spacing.
> 
> The docs are saying that it can change from line to line, but the
> default value should be good enough.
> 
>   (face-attribute 'default :height)
> 
> seems to return what I want, only in typographic points. Can I convert
> that to pixels?
> 
> Best regards,
> Dmitry
> 




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

* Re: Determining line-height in pixels
  2012-06-29 12:35 ` Doug Lewan
@ 2012-06-29 13:57   ` Dmitry Gutov
  2012-06-29 16:02     ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2012-06-29 13:57 UTC (permalink / raw
  To: Doug Lewan; +Cc: help-gnu-emacs@gnu.org

Hi Doug,

On 29.06.2012 16:35, Doug Lewan wrote:
> To get font height in pixels I suspect you're going to have to do the arithmetic yourself.
>
> You might want to look at (display-pixel-height).

This was not it (the function returns vertical screen resolution), but 
it pointed me in the right direction.

(frame-char-height) is the answer, probably along with 
`text-scale-mode-amount' and `text-scale-mode-step'.

Thanks,
Dmitry



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

* RE: Determining line-height in pixels
  2012-06-29 13:57   ` Dmitry Gutov
@ 2012-06-29 16:02     ` Drew Adams
  2012-06-29 16:17       ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2012-06-29 16:02 UTC (permalink / raw
  To: 'Dmitry Gutov', 'Doug Lewan'; +Cc: help-gnu-emacs

> (frame-char-height) is the answer, probably along with 
> `text-scale-mode-amount' and `text-scale-mode-step'.

See also variable `line-spacing' and the frame parameter of the same name.  See
also text/overlay property `line-height'.

See (elisp) `Line Height'.




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

* Re: Determining line-height in pixels
  2012-06-29 16:02     ` Drew Adams
@ 2012-06-29 16:17       ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2012-06-29 16:17 UTC (permalink / raw
  To: Drew Adams; +Cc: help-gnu-emacs

On 29.06.2012 20:02, Drew Adams wrote:
>> (frame-char-height) is the answer, probably along with
>> `text-scale-mode-amount' and `text-scale-mode-step'.
>
> See also variable `line-spacing' and the frame parameter of the same name.  See
> also text/overlay property `line-height'.
>
> See (elisp) `Line Height'.

Thanks, but this is what I found first thing actually, and there was no 
mention of `frame-char-height' there.

For the moment I'm trying to reuse bitmaps across lines, and accounting 
for differences between the lines doesn't fit in that. It shouldn't be a 
problem in [text|prog]-mode buffers anyway.

-- Dmitry



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

end of thread, other threads:[~2012-06-29 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29  1:50 Determining line-height in pixels Dmitry Gutov
2012-06-29 12:35 ` Doug Lewan
2012-06-29 13:57   ` Dmitry Gutov
2012-06-29 16:02     ` Drew Adams
2012-06-29 16:17       ` Dmitry Gutov

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.