From 004f3da80a5d9c8a0feebb2bcce80d9b7566c94f Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 28 Jul 2004 00:09:02 +0000 Subject: [PATCH] * src/pcf/pcfread.c (pcf_interpret_style): Always allocate memory for face->style_name. * src/pcf/pcfdrivr.c (PCF_Face_Done): Free `style_name'. * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize five-byte `long' (which is avoided then). --- ChangeLog | 13 ++++++++++++- include/freetype/config/ftconfig.h | 17 ++++++++++------- src/pcf/pcfdrivr.c | 1 + src/pcf/pcfread.c | 7 ++++++- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59155c09f..5eab0e31a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-07-26 Søren Sandmann + + * src/pcf/pcfread.c (pcf_interpret_style): Always allocate memory for + face->style_name. + * src/pcf/pcfdrivr.c (PCF_Face_Done): Free `style_name'. + +2004-07-26 Darren J Longhorn + + * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize + five-byte `long' (which is avoided then). + 2004-07-25 Detlef Würkner * src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not @@ -17,7 +28,7 @@ 2004-07-24 Derek B. Noonburg * src/cff/cffload.c (cff_font_load): Always create inverse mapping. - Even if the charstring count id different from the CID count, it is + Even if the charstring count is the same as the CID count, it is still possible that the font uses a different CID -> GID mapping. 2004-07-23 Werner Lemberg diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h index 4bd8cf617..e878efba1 100644 --- a/include/freetype/config/ftconfig.h +++ b/include/freetype/config/ftconfig.h @@ -72,20 +72,23 @@ FT_BEGIN_HEADER /* The size of an `int' type. */ -#if FT_UINT_MAX == 0xFFFFFFFFUL -#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) -#elif FT_UINT_MAX == 0xFFFFU +#if FT_UINT_MAX == 0xFFFFUL #define FT_SIZEOF_INT (16 / FT_CHAR_BIT) -#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU +#elif FT_UINT_MAX == 0xFFFFFFFFUL +#define FT_SIZEOF_INT (32 / FT_CHAR_BIT) +#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL #define FT_SIZEOF_INT (64 / FT_CHAR_BIT) #else #error "Unsupported size of `int' type!" #endif - /* The size of a `long' type. */ -#if FT_ULONG_MAX == 0xFFFFFFFFUL + /* The size of a `long' type. A five-byte `long' (as used e.g. on the */ + /* DM642) is recognized but avoided. */ +#if FT_ULONG_MAX == 0xFFFFFFFFUL #define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) -#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU +#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL +#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT) +#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL #define FT_SIZEOF_LONG (64 / FT_CHAR_BIT) #else #error "Unsupported size of `long' type!" diff --git a/src/pcf/pcfdrivr.c b/src/pcf/pcfdrivr.c index ddb9b093e..e47a68452 100644 --- a/src/pcf/pcfdrivr.c +++ b/src/pcf/pcfdrivr.c @@ -221,6 +221,7 @@ THE SOFTWARE. FT_FREE( face->toc.tables ); FT_FREE( pcfface->family_name ); + FT_FREE( pcfface->style_name ); FT_FREE( pcfface->available_sizes ); FT_FREE( face->charset_encoding ); FT_FREE( face->charset_registry ); diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index 383daaa1c..61af96f97 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -945,7 +945,12 @@ THE SOFTWARE. } if ( !parts || !len ) - face->style_name = (char *)"Regular"; + { + if ( FT_ALLOC( face->style_name, 8 ) ) + return error; + ft_strcpy( face->style_name, "Regular" ); + face->style_name[7] = '\0'; + } else { char *style, *s;