Commit 5f577462bd7cc8e2ca6fe4a1efecee6d8a95e7be

Werner Lemberg 2013-12-25T08:50:50

Fix Savannah bug #40997. * src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already be set. * src/cff/cffobjs.c (cff_face_init): Ditto. * src/cid/cidobjs.c (cid_face_init): Ditto. * src/pcf/pcfread.c (pcf_load_font): Ditto. * src/pfr/pfrobjs.c (pfr_face_init): Ditto. * src/type1/t1objs.c (T1_Face_Init): Ditto. * src/type42/t42objs.c (T42_Face_Init): Ditto. * src/winfonts/winfnt.c (FNT_Face_Init): Ditto.

diff --git a/ChangeLog b/ChangeLog
index 8827606..0288701 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2013-12-25  Werner Lemberg  <wl@gnu.org>
+
+	Fix Savannah bug #40997.
+
+	* src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to
+	adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already
+	be set.
+	* src/cff/cffobjs.c (cff_face_init): Ditto.
+	* src/cid/cidobjs.c (cid_face_init): Ditto.
+	* src/pcf/pcfread.c (pcf_load_font): Ditto.
+	* src/pfr/pfrobjs.c (pfr_face_init): Ditto.
+	* src/type1/t1objs.c (T1_Face_Init): Ditto.
+	* src/type42/t42objs.c (T42_Face_Init): Ditto.
+	* src/winfonts/winfnt.c (FNT_Face_Init): Ditto.
+
 2013-12-21  Werner Lemberg  <wl@gnu.org>
 
 	[autofit] Introduce `coverages'.
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index caa142b..71150d7 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -400,9 +400,10 @@ THE SOFTWARE.
 
       bdfface->num_faces  = 1;
       bdfface->face_index = 0;
-      bdfface->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                            FT_FACE_FLAG_HORIZONTAL  |
-                            FT_FACE_FLAG_FAST_GLYPHS;
+
+      bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                             FT_FACE_FLAG_HORIZONTAL  |
+                             FT_FACE_FLAG_FAST_GLYPHS;
 
       prop = bdf_get_font_property( font, "SPACING" );
       if ( prop && prop->format == BDF_ATOM                             &&
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 29c3691..cac4ac2 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -866,7 +866,7 @@
           flags |= FT_FACE_FLAG_KERNING;
 #endif
 
-        cffface->face_flags = flags;
+        cffface->face_flags |= flags;
 
         /*******************************************************************/
         /*                                                                 */
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 46555e2..5932ffa 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -355,9 +355,10 @@
       cidface->num_charmaps = 0;
 
       cidface->face_index = face_index;
-      cidface->face_flags = FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
-                            FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
-                            FT_FACE_FLAG_HINTER;      /* has native hinter */
+
+      cidface->face_flags |= FT_FACE_FLAG_SCALABLE   | /* scalable outlines */
+                             FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */
+                             FT_FACE_FLAG_HINTER;      /* has native hinter */
 
       if ( info->is_fixed_pitch )
         cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index ee41c5d..d936c58 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -1153,9 +1153,10 @@ THE SOFTWARE.
 
       root->num_faces  = 1;
       root->face_index = 0;
-      root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                         FT_FACE_FLAG_HORIZONTAL  |
-                         FT_FACE_FLAG_FAST_GLYPHS;
+
+      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                          FT_FACE_FLAG_HORIZONTAL  |
+                          FT_FACE_FLAG_FAST_GLYPHS;
 
       if ( face->accel.constantWidth )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 8d3cd29..194d2df 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -137,7 +137,8 @@
 
       pfrface->face_index = face_index;
       pfrface->num_glyphs = phy_font->num_chars + 1;
-      pfrface->face_flags = FT_FACE_FLAG_SCALABLE;
+
+      pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;
 
       /* if all characters point to the same gps_offset 0, we */
       /* assume that the font only contains bitmaps           */
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 837b791..e11770f 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -364,10 +364,10 @@
       root->num_glyphs = type1->num_glyphs;
       root->face_index = 0;
 
-      root->face_flags = FT_FACE_FLAG_SCALABLE    |
-                         FT_FACE_FLAG_HORIZONTAL  |
-                         FT_FACE_FLAG_GLYPH_NAMES |
-                         FT_FACE_FLAG_HINTER;
+      root->face_flags |= FT_FACE_FLAG_SCALABLE    |
+                          FT_FACE_FLAG_HORIZONTAL  |
+                          FT_FACE_FLAG_GLYPH_NAMES |
+                          FT_FACE_FLAG_HINTER;
 
       if ( info->is_fixed_pitch )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index f5aa2ca..798ebdb 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -218,9 +218,9 @@
     root->num_charmaps = 0;
     root->face_index   = 0;
 
-    root->face_flags = FT_FACE_FLAG_SCALABLE    |
-                       FT_FACE_FLAG_HORIZONTAL  |
-                       FT_FACE_FLAG_GLYPH_NAMES;
+    root->face_flags |= FT_FACE_FLAG_SCALABLE    |
+                        FT_FACE_FLAG_HORIZONTAL  |
+                        FT_FACE_FLAG_GLYPH_NAMES;
 
     if ( info->is_fixed_pitch )
       root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 6843243..fd6fc55 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -743,8 +743,8 @@
 
       root->face_index = face_index;
 
-      root->face_flags = FT_FACE_FLAG_FIXED_SIZES |
-                         FT_FACE_FLAG_HORIZONTAL;
+      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
+                          FT_FACE_FLAG_HORIZONTAL;
 
       if ( font->header.avg_width == font->header.max_width )
         root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;