Commit 312043f41bbb5e9fd4127339c76551406592b8a8

Werner Lemberg 2008-11-12T06:29:41

* src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field. This fixes Savannah bug #24819. Document `format' field of TT_CMapInfo.

diff --git a/ChangeLog b/ChangeLog
index 0e40f8c..31b5846 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-12  Tor Andersson  <tor.andersson@gmail.com>
+
+	* src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
+	This fixes Savannah bug #24819.
+
 2008-11-08  Werner Lemberg  <wl@gnu.org>
 
 	* src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards
diff --git a/include/freetype/internal/services/svttcmap.h b/include/freetype/internal/services/svttcmap.h
index 1e02d15..553ecb0 100644
--- a/include/freetype/internal/services/svttcmap.h
+++ b/include/freetype/internal/services/svttcmap.h
@@ -7,7 +7,7 @@
 /*  Copyright 2003 by                                                      */
 /*  Masatake YAMATO, Redhat K.K.                                           */
 /*                                                                         */
-/*  Copyright 2003 by                                                      */
+/*  Copyright 2003, 2008 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -49,6 +49,13 @@ FT_BEGIN_HEADER
   /*      The language ID used in Mac fonts.  Definitions of values are in */
   /*      freetype/ttnameid.h.                                             */
   /*                                                                       */
+  /*    format ::                                                          */
+  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */
+  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */
+  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */
+  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */
+  /*      coverage), and 14 (Unicode Variation Sequences).                 */
+  /*                                                                       */
   typedef struct  TT_CMapInfo_
   {
     FT_ULong language;
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index b02ee79..0c39795 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -426,6 +426,7 @@
 
 
     cmap_info->language = 0;
+    cmap_info->format   = 0;
 
     if ( cmap->clazz != &cff_cmap_encoding_class_rec &&
          cmap->clazz != &cff_cmap_unicode_class_rec  )