From f1ca234473bcae8c1c09e5ed1aaa8a6ae403d3d3 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 29 Nov 2000 15:18:54 +0000 Subject: [PATCH] * src/sfnt/sfdriver.c: Include ttsbit.h and ttpost.h only conditionally. * src/truetype/ttdriver.c (Set_Char_Sizes, Set_Pixel_Sizes): Set `size->strike_index' only conditionally. * src/type1/t1driver.c, src/type1/t1objs.c: Include t1afm.h only conditionally. * src/winfonts/winfnt.h: Move all type definitions to... * src/include/freetype/internal/fnttypes.h: New file. * src/winfonts/winfnt.c: Use it. * include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT with a direct solution (which also satifies picky compilers). --- ChangeLog | 20 +++++ include/freetype/internal/ftdebug.h | 15 +--- src/sfnt/sfdriver.c | 20 ++++- src/truetype/ttdriver.c | 4 + src/type1/t1driver.c | 6 ++ src/type1/t1objs.c | 6 ++ src/winfonts/winfnt.c | 1 + src/winfonts/winfnt.h | 119 ---------------------------- 8 files changed, 55 insertions(+), 136 deletions(-) diff --git a/ChangeLog b/ChangeLog index b19e908b0..d0e99df15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2000-11-29 Werner Lemberg + + * src/sfnt/sfdriver.c: Include ttsbit.h and ttpost.h only + conditionally. + + * src/truetype/ttdriver.c (Set_Char_Sizes, Set_Pixel_Sizes): Set + `size->strike_index' only conditionally. + + * src/type1/t1driver.c, src/type1/t1objs.c: Include t1afm.h only + conditionally. + + * src/winfonts/winfnt.h: Move all type definitions to... + * src/include/freetype/internal/fnttypes.h: New file. + * src/winfonts/winfnt.c: Use it. + +2000-11-29 ??? ??? + + * include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT + with a direct solution (which also satifies picky compilers). + 2000-11-28 YAMANO-UCHI Hidetoshi * src/truetype/ttobjs.c (TT_Init_Size): Fix #ifdef's to work with diff --git a/include/freetype/internal/ftdebug.h b/include/freetype/internal/ftdebug.h index 935998497..36c60e2fb 100644 --- a/include/freetype/internal/ftdebug.h +++ b/include/freetype/internal/ftdebug.h @@ -27,17 +27,6 @@ #endif - /* A very stupid pre-processor trick. See K&R version 2 */ - /* section A12.3 for details... */ - /* */ - /* It is also described in the section `Separate */ - /* Expansion of Macro Arguments' in the info file */ - /* `cpp.info', describing GNU cpp. */ - /* */ -#define FT_CAT( x, y ) x ## y -#define FT_XCAT( x, y ) FT_CAT( x, y ) - - #ifdef FT_DEBUG_LEVEL_TRACE @@ -134,7 +123,7 @@ do \ { \ if ( ft_trace_levels[FT_COMPONENT] >= level ) \ - FT_XCAT( FT_Message, varformat ); \ + FT_Message varformat; \ } while ( 0 ) @@ -205,7 +194,7 @@ /* print a message and exit */ FT_EXPORT( void ) FT_Panic( const char* fmt, ... ); -#define FT_ERROR( varformat ) FT_XCAT( FT_Message, varformat ) +#define FT_ERROR( varformat ) FT_Message varformat #endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */ diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index a2d28c056..4df3c6963 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -24,20 +24,32 @@ #include "sfdriver.h" #include "ttload.h" -#include "ttsbit.h" -#include "ttpost.h" #include "ttcmap.h" #include "sfobjs.h" +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#include "ttsbit.h" +#endif + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES +#include "ttpost.h" +#endif + #else #include #include -#include -#include #include #include +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#include +#endif + +#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES +#include +#endif + #endif diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 40b38371f..cddd40794 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -225,7 +225,9 @@ } size->ttmetrics.valid = FALSE; +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS size->strike_index = 0xFFFF; +#endif return TT_Reset_Size( size ); } @@ -262,7 +264,9 @@ /* many things have been pre-computed by the base layer */ size->ttmetrics.valid = FALSE; +#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS size->strike_index = 0xFFFF; +#endif return TT_Reset_Size( size ); } diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index f513e65ab..ea8ab911c 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -21,14 +21,20 @@ #include "t1driver.h" #include "t1gload.h" #include "t1load.h" + +#ifndef T1_CONFIG_OPTION_NO_AFM #include "t1afm.h" +#endif #else #include #include #include + +#ifndef T1_CONFIG_OPTION_NO_AFM #include +#endif #endif diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index 65c3344fb..101e7f3c3 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -26,13 +26,19 @@ #include "t1gload.h" #include "t1load.h" + +#ifndef T1_CONFIG_OPTION_NO_AFM #include "t1afm.h" +#endif #else #include #include + +#ifndef T1_CONFIG_OPTION_NO_AFM #include +#endif #endif diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c index 36410791e..5c759d7e3 100644 --- a/src/winfonts/winfnt.c +++ b/src/winfonts/winfnt.c @@ -31,6 +31,7 @@ #include #include #include +#include /*************************************************************************/ diff --git a/src/winfonts/winfnt.h b/src/winfonts/winfnt.h index 0acc04e6a..ba215b761 100644 --- a/src/winfonts/winfnt.h +++ b/src/winfonts/winfnt.h @@ -27,125 +27,6 @@ #endif - typedef struct WinMZ_Header_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort lfanew; - - } WinMZ_Header; - - - typedef struct WinNE_Header_ - { - FT_UShort magic; - /* skipped content */ - FT_UShort resource_tab_offset; - FT_UShort rname_tab_offset; - - } WinNE_Header; - - - typedef struct WinNameInfo_ - { - FT_UShort offset; - FT_UShort length; - FT_UShort flags; - FT_UShort id; - FT_UShort handle; - FT_UShort usage; - - } WinNameInfo; - - - typedef struct WinResourceInfo_ - { - FT_UShort type_id; - FT_UShort count; - - } WinResourceInfo; - - -#define WINFNT_MZ_MAGIC 0x5A4D -#define WINFNT_NE_MAGIC 0x454E - - - typedef struct WinFNT_Header_ - { - FT_UShort version; - FT_ULong file_size; - FT_Byte copyright[60]; - FT_UShort file_type; - FT_UShort nominal_point_size; - FT_UShort vertical_resolution; - FT_UShort horizontal_resolution; - FT_UShort ascent; - FT_UShort internal_leading; - FT_UShort external_leading; - FT_Byte italic; - FT_Byte underline; - FT_Byte strike_out; - FT_UShort weight; - FT_Byte charset; - FT_UShort pixel_width; - FT_UShort pixel_height; - FT_Byte pitch_and_family; - FT_UShort avg_width; - FT_UShort max_width; - FT_Byte first_char; - FT_Byte last_char; - FT_Byte default_char; - FT_Byte break_char; - FT_UShort bytes_per_row; - FT_ULong device_offset; - FT_ULong face_name_offset; - FT_ULong bits_pointer; - FT_ULong bits_offset; - FT_Byte reserved; - FT_ULong flags; - FT_UShort A_space; - FT_UShort B_space; - FT_UShort C_space; - FT_UShort color_table_offset; - FT_Byte reserved2[4]; - - } WinFNT_Header; - - - typedef struct FNT_Font_ - { - FT_ULong offset; - FT_Int size_shift; - - WinFNT_Header header; - - FT_Byte* fnt_frame; - FT_ULong fnt_size; - - } FNT_Font; - - - typedef struct FNT_SizeRec_ - { - FT_SizeRec root; - FNT_Font* font; - - } FNT_SizeRec, *FNT_Size; - - - typedef struct FNT_FaceRec_ - { - FT_FaceRec root; - - FT_UInt num_fonts; - FNT_Font* fonts; - - FT_CharMap charmap_handle; - FT_CharMapRec charmap; /* a single charmap per face */ - - } FNT_FaceRec, *FNT_Face; - - FT_EXPORT_VAR( const FT_Driver_Class ) winfnt_driver_class;