freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Getting accurate advances


From: David Bevan
Subject: Re: [Devel] Getting accurate advances
Date: Mon, 17 Nov 2003 10:10:35 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02


Werner LEMBERG wrote:
Note that the rounding occurs in the calculation for dim_x.


Oops, I missed that.


Changing this to:

  dim_x = ( char_width * horz_resolution + 36 ) / 72;

  metrics->x_ppem  = (FT_UShort)( ( dim_x + 32 ) >> 6 );

  metrics->x_scale = FT_DivFix( dim_x, face->units_per_EM );

produces the correct advances when used with your suggested change -
*but* this changes the x_scale value used throughout all resizing,
rendering, hinting, etc.  Is this change correct or dangerous?


I think it is correct, and the optical appearance will become better.
Have you actually done some testing already?

I have done only very limited testing (with no problems). However, our product works at printer resolutions (e.g. 300 or 600dpi) monochrome, so I won't be testing at low (screen) resolutions or using grey-scale.

It may be tomorrow before I can make the change properly and begin more thorough testing.

Other similar code (producing rounded x_scale values) can be found at ftobjs.c line 2081, pfdrivr.c line 102, and ttdrivr.c line 224. I presume those should also be changed?

Has the x_scale value always been wrong or does it need to be
rounded for some reason?


I couldn't find an entry in the ChangeLog file thus I assume that it
has always been wrong.  There was an improvement to round correctly
(the `36+72*72' stuff) but the rounding itself was always there.


    Werner



--
 ________________________________________________________
 David Bevan, Emtex Ltd.
 Emtex House, Station Road, Kings Langley, Herts. WD4 8LH England
 Tel:    +44 (0)1923 270882
 E-mail: address@hidden
 Web:    www.emtex.com




reply via email to

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