freetype
[Top][All Lists]
Advanced

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

Re: [ft] Freetype 2.4.4 -> freetype 2.4.12: FT_Get_Advance changed behav


From: Gregor Mückl
Subject: Re: [ft] Freetype 2.4.4 -> freetype 2.4.12: FT_Get_Advance changed behaviour?
Date: Tue, 04 Jun 2013 00:12:37 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 6/3/2013 9:05 AM, Werner LEMBERG wrote:

I've reduced my code to the attached program (which is still a bit
convoluted - sorry!).  [...]

Thanks.  There was a serious bug in FT_Get_Advance which has been
fixed in version 2.4.9: According to the documentation, the returned
advance value is either in 16.16 format or in font units.  Before the
fix this was true only if it was possible to quickly retrieve the
advance value, which is not the case for hinted TT fonts.  You
probably hadn't noticed that you circumvented the bug by using the
26.6 format, together with undoing the wrong double scaling,
right? :-)

The fix is rather simple (see below) if you want to stay with
computing everything in 26.6 format.


     Werner


Thank you very much for looking into this! The suggested fix works nicely. I vaguely recall that I was fiddling with this scaling when I originally wrote this code because it was behaving wrong in *some* way. But I must have been very tired to not figure out that something was amiss here :).

I looked at the documentation for FT_Get_Advance again. I'm using FT_LOAD_DEFAULT as flags, but the return value is in a 16.16 scaling. Yet, the documentation states:

"By default, the unhinted advance is returned in font units."

To me, this reads like a (probably unwanted) contradiction to the actual behaviour. I suggest something like the following instead:


"The returned advance depends on whether scaling is performed (based on the value of flags). If scaling is performed, the advance is in 16.16 format. Otherwise, it is in font units."

Regards,
Gregor




reply via email to

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