freetype
[Top][All Lists]
Advanced

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

Re: [ft] Why is FT_F26Dot6 defined as a signed long


From: Werner LEMBERG
Subject: Re: [ft] Why is FT_F26Dot6 defined as a signed long
Date: Sat, 16 Feb 2019 07:16:18 +0100 (CET)

>> On the other hand, using a 64bit entity has the advantage of
>> tagging an unsigned 32bit value as `not set', for example, by
>> assigning value -1 to it.
> 
> Interesting, but on a 32bit platform, with long == 32 bits, that
> wouldn't work.

Ah, thinko.  What I wanted to say is

  On the other hand, using a 32bit entity has the advantage of tagging
  an unsigned 16bit value as `not set', for example, by assigning
  value -1 to it.

and this is not relevant to the discussion :-) From FreeType's point
of view we assume `long' to be 32bit or larger.

> After getting this email I tried changing FT_F2Dot14 to
> FT_Int16. And FT_F26Dot6 and FT_Fixed to FT_Int32. I "fixed" of all
> of the compiler warnings I'd caused and got it compile, but my test
> program failed with memory corruption issues when loading a font.
> 
> Attached is git diff of the change on top of VER-2-9-1 if you care
> to look.  I suspect the problem is associated with one or more of
> the changes from FT_Long* to FT_Fixed* in the lower level code.

Thanks, but no time right now for that, alas.

> [...]  So at line 298 in update-types.patch I changed afwrap.h so
> a_delta is a FT_Pos:
> 
> diff --git a/src/autofit/afwarp.h b/src/autofit/afwarp.h
> index 520b1be90..21defce8f 100644
> --- a/src/autofit/afwarp.h
> +++ b/src/autofit/afwarp.h
> @@ -52,7 +52,7 @@ FT_BEGIN_HEADER
>                       AF_GlyphHints  hints,
>                       AF_Dimension   dim,
>                       FT_Fixed      *a_scale,
> -                     FT_Fixed      *a_delta );
> +                     FT_Pos        *a_delta );

Applied to git, thanks!


    Werner



reply via email to

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