* src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented OpenType fonts to be recognized by FreeType
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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
diff --git a/ChangeLog b/ChangeLog
index 964002b..484fe3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,8 +8,12 @@
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
- src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
- FT_CONFIG_OPTION_USE_CMAPS is now the default
+ src/type42/t42objs.c, src/type42/t42objs.h, src/type42/t42drivr.c,
+ src/winfonts/winfnt.c: code cleanup, FT_CONFIG_OPTION_USE_CMAPS is now
+ the default
+
+ * src/sfnt/ttload.c (TT_Load_SFNT_Header): fixed a recent bug that prevented
+ OpenType fonts to be recognized by FreeType
2002-07-11 David Turner <david@freetype.org>
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index d5fb518..752c532 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -733,6 +733,26 @@
if ( error )
goto Fail;
+ /* select Unicode charmap by default */
+ {
+ FT_Int nn;
+ FT_CharMap unicmap = NULL, cmap;
+
+ for ( nn = 0; nn < face->num_charmaps; nn++ )
+ {
+ cmap = face->charmaps[nn];
+
+ if ( cmap->encoding == ft_encoding_unicode )
+ {
+ unicmap = cmap;
+ break;
+ }
+ }
+
+ if ( unicmap != NULL )
+ face->charmap = unicmap;
+ }
+
*aface = face;
Fail:
diff --git a/src/bdf/bdfdrivr.c b/src/bdf/bdfdrivr.c
index 5af8e3a..3773432 100644
--- a/src/bdf/bdfdrivr.c
+++ b/src/bdf/bdfdrivr.c
@@ -411,9 +411,11 @@ THE SOFTWARE.
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
+#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
+#endif
}
goto Exit;
diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c
index cc6cb91..812e2be 100644
--- a/src/pcf/pcfdriver.c
+++ b/src/pcf/pcfdriver.c
@@ -266,9 +266,11 @@ THE SOFTWARE.
error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );
+#if 0
/* Select default charmap */
if (face->root.num_charmaps)
face->root.charmap = face->root.charmaps[0];
+#endif
}
}
diff --git a/src/pfr/pfrobjs.c b/src/pfr/pfrobjs.c
index 69fb7e1..3134e41 100644
--- a/src/pfr/pfrobjs.c
+++ b/src/pfr/pfrobjs.c
@@ -167,18 +167,20 @@
/* create charmap */
{
FT_CharMapRec charmap;
-
+
charmap.face = root;
charmap.platform_id = 3;
charmap.encoding_id = 1;
charmap.encoding = ft_encoding_unicode;
-
+
FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
+#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
+#endif
}
/* check whether we've loaded any kerning pairs */
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 3b55d63..cf7f5ba 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -595,12 +595,14 @@
charmap->encoding = sfnt_find_encoding( charmap->platform_id,
charmap->encoding_id );
+#if 0
if ( root->charmap == NULL &&
charmap->encoding == ft_encoding_unicode )
{
/* set 'root->charmap' to the first Unicode encoding we find */
root->charmap = charmap;
}
+#endif
}
}
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index 6fe6b3c..fc167f7 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -228,7 +228,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* TT_Load_SFNT_HeaderRec */
+ /* TT_Load_SFNT_Header */
/* */
/* <Description> */
/* Loads the header of a SFNT font file. Supports collections. */
@@ -345,9 +345,6 @@
goto Exit;
}
- if ( format_tag != 0x10000UL && format_tag != 0x74727565UL )
- goto Bad_Format;
-
/* the format tag was read, now check the rest of the header */
sfnt->format_tag = format_tag;
sfnt->offset = offset;
@@ -359,7 +356,6 @@
error = sfnt_dir_check( stream, offset, sfnt->num_tables );
if ( error )
{
- Bad_Format:
FT_TRACE2(( "TT_Load_SFNT_Header: file is not SFNT!\n" ));
error = SFNT_Err_Unknown_File_Format;
}
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 64863de..51131ff 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -484,9 +484,11 @@
if ( clazz )
FT_CMap_New( clazz, NULL, &charmap, NULL );
+#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
+#endif
}
}
diff --git a/src/type42/t42objs.c b/src/type42/t42objs.c
index 3669d24..ae1d542 100644
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -337,9 +337,11 @@
if ( clazz )
FT_CMap_New( clazz, NULL, &charmap, NULL );
+#if 0
/* Select default charmap */
if (root->num_charmaps)
root->charmap = root->charmaps[0];
+#endif
}
}
Exit: