From e207d2671c3db087f0ec1b9f6594f1746ca16fa7 Mon Sep 17 00:00:00 2001 From: tobigun Date: Fri, 23 Apr 2010 21:06:38 +0000 Subject: byte order of some C enums was incorrect git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2286 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/freetype/freetype.pas | 78 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 10 deletions(-) (limited to 'src/lib/freetype/freetype.pas') diff --git a/src/lib/freetype/freetype.pas b/src/lib/freetype/freetype.pas index 6aaa3b59..01f507bc 100644 --- a/src/lib/freetype/freetype.pas +++ b/src/lib/freetype/freetype.pas @@ -150,6 +150,34 @@ const FT_FACE_FLAG_SCALABLE = 1 shl 0; FT_FACE_FLAG_KERNING = 1 shl 6; + (*************************************************************************) + (* *) + (* *) + (* FT_ENC_TAG *) + (* *) + (* *) + (* This macro converts four-letter tags into an unsigned long. It is *) + (* used to define `encoding' identifiers (see @FT_Encoding). *) + (* *) + (* *) + (* Since many 16-bit compilers don't like 32-bit enumerations, you *) + (* should redefine this macro in case of problems to something like *) + (* this: *) + (* *) + (* { *) + (* #define FT_ENC_TAG( value, a, b, c, d ) value *) + (* } *) + (* *) + (* to get a simple enumeration without assigning special numbers. *) + (* *) + { + #define FT_ENC_TAG( value, a, b, c, d ) \ + value = ( ( (FT_UInt32)(a) << 24 ) | \ + ( (FT_UInt32)(b) << 16 ) | \ + ( (FT_UInt32)(c) << 8 ) | \ + (FT_UInt32)(d) ) + } + (*************************************************************************) (* *) (* *) @@ -289,17 +317,47 @@ const (* *) type PFT_Encoding = ^FT_Encoding; - FT_Encoding = array[0..3] of char; + FT_Encoding = cint32; // 32 bit enum of FT_ENC_TAG const - FT_ENCODING_NONE: FT_Encoding = (#0 ,#0 ,#0 ,#0 ); - FT_ENCODING_MS_SYMBOL: FT_Encoding = ('s', 'y', 'm', 'b' ); - FT_ENCODING_UNICODE: FT_Encoding = ('u', 'n', 'i', 'c' ); - - FT_ENCODING_SJIS: FT_Encoding = ('s', 'j', 'i', 's'); - FT_ENCODING_GB2312: FT_Encoding = ('g', 'b', ' ', ' '); - FT_ENCODING_BIG5: FT_Encoding = ('b', 'i', 'g', '5'); - FT_ENCODING_WANSUNG: FT_Encoding = ('w', 'a', 'n', 's'); - FT_ENCODING_JOHAB: FT_Encoding = ('j', 'o', 'h', 'a'); + FT_ENCODING_NONE = (Ord(#0) shl 24) or + (Ord(#0) shl 16) or + (Ord(#0) shl 8) or + (Ord(#0) shl 0); + + FT_ENCODING_MS_SYMBOL = (Ord('s') shl 24) or + (Ord('y') shl 16) or + (Ord('m') shl 8) or + (Ord('b') shl 0); + + FT_ENCODING_UNICODE = (Ord('u') shl 24) or + (Ord('n') shl 16) or + (Ord('i') shl 8) or + (Ord('c') shl 0); + + FT_ENCODING_SJIS = (Ord('s') shl 24) or + (Ord('j') shl 16) or + (Ord('i') shl 8) or + (Ord('s') shl 0); + + FT_ENCODING_GB2312 = (Ord('g') shl 24) or + (Ord('b') shl 16) or + (Ord(' ') shl 8) or + (Ord(' ') shl 0); + + FT_ENCODING_BIG5 = (Ord('b') shl 24) or + (Ord('i') shl 16) or + (Ord('g') shl 8) or + (Ord('5') shl 0); + + FT_ENCODING_WANSUNG = (Ord('w') shl 24) or + (Ord('a') shl 16) or + (Ord('n') shl 8) or + (Ord('s') shl 0); + + FT_ENCODING_JOHAB = (Ord('j') shl 24) or + (Ord('o') shl 16) or + (Ord('h') shl 8) or + (Ord('a') shl 0); (*************************************************************************) -- cgit v1.2.3