* 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).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
diff --git a/ChangeLog b/ChangeLog
index 59155c0..5eab0e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-07-26 Søren Sandmann <sandmann@daimi.au.dk>
+
+ * 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 <darren.longhorn@redcom.co.uk>
+
+ * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize
+ five-byte `long' (which is avoided then).
+
2004-07-25 Detlef Würkner <TetiSoft@apg.lahn.de>
* src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not
@@ -17,7 +28,7 @@
2004-07-24 Derek B. Noonburg <derekn@foolabs.com>
* 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 <wl@gnu.org>
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index 4bd8cf6..e878efb 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 > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
#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 == 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 ddb9b09..e47a684 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 383daaa..61af96f 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;