ref: 79e3789f81e14266578e71196ce71ecf5381d142
parent: 5c402d97afcc98cbb8d8e049409533f747c4c514
author: Werner Lemberg <[email protected]>
date: Wed Jun 14 03:51:04 EDT 2017
* src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding. FreeType only sets a default active encoding for Unicode.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2017-06-13 Werner Lemberg <[email protected]>
+ * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding.
+
+ FreeType only sets a default active encoding for Unicode.
+
+2017-06-13 Werner Lemberg <[email protected]>
+
[cff, truetype] Integer overflows.
Reported as
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -575,7 +575,8 @@
/* <Note> */
/* When a new face is created (either through @FT_New_Face or */
/* @FT_Open_Face), the library looks for a Unicode charmap within */
- /* the list and automatically activates it. */
+ /* the list and automatically activates it. If there is no Unicode */
+ /* charmap, FreeType doesn't set an `active' charmap. */
/* */
/* <Also> */
/* See @FT_CharMapRec for the publicly accessible fields of a given */
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -658,12 +658,6 @@
}
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
-
-#if 0
- /* Select default charmap */
- if ( bdfface->num_charmaps )
- bdfface->charmap = bdfface->charmaps[0];
-#endif
}
goto Exit;
--- a/src/pcf/pcfdrivr.c
+++ b/src/pcf/pcfdrivr.c
@@ -413,12 +413,6 @@
}
error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );
-
-#if 0
- /* Select default charmap */
- if ( pcfface->num_charmaps )
- pcfface->charmap = pcfface->charmaps[0];
-#endif
}
}
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -264,12 +264,6 @@
charmap.encoding = FT_ENCODING_UNICODE;
error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
-
-#if 0
- /* select default charmap */
- if ( pfrface->num_charmaps )
- pfrface->charmap = pfrface->charmaps[0];
-#endif
}
/* check whether we have loaded any kerning pairs */
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1482,15 +1482,6 @@
charmap->encoding = sfnt_find_encoding( charmap->platform_id,
charmap->encoding_id );
-
-#if 0
- if ( !root->charmap &&
- charmap->encoding == FT_ENCODING_UNICODE )
- {
- /* set 'root->charmap' to the first Unicode encoding we find */
- root->charmap = charmap;
- }
-#endif
}
}
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -555,12 +555,6 @@
if ( clazz )
error = FT_CMap_New( clazz, NULL, &charmap, NULL );
-
-#if 0
- /* Select default charmap */
- if (root->num_charmaps)
- root->charmap = root->charmaps[0];
-#endif
}
}
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -394,12 +394,6 @@
if ( clazz )
error = FT_CMap_New( clazz, NULL, &charmap, NULL );
-
-#if 0
- /* Select default charmap */
- if ( root->num_charmaps )
- root->charmap = root->charmaps[0];
-#endif
}
}
Exit:
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -859,10 +859,6 @@
NULL );
if ( error )
goto Fail;
-
- /* Select default charmap */
- if ( root->num_charmaps )
- root->charmap = root->charmaps[0];
}
/* set up remaining flags */