* src/base/ftobjs.c (open_face): Check `clazz->init_face' and `clazz->done_face'. Update documentation of FT_Driver_ClassRec.
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
diff --git a/ChangeLog b/ChangeLog
index 283e32a..671862c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-10 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (open_face): Check `clazz->init_face' and
+ `clazz->done_face'.
+
2008-06-09 VaDiM <s_sliva@rambler.ru>
Support debugging on WinCE. From Savannah patch #6536; this fixes
diff --git a/include/freetype/internal/ftdriver.h b/include/freetype/internal/ftdriver.h
index 97f3fd0..e433e78 100644
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2006 by */
+/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -145,10 +145,6 @@ FT_BEGIN_HEADER
/* load_glyph :: A function handle to load a glyph to a slot. */
/* This field is mandatory! */
/* */
- /* get_char_index :: A function handle to return the glyph index of */
- /* a given character for a given charmap. This */
- /* field is mandatory! */
- /* */
/* get_kerning :: A function handle to return the unscaled */
/* kerning for a given pair of glyphs. Can be */
/* set to 0 if the format doesn't support */
@@ -180,8 +176,8 @@ FT_BEGIN_HEADER
/* to 0 if the scaling done in the base layer */
/* suffices. */
/* <Note> */
- /* Most function pointers, with the exception of `load_glyph' and */
- /* `get_char_index' can be set to 0 to indicate a default behaviour. */
+ /* Most function pointers, with the exception of `load_glyph', can be */
+ /* set to 0 to indicate a default behaviour. */
/* */
typedef struct FT_Driver_ClassRec_
{
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index efa5ffe..1dd3e8e 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1068,11 +1068,12 @@
}
#endif
- error = clazz->init_face( stream,
- face,
- (FT_Int)face_index,
- num_params,
- params );
+ if ( class->init_face )
+ error = clazz->init_face( stream,
+ face,
+ (FT_Int)face_index,
+ num_params,
+ params );
if ( error )
goto Fail;
@@ -1095,7 +1096,8 @@
if ( error )
{
destroy_charmaps( face, memory );
- clazz->done_face( face );
+ if ( clazz->done_face )
+ clazz->done_face( face );
FT_FREE( internal );
FT_FREE( face );
*aface = 0;