|
From: | David Bevan |
Subject: | Re: [Devel] Getting accurate advances |
Date: | Mon, 17 Nov 2003 16:11:00 +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:
Other similar code (producing rounded x_scale values) can be found at ftobjs.c line 2081Do you mean this (y components omitted)? FT_Set_Pixel_Sizes( FT_Face face,FT_UInt pixel_width, FT_UInt pixel_height ){ ... metrics->x_ppem = (FT_UShort)pixel_width; if ( face->face_flags & FT_FACE_FLAG_SCALABLE ) { metrics->x_scale = FT_DivFix( metrics->x_ppem << 6, face->units_per_EM ); ft_recompute_scaled_metrics( face, metrics ); } ... Isn't this already correct? Here, x_ppem is indeed an integer value.pfrdrivr.c line 102,Probably yes, but I have no idea how PFR fonts work.and ttdriver.c line 224.Mhm, rather no. This code modifies the x_scale value for the hinting engine only, as far as I can see. It doesn't influence linearHoriAdvance.
Werner, Thansk for your feedback.However, I think your responses explain why I'm unwilling to change the calculation of x_scale. I don't know why x_scale is set to different values in different contexts or what uses are made of it after it is set.
So, I don't know why you think FT_Set_Pixel_Sizes() is correct, or why ttdrivr doesn't need changing, or why you guess that the pfrdrivr code should be changed (though I can't actually see how it could be changed).
All I do know is that x_scale is used in various ways and that the value stored in it isn't currently acceptable for calculating linearHoriAdvance.
And I worry that if there's a good reason for x_ppem to be rounded to the nearest pixel (for hinting to work correctly?), then perhaps it's important that the scale factor is adjusted (as it is) to match the adjusted x_ppem.
I'm sorry I can't really help you much more than to point out the problem, but I don't understand very much about the innards of FreeType.
For now I think I may just stick with my work-around. Anyone else got any views on this? David %^> -- ________________________________________________________ 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
[Prev in Thread] | Current Thread | [Next in Thread] |