unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with display-pixels-per-inch variable
@ 2005-08-15 15:03 Kim F. Storm
  2005-08-15 15:31 ` Jason Rumney
  2005-08-15 16:31 ` Thien-Thi Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Kim F. Storm @ 2005-08-15 15:03 UTC (permalink / raw)



In the C code, we have this variable, which can be used by the
calculation of strech glyph width and height:

  DEFVAR_LISP ("display-pixels-per-inch",  &Vdisplay_pixels_per_inch,
    doc: /* Pixels per inch on current display.
Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI).  */);
  Vdisplay_pixels_per_inch = make_float (72.0);


There are two problems with this:

1) It is a fixed value, so if it is not correct, the user
   must set it to the proper value  (possible, but not nice).

2) There is only one common value for all displays.


Re. 1, I would imagine that - at least for some setups - it is
possible to get the proper value from the X-Server or OS.

Does anyone know how to do that?


Re. 2, I guess the proper thing would be store this in the
display structure of each display, and use a function to set
the values for a specific display (if the values cannot be
determined automatically).

I can do item 2, but if someone would like to fix item 1, I would
appreciate if you would fix item 2 as well...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: Problems with display-pixels-per-inch variable
  2005-08-15 15:03 Problems with display-pixels-per-inch variable Kim F. Storm
@ 2005-08-15 15:31 ` Jason Rumney
  2005-08-15 16:31 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Rumney @ 2005-08-15 15:31 UTC (permalink / raw)
  Cc: emacs-devel

Kim F. Storm wrote:

>In the C code, we have this variable, which can be used by the
>calculation of strech glyph width and height:
>
>  DEFVAR_LISP ("display-pixels-per-inch",  &Vdisplay_pixels_per_inch,
>    doc: /* Pixels per inch on current display.
>Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI).  */);
>  Vdisplay_pixels_per_inch = make_float (72.0);
>
>  
>
The x_display_info structure has this information already, though it may 
be initialised in a similar arbritrary fashion. On W32, it is 
initialised from system settings. Anyway, if we must define it 
arbritrarily and leave it to the user to fix up later if they are 
motivated enough to do so, 96dpi is far more common than 72dpi these days.

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

* Re: Problems with display-pixels-per-inch variable
  2005-08-15 15:03 Problems with display-pixels-per-inch variable Kim F. Storm
  2005-08-15 15:31 ` Jason Rumney
@ 2005-08-15 16:31 ` Thien-Thi Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thien-Thi Nguyen @ 2005-08-15 16:31 UTC (permalink / raw)
  Cc: emacs-devel

storm@cua.dk (Kim F. Storm) writes:

> Does anyone know how to do that?

that info can be found in 

 FRAME_X_DISPLAY_INFO (frame)->resx and 
 FRAME_X_DISPLAY_INFO (frame)->resy

but those are initialized later.  perhaps you can adjust
the var's value right before entering the command-loop.
fwiw, the default is pretty close to what i see locally
(76.2 for both width and height).

thi

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

end of thread, other threads:[~2005-08-15 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-15 15:03 Problems with display-pixels-per-inch variable Kim F. Storm
2005-08-15 15:31 ` Jason Rumney
2005-08-15 16:31 ` Thien-Thi Nguyen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).