From 1ab77fdfffe083dea6e5e9e657d4447632ee1949 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 10 Feb 2000 18:08:17 +0000 Subject: [PATCH] some updates to make everything compile clean --- src/psnames/rules.mk | 4 +-- src/truetype/ttconfig.h | 6 ++-- src/truetype/ttinterp.c | 5 ++++ src/type1/t1afm.c | 4 +-- src/type1/t1config.h | 4 +-- src/type1/t1driver.c | 62 ++++++----------------------------------- src/type1/t1gload.c | 7 +++-- src/type1/type1.c | 10 ------- 8 files changed, 26 insertions(+), 76 deletions(-) diff --git a/src/psnames/rules.mk b/src/psnames/rules.mk index b9e01b73f..027c7e043 100644 --- a/src/psnames/rules.mk +++ b/src/psnames/rules.mk @@ -76,11 +76,9 @@ $(PSNAMES_DRV_OBJ_S): $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) $(PSNAMES_DRV_SRC) # # All objects are recompiled if any of the header files is changed # -$(OBJ_)tt%.$O: $(PSNAMES_DIR_)tt%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) +$(OBJ_)ps%.$O: $(PSNAMES_DIR_)ps%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) $(PSNAMES_COMPILE) $T$@ $< -$(OBJ_)sf%.$O: $(PSNAMES_DIR_)sf%.c $(BASE_H) $(SHARED_H) $(PSNAMES_DRV_H) - $(PSNAMES_COMPILE) $T$@ $< # update main driver object lists # diff --git a/src/truetype/ttconfig.h b/src/truetype/ttconfig.h index eba0de310..ec454fe52 100644 --- a/src/truetype/ttconfig.h +++ b/src/truetype/ttconfig.h @@ -37,7 +37,7 @@ /* By undefining this, you'll only compile the code necessary to load */ /* TrueType glyphs without hinting.. */ /* */ -#undef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ /* */ @@ -57,7 +57,7 @@ /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ /* embedded bitmaps in the TrueType/OpenType driver. */ /* */ -#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS +#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS /*************************************************************************/ @@ -66,7 +66,7 @@ /* load and enumerate the glyph Postscript names in a TrueType or */ /* OpenType file. */ /* */ -#undef TT_CONFIG_OPTION_POSTSCRIPT_NAMES +#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES /* The maximum number of sub-glyphs in a TrueType composite glyph */ #define TT_MAX_SUBGLYPHS 32 diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index b27de27e9..85d2418b2 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -20,8 +20,12 @@ #include #include +#include #include +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + #define TT_MULFIX FT_MulFix #define TT_MULDIV FT_MulDiv @@ -7964,5 +7968,6 @@ #endif /* DEBUG_INTERPRETER */ +#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ /* END */ diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c index d82390826..8b673b7dd 100644 --- a/src/type1/t1afm.c +++ b/src/type1/t1afm.c @@ -142,7 +142,7 @@ goto Exit; /* allocate the pairs */ - if ( ALLOC( afm, sizeof(*afm ) || + if ( ALLOC( afm, sizeof(*afm ) ) || ALLOC_ARRAY( afm->kern_pairs, count, T1_Kern_Pair ) ) goto Exit; @@ -151,7 +151,7 @@ afm->num_pairs = count; /* save in face object */ - ((T1_Face*)t1_face)->afm_data = afm; + ((T1_Face)t1_face)->afm_data = afm; for ( p = start; p < limit-3; p++ ) { diff --git a/src/type1/t1config.h b/src/type1/t1config.h index 7b4119bc6..9767301f9 100644 --- a/src/type1/t1config.h +++ b/src/type1/t1config.h @@ -40,13 +40,13 @@ /* Define T1_CONFIG_OPTION_DISABLE_HINTER if you want to generate */ /* a driver with no hinter. This can be useful to debug the parser */ /* */ -#define T1_CONFIG_OPTION_DISABLE_HINTER +#undef T1_CONFIG_OPTION_DISABLE_HINTER /* Define this configuration macro if you want to prevent the */ /* compilation of "t1afm", which is in charge of reading Type1 */ /* AFM files into an existing face. Note that when set, the T1 */ /* driver will be unable to produce kerning distances.. */ /* */ -#define T1_CONFIG_OPTION_NO_AFM +#undef T1_CONFIG_OPTION_NO_AFM #endif /* T1CONFIG_H */ diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index 0f6ee5447..f129d479a 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -55,8 +55,8 @@ /* time). */ /* */ static - void* Get_Interface)( FT_Driver driver, - const FT_String* interface ) + void* Get_Interface( FT_Driver driver, + const FT_String* interface ) { if ( strcmp( (const char*)interface, "attach_file" ) == 0 ) return T1_Read_AFM; @@ -140,35 +140,11 @@ T1_UInt horz_resolution, T1_UInt vert_resolution ) { - FT_Size_Metrics* metrics; - T1_Face face; - - if (!size) - return T1_Err_Invalid_Size_Handle; - - if ( char_width < 1*64 ) char_width = 1*64; - if ( char_height < 1*64 ) char_height = 1*64; + UNUSED(char_width); + UNUSED(horz_resolution); + UNUSED(vert_resolution); - metrics = &size->root.metrics; - face = (T1_Face)size->root.face; - - metrics->x_ppem = ( char_width * horz_resolution + 36 )/72; - metrics->y_ppem = ( char_height * vert_resolution + 36 )/72; - - metrics->x_ppem = ( metrics->x_ppem + 32 ) & -64; - metrics->y_ppem = ( metrics->y_ppem + 32 ) & -64; - - metrics->x_scale = FT_MulDiv( metrics->x_ppem, 0x10000, - face->root.units_per_EM ); - - metrics->y_scale = FT_MulDiv( metrics->y_ppem, 0x10000, - face->root.units_per_EM ); - - metrics->x_ppem >>= 6; - metrics->y_ppem >>= 6; - size->valid = FALSE; - return T1_Reset_Size( size ); } @@ -203,33 +179,13 @@ T1_Int pixel_width, T1_Int pixel_height ) { - FT_Size_Metrics* metrics; - T1_Face face; - - if (!size) - return T1_Err_Invalid_Size_Handle; - - if ( pixel_width < 1 ) pixel_width = 1; - if ( pixel_height < 1 ) pixel_height = 1; - - metrics = &size->root.metrics; - face = (T1_Face)size->root.face; - - metrics->x_ppem = pixel_width; - metrics->y_ppem = pixel_height; - - metrics->x_scale = FT_MulDiv( metrics->x_ppem * 64, - 0x10000, face->root.units_per_EM ); - - metrics->y_scale = FT_MulDiv( metrics->y_ppem * 64, - 0x10000, face->root.units_per_EM ); - - size->valid = 0; - + UNUSED(pixel_width); + UNUSED(pixel_height); + + size->valid = FALSE; return T1_Reset_Size(size); } - /*************************************************************************/ /* */ /* */ diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 311145cac..379870371 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -1421,11 +1421,10 @@ glyph->root.outline.n_points = 0; glyph->root.outline.n_contours = 0; - hinting = ( load_flags & FT_LOAD_NO_SCALE ) == 0 && - ( load_flags & FT_LOAD_NO_HINTING ) == 0; - glyph->root.format = ft_glyph_format_none; + hinting = 0; + #ifndef T1_CONFIG_OPTION_DISABLE_HINTER /*****************************************************************/ /* */ @@ -1442,6 +1441,8 @@ /* points as well as hint/scale them correctly. */ /* */ + hinting = (load_flags & (FT_LOAD_NO_SCALE|FT_LOAD_NO_HINTING)) == 0; + if ( hinting ) { /* Pass 1 - don't record points, simply stem hints */ diff --git a/src/type1/type1.c b/src/type1/type1.c index 2e7c80d7d..409494bdd 100644 --- a/src/type1/type1.c +++ b/src/type1/type1.c @@ -28,16 +28,6 @@ /***************************************************************************/ - -#if 0 -#define FT_MAKE_OPTION_SINGLE_OBJECT -#include /* driver interface */ -#include /* object manager */ -#include /* table loader */ -#include /* hinter */ -#include /* glyph loader */ -#endif - #include #include #include /* table loader */