From 29996054072996d62ab3ad608be00cc2e2dc4835 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 14 Mar 2002 09:01:32 +0000 Subject: [PATCH] * include/freetype/internal/fnttypes.h, src/winfnt/*.c: updating the type definitions of the Windows FNT font driver --- ChangeLog | 2 ++ include/freetype/internal/fnttypes.h | 30 ++++++++--------- src/winfonts/winfnt.c | 50 ++++++++++++++-------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5a3340ad..ccce22371 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ (i.e. CFF_Font => CFF_FontRec CFF_Font* => CFF_Font, etc...) + * include/freetype/internal/fnttypes.h, src/winfnt/*.c: updating + the type definitions of the Windows FNT font driver 2002-03-13 Antoine Leca diff --git a/include/freetype/internal/fnttypes.h b/include/freetype/internal/fnttypes.h index 31edaa978..fbefa4b21 100644 --- a/include/freetype/internal/fnttypes.h +++ b/include/freetype/internal/fnttypes.h @@ -28,26 +28,26 @@ FT_BEGIN_HEADER - typedef struct WinMZ_Header_ + typedef struct WinMZ_HeaderRec_ { FT_UShort magic; /* skipped content */ FT_UShort lfanew; - } WinMZ_Header; + } WinMZ_HeaderRec; - typedef struct WinNE_Header_ + typedef struct WinNE_HeaderRec_ { FT_UShort magic; /* skipped content */ FT_UShort resource_tab_offset; FT_UShort rname_tab_offset; - } WinNE_Header; + } WinNE_HeaderRec; - typedef struct WinNameInfo_ + typedef struct WinNameInfoRec_ { FT_UShort offset; FT_UShort length; @@ -56,22 +56,22 @@ FT_BEGIN_HEADER FT_UShort handle; FT_UShort usage; - } WinNameInfo; + } WinNameInfoRec; - typedef struct WinResourceInfo_ + typedef struct WinResourceInfoRec_ { FT_UShort type_id; FT_UShort count; - } WinResourceInfo; + } WinResourceInfoRec; #define WINFNT_MZ_MAGIC 0x5A4D #define WINFNT_NE_MAGIC 0x454E - typedef struct WinFNT_Header_ + typedef struct WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; @@ -110,26 +110,26 @@ FT_BEGIN_HEADER FT_UShort color_table_offset; FT_Byte reserved2[4]; - } WinFNT_Header; + } WinFNT_HeaderRec, *WinFNT_Header; - typedef struct FNT_Font_ + typedef struct FNT_FontRec_ { FT_ULong offset; FT_Int size_shift; - WinFNT_Header header; + WinFNT_HeaderRec header; FT_Byte* fnt_frame; FT_ULong fnt_size; - } FNT_Font; + } FNT_FontRec, *FNT_Font; typedef struct FNT_SizeRec_ { FT_SizeRec root; - FNT_Font* font; + FNT_Font font; } FNT_SizeRec, *FNT_Size; @@ -139,7 +139,7 @@ FT_BEGIN_HEADER FT_FaceRec root; FT_UInt num_fonts; - FNT_Font* fonts; + FNT_Font fonts; FT_CharMap charmap_handle; FT_CharMapRec charmap; /* a single charmap per face */ diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c index 4a85efb03..e26797c93 100644 --- a/src/winfonts/winfnt.c +++ b/src/winfonts/winfnt.c @@ -41,7 +41,7 @@ const FT_Frame_Field winmz_header_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE WinMZ_Header +#define FT_STRUCTURE WinMZ_HeaderRec FT_FRAME_START( 64 ), FT_FRAME_USHORT_LE ( magic ), @@ -54,7 +54,7 @@ const FT_Frame_Field winne_header_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE WinNE_Header +#define FT_STRUCTURE WinNE_HeaderRec FT_FRAME_START( 40 ), FT_FRAME_USHORT_LE ( magic ), @@ -68,7 +68,7 @@ const FT_Frame_Field winfnt_header_fields[] = { #undef FT_STRUCTURE -#define FT_STRUCTURE WinFNT_Header +#define FT_STRUCTURE WinFNT_HeaderRec FT_FRAME_START( 134 ), FT_FRAME_USHORT_LE( version ), @@ -112,7 +112,7 @@ static void - fnt_font_done( FNT_Font* font, + fnt_font_done( FNT_Font font, FT_Stream stream ) { if ( font->fnt_frame ) @@ -124,11 +124,11 @@ static FT_Error - fnt_font_load( FNT_Font* font, + fnt_font_load( FNT_Font font, FT_Stream stream ) { FT_Error error; - WinFNT_Header* header = &font->header; + WinFNT_Header header = &font->header; /* first of all, read the FNT header */ @@ -171,8 +171,8 @@ { FT_Memory memory = FT_FACE(face)->memory; FT_Stream stream = FT_FACE(face)->stream; - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + face->num_fonts; + FNT_Font cur = face->fonts; + FNT_Font limit = cur + face->num_fonts; for ( ; cur < limit; cur++ ) @@ -189,7 +189,7 @@ FT_Error error; FT_Stream stream = FT_FACE(face)->stream; FT_Memory memory = FT_FACE(face)->memory; - WinMZ_Header mz_header; + WinMZ_HeaderRec mz_header; face->fonts = 0; @@ -204,7 +204,7 @@ if ( mz_header.magic == WINFNT_MZ_MAGIC ) { /* yes, now look for a NE header in the file */ - WinNE_Header ne_header; + WinNE_HeaderRec ne_header; if ( FILE_Seek( mz_header.lfanew ) || @@ -261,7 +261,7 @@ } if ( FILE_Seek( font_offset ) || - ALLOC_ARRAY( face->fonts, font_count, FNT_Font ) ) + ALLOC_ARRAY( face->fonts, font_count, FNT_FontRec ) ) goto Exit; face->num_fonts = font_count; @@ -271,8 +271,8 @@ /* now read the offset and position of each FNT font */ { - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + font_count; + FNT_Font cur = face->fonts; + FNT_Font limit = cur + font_count; for ( ; cur < limit; cur++ ) @@ -287,8 +287,8 @@ /* finally, try to load each font there */ { - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + font_count; + FNT_Font cur = face->fonts; + FNT_Font limit = cur + font_count; for ( ; cur < limit; cur++ ) @@ -326,7 +326,7 @@ fnt_cmap_init( FT_CMap cmap ) { FNT_Face face = (FNT_Face) FT_CMAP_FACE(cmap); - FNT_Font* font = face->fonts; + FNT_Font font = face->fonts; cmap->first = (FT_UInt32) font->header.first_char; cmap->count = (FT_UInt32)(font->header.last_char - cmap->first + 1); @@ -399,7 +399,7 @@ if ( charmap ) { - FNT_Font* font = ((FNT_Face)charmap->face)->fonts; + FNT_Font font = ((FNT_Face)charmap->face)->fonts; FT_Long first = font->header.first_char; FT_Long count = font->header.last_char - first + 1; @@ -422,7 +422,7 @@ char_code++; if ( charmap ) { - FNT_Font* font = ((FNT_Face)charmap->face)->fonts; + FNT_Font font = ((FNT_Face)charmap->face)->fonts; FT_Long first = font->header.first_char; @@ -472,7 +472,7 @@ if ( error ) { /* this didn't work, now try to load a single FNT font */ - FNT_Font* font; + FNT_Font font; if ( ALLOC( face->fonts, sizeof ( *face->fonts ) ) ) goto Exit; @@ -492,9 +492,9 @@ /* fill the root FT_Face fields with relevant information */ { FT_Face root = FT_FACE( face ); - FNT_Font* fonts = face->fonts; - FNT_Font* limit = fonts + face->num_fonts; - FNT_Font* cur; + FNT_Font fonts = face->fonts; + FNT_Font limit = fonts + face->num_fonts; + FNT_Font cur; root->num_faces = 1; @@ -595,8 +595,8 @@ { /* look up a font corresponding to the current pixel size */ FNT_Face face = (FNT_Face)FT_SIZE_FACE( size ); - FNT_Font* cur = face->fonts; - FNT_Font* limit = cur + face->num_fonts; + FNT_Font cur = face->fonts; + FNT_Font limit = cur + face->num_fonts; size->font = 0; @@ -626,7 +626,7 @@ FT_UInt glyph_index, FT_Int load_flags ) { - FNT_Font* font = size->font; + FNT_Font font = size->font; FT_Error error = 0; FT_Byte* p; FT_Int len;