freetype
[Top][All Lists]
Advanced

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

[Freetype] Follow up to CHAR_BIT to allow Texas 16bit chars.


From: bytesoftware
Subject: [Freetype] Follow up to CHAR_BIT to allow Texas 16bit chars.
Date: Thu, 15 Apr 2004 18:16:55 +0100
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

I note the changes in ftconfig.h made by Werner.

I believe the following changes should also be made to that file and ftstream.c.

----------------------------------------------------------------
Change - FTConfig.h Lines 125-159

/*************************************************************************/ /* */ /* IntN types */ /* */ /* Used to guarantee the size of some specific integers. */ /* */
 typedef signed short    FT_Int16;
 typedef unsigned short  FT_UInt16;

#if FT_SIZEOF_INT == (32 / CHAR_BIT)

 typedef signed int      FT_Int32;
 typedef unsigned int    FT_UInt32;

#elif FT_SIZEOF_LONG == (32 / CHAR_BIT)

 typedef signed long     FT_Int32;
 typedef unsigned long   FT_UInt32;

#else
#error "no 32bit type found -- please check your configuration files"
#endif

 /* look up an integer type that is at least 32 bits */
#if FT_SIZEOF_INT >= (32 / CHAR_BIT)

 typedef int            FT_Fast;
 typedef unsigned int   FT_UFast;

#elif FT_SIZEOF_LONG >= (32 / CHAR_BIT)

 typedef long           FT_Fast;
 typedef unsigned long  FT_UFast;

#endif

------------------------------------------------------------------------------------------------------------------

Here 4 has been replaced with (32/CHAR_BIT) otherwise we get the "no 32bit..." error.

Also the following change is required
------------------------------------------------------------------------------------------------------------------
Change - FTStream.c Lines 770-782

  p = (FT_Byte*)structure + fields->offset;
switch ( fields->size )
     {
     case (8/CHAR_BIT):
       *(FT_Byte*)p = (FT_Byte)value;
       break;
     case (16/CHAR_BIT):
       *(FT_UShort*)p = (FT_UShort)value;
       break;
     case (32/CHAR_BIT):
       *(FT_UInt32*)p = (FT_UInt32)value;
       break;
------------------------------------------------------------------------------------------------------------------
Where CHAR_BIT is 8 this will give you case 1: , 2: and 4: as before. On the Texas it will give cases 0:, 1: and 2: , FT_Byte and FT_UShort
are both 16bit so it does not matter that 0: is never used.

Porting continues, I will keep you informed.

/Ashley.





reply via email to

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