getFontHeight() not consistent (was)Re: Systematic error on display versus layout units.


Subject: getFontHeight() not consistent (was)Re: Systematic error on display versus layout units.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Fri Jun 29 2001 - 01:30:38 CDT


On Fri, 29 Jun 2001, Martin Sevior wrote:

>
>
> On Thu, 28 Jun 2001, Martin Sevior wrote:
>
> > Hi Folks,
> > I've spent the last couple of days fighting with 1632. Basically
> > our text in left justified mode can easily extend way past the right
> > margin.
> >
> > This is caused by a systematic errors between font sizes at screen
> > resolution and font sizes at Layout resolution. Relative to the screen
> > resolution, the layout resolution of the Type 1 fonts that ship with Abi
> > are smaller by a few %.
> >
>
> I know the problem now:-) The calculation of the correct font is current
> getting the closest size font to that need at poor resolution, then again
> at high resolution. The poor resolution font can be wrong by 1 units out
> of about 25 for 12 point fonts. This leads to a few percent error due to
> rounding at poor resolution (about 1 unit out of 25) so that that's about
> 4 %.

Well I have spent many more hours on this I've finally discovered that for
our Type 1, Fonts, under gdk, getFontAscent() != getFontAscent() from the
postscript afm file. Is this a bug in our fonts or a fundamental flaw in
the concept of font Ascent and BBox box afm files?

This is sufficient to screw up our pagination quite significantly between
what is one the screen and what comes out on a page.

What can be done about this? Well if it is a bug in the fonts, we could
upgrade the fonts.

If it is a fundamental difference, a solution would be be to cache the
value of fontAscent and fontDescent from the gdk fonts in the Post Script
font handling class and use that for calculating fontheights for
postscript.

Luckily we have Post Script and PDF experts on the mailing list. What say
you LDR and Dom?

Cheers

Martin



This archive was generated by hypermail 2b25 : Fri Jun 29 2001 - 01:30:58 CDT