Klaus Straubinger | 14 Mar 17:12

Re: wrong font-size calculations in css.el and font.el

Magnus Henoch wrote:

> Klaus Straubinger <KSNetz <at> UseNet.ArcorNews.DE> writes:

>> The function css-expand-length does not take the default character size
>> in pixels into account when calculating em and ex values. This results
>> typically in values very much too large.

> I'm not quite sure about this anymore... It seems to me that
> css-expand-length is supposed to return the number of character cells
> needed to fill the given length

Well, I only proposed a change to remove an inconsistency I observed.
The percentage case of the function obviously returns pixel values, by
multiplying with (frame-char-height) or (frame-char-width), respectively.

I now see that there still is an inconsistency because the last case
and my proposed correction use font-spatial-to-canonical which returns
points, not pixels. Of course, on many displays that is not much of a
difference so it went unnoticed.

> What problem was this change supposed to solve?

I saw extraordinarily large characters when a style sheet specified em
or ex values.

I would like to see the function css-expand-length brought to full
consistency, i.e., it should always return a number in the same unit
of measurement, and the callers of this function should be adapted to
work with that unit (I only thought of the font-size case, admittedly).

--

-- 
Klaus Straubinger

Gmane