* src/cff/cffgload.c (cff_free_glyph_data), src/cff/cffload.c (cff_font_load): Use FT_UNUSED. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Initialize `error'. * src/sfnt/sfobjs.c (SFNT_Load_Face): Fix compiler warning.
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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
diff --git a/ChangeLog b/ChangeLog
index a3dc7e9..410c195 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,32 @@
+2002-08-16 Werner Lemberg <wl@gnu.org>
+
+ * src/cff/cffgload.c (cff_free_glyph_data),
+ src/cff/cffload.c (cff_font_load): Use FT_UNUSED.
+
+2002-08-15 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Initialize `error'.
+ * src/sfnt/sfobjs.c (SFNT_Load_Face): Fix compiler warning.
+
2002-08-15 Graham Asher <graham.asher@btinternet.com>
- * src/cff/cffgload.c, src/cff/cffload.c, src/cff/cffload.h,
- src/cff/cffobjs.c [FT_CONFIG_OPTION_INCREMENTAL]:
- implemented the incremental font loading system for
- the CFF driver. Tested using the GhostScript-to-FreeType
- bridge (under development).
+ Implemented the incremental font loading system for the CFF driver.
+ Tested using the GhostScript-to-FreeType bridge (under development).
- * src/cid/cidgload.c [FT_CONFIG_OPTION_INCREMENTAL]:
- corrected the incremental font loading implementation to
- use the new system introduced on 2002-08-01.
+ * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): New
+ functions.
+ (cff_operator_seac, cff_compute_max_advance, cff_slot_load): Use
+ them.
+ * src/cff/cffload.c (cff_font_load): Add `face' parameter.
+ Load charset and encoding only if there are glyphs.
+ [FT_CONFIG_OPTION_INCREMENTAL]: Incremental fonts don't need
+ character recipes.
+ * src/cff/cffload.h, src/cff/cffobjs.c: Updated.
+
+ * src/cid/cidgload.c (cid_load_glyph)
+ [FT_CONFIG_OPTION_INCREMENTAL]: Corrected the incremental font
+ loading implementation to use the new system introduced on
+ 2002-08-01.
2002-08-06 Werner Lemberg <wl@gnu.org>
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index cb1c8ea..f7c7068 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -572,7 +572,7 @@
FT_Bool destroy )
{
FT_GlyphSlotRec dummy;
- FT_Error error;
+ FT_Error error = FT_Err_Ok;
FT_Glyph glyph;
FT_BitmapGlyph bitmap = NULL;
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 5ba5b80..753cf97 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -570,20 +570,25 @@
/* For incremental fonts get the character data using the */
/* callback function. */
if ( face->root.internal->incremental_interface )
- {
- FT_Data data;
- FT_Error error = face->root.internal->incremental_interface->funcs->get_glyph_data(
- face->root.internal->incremental_interface->object,
- glyph_index, &data );
+ {
+ FT_Data data;
+ FT_Error error = face->root.internal->incremental_interface->funcs->get_glyph_data(
+ face->root.internal->incremental_interface->object,
+ glyph_index, &data );
+
+
*pointer = (FT_Byte*)data.pointer;
- *length = data.length;
+ *length = data.length;
+
return error;
}
else
-#endif
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- CFF_Font cff = (CFF_Font)(face->extra.data);
+ CFF_Font cff = (CFF_Font)(face->extra.data);
+
+
return cff_index_access_element( &cff->charstrings_index, glyph_index,
pointer, length );
}
@@ -596,25 +601,29 @@
FT_ULong length )
{
#ifndef FT_CONFIG_OPTION_INCREMENTAL
- length; /* Prevent compiler warning about unreferenced parameter. */
+ FT_UNUSED( length );
#endif
#ifdef FT_CONFIG_OPTION_INCREMENTAL
/* For incremental fonts get the character data using the */
/* callback function. */
if ( face->root.internal->incremental_interface )
- {
- FT_Data data;
- data.pointer = *pointer;
- data.length = length;
+ {
+ FT_Data data;
+
+
+ data.pointer = *pointer;
+ data.length = length;
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,&data );
}
else
-#endif
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- CFF_Font cff = (CFF_Font)(face->extra.data);
+ CFF_Font cff = (CFF_Font)(face->extra.data);
+
+
cff_index_forget_element( &cff->charstrings_index, pointer );
}
}
@@ -714,7 +723,8 @@
&charstring, &charstring_len );
if ( !error )
{
- error = cff_decoder_parse_charstrings( decoder, charstring, charstring_len );
+ error = cff_decoder_parse_charstrings( decoder, charstring,
+ charstring_len );
if ( error )
goto Exit;
@@ -2302,7 +2312,7 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- /* Control data and length may not be available for incremental */
+ /* Control data and length may not be available for incremental */
/* fonts. */
if ( face->root.internal->incremental_interface )
{
@@ -2310,16 +2320,19 @@
glyph->root.control_len = 0;
}
else
-#endif
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+
/* We set control_data and control_len if charstrings is loaded. */
/* See how charstring loads at cff_index_access_element() in */
/* cffload.c. */
{
- CFF_IndexRec csindex = cff->charstrings_index;
- glyph->root.control_data =
- csindex.bytes + csindex.offsets[glyph_index] - 1;
- glyph->root.control_len =
- charstring_len;
+ CFF_IndexRec csindex = cff->charstrings_index;
+
+
+ glyph->root.control_data =
+ csindex.bytes + csindex.offsets[glyph_index] - 1;
+ glyph->root.control_len =
+ charstring_len;
}
}
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 4e5da87..be40d0e 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -2048,11 +2048,11 @@
FT_ULong base_offset;
CFF_FontRecDict dict;
-
#ifndef FT_CONFIG_OPTION_INCREMENTAL
- face; /* Prevent compiler warning about unreferenced parameter. */
+ FT_UNUSED( face );
#endif
+
FT_ZERO( font );
font->stream = stream;
@@ -2165,11 +2165,10 @@
font->num_subfonts = 0;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- /* Incremental fonts don't need character recipes. */
- if (!face->root.internal->incremental_interface)
+ /* Incremental fonts don't need character recipes. */
+ if ( !face->root.internal->incremental_interface )
#endif
- {
-
+ {
/* read the charstrings index now */
if ( dict->charstrings_offset == 0 )
{
@@ -2184,7 +2183,7 @@
error = cff_new_index( &font->charstrings_index, stream, 0 );
if ( error )
goto Exit;
- }
+ }
/* explicit the global subrs */
font->num_global_subrs = font->global_subrs_index.count;
@@ -2200,7 +2199,7 @@
if ( font->num_glyphs > 0 )
{
error = cff_charset_load( &font->charset, font->num_glyphs, stream,
- base_offset, dict->charset_offset );
+ base_offset, dict->charset_offset );
if ( error )
goto Exit;
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 95f3e5d..04a66c2 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -71,14 +71,15 @@
fd_select = (FT_UInt)cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
if ( glyph_data.length != 0 )
- {
+ {
glyph_length = glyph_data.length - cid->fd_bytes;
FT_ALLOC( charstring, glyph_length );
- if ( !error )
- ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes, glyph_length );
- }
+ if ( !error )
+ ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,
+ glyph_length );
+ }
- face->root.internal->incremental_interface->funcs->free_glyph_data(
+ face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,
&glyph_data );
@@ -163,6 +164,7 @@
FT_Bool found = FALSE;
FT_Incremental_MetricsRec metrics;
+
error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(
face->root.internal->incremental_interface->object,
glyph_index, FALSE, &metrics, &found );
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index a6c731f..ff7a5d8 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -516,7 +516,6 @@
{
FT_Face root = &face->root;
FT_Int flags = 0;
- FT_Int n;
FT_Memory memory;
@@ -614,11 +613,13 @@
}
-
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
if ( face->num_sbit_strikes )
{
+ FT_Int n;
+
+
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
#if 0