emacs-devel
[Top][All Lists]
Advanced

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

Re: display-mm-width return value off on Windows


From: David Kastrup
Subject: Re: display-mm-width return value off on Windows
Date: Mon, 10 Jul 2006 16:19:29 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Jason Rumney <address@hidden> writes:

> David Kastrup wrote:
>>
>> Whatever solution is chosen in the end: it is important that the same
>> algorithm is used for converting point size of fonts into pixel size
>> and vice versa.
>>
>> preview-latex needs to guess how many pixels a given font will occupy
>> on the screen in order to create graphics matching in size.  And the
>> font sizes are returned in points, namely physical dimensions
> At least on Windows, point sizes for fonts are based on user
> configuration, not the actual physical size of the monitor.
> So I don't think you should be using display-mm-* for calculating
> sizes you expect to be relative to fonts anyway.
> Why not use the pixel size of the font? Surely that will be more
> accurate for the purpose you want.

It is not available.  We are talking about the design size of a font
here, not the line spacing (the latter could be deduced from frame
pixel height and stuff): the _design_ size of the default font needs
to get matched to the design size of the TeX constructs made into
bitmaps.

The only face-attribute we have available here is

`:height'
     Either the font height, an integer in units of 1/10 point, a
     floating point number specifying the amount by which to scale the
     height of any underlying face, or a function, which is called with
     the old height (from the underlying face), and should return the
     new height.

Of course, after resolving the font specification, an integer in units
of 1/10 point is the ultimate result.

And we need to recast this value into pixels, then let bitmaps be
generated that occupy _that_ number of pixels for the default design
size of the _TeX_ document.

When this is done, the design size of the default font of Emacs and of
the default font of the TeX document are _matched_, expressed in the
number of screen pixels.

And for that it is necessary that Emacs and/or Windows convert the
points to pixels in a predictable way, and the display geometry is the
only pointer we have for that.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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