forgotten fixes.
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 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 843bf0f..beb8dcc 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2360,7 +2360,7 @@
/* */
/* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
/* renderer by its name, use FT_Get_Module(). */
- /*
+ /* */
FT_EXPORT_FUNC( FT_Renderer ) FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format )
{
@@ -2587,7 +2587,7 @@
FT_UInt nn;
-#define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) |
+#define FREETYPE_VER_FIXED ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \
FREETYPE_MINOR )
if ( !library || !clazz )
@@ -2786,7 +2786,7 @@
/* */
/* <Note> */
/* The module object is destroyed by the function in case of success. */
- /*
+ /* */
FT_EXPORT_FUNC( FT_Error ) FT_Remove_Module( FT_Library library,
FT_Module module )
{
diff --git a/src/cid/cidafm.c b/src/cid/cidafm.c
index f75f5b7..f770950 100644
--- a/src/cid/cidafm.c
+++ b/src/cid/cidafm.c
@@ -36,7 +36,7 @@
#define FT_COMPONENT trace_cidafm
-#if 0
+#if 1
LOCAL_FUNC
void CID_Done_AFM( FT_Memory memory,
@@ -281,7 +281,7 @@
kerning->y = 0;
}
-#endif /* 0 */
+#endif /* 1 */
/* END */
diff --git a/src/cid/cidafm.h b/src/cid/cidafm.h
index 00babec..30d4f0e 100644
--- a/src/cid/cidafm.h
+++ b/src/cid/cidafm.h
@@ -38,7 +38,7 @@
} T1_AFM;
-#if 0
+#if 1
LOCAL_DEF
FT_Error CID_Read_AFM( FT_Face t1_face,
@@ -54,7 +54,7 @@
FT_UInt glyph2,
FT_Vector* kerning );
-#endif /* 0 */
+#endif /* 1 */
#endif /* CIDAFM_H */
diff --git a/src/cid/type1cid.c b/src/cid/type1cid.c
index 855f564..dca723c 100644
--- a/src/cid/type1cid.c
+++ b/src/cid/type1cid.c
@@ -24,7 +24,7 @@
#include <cidriver.c>
#include <cidgload.c>
-#if 0
+#if 1
#include <cidafm.c>
#endif
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 8f1fefa..6e017ee 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -108,9 +108,9 @@
/*************************************************************************/
/* */
- /* Returns the horizontal metrics in font units for a given glyph. */
- /* If `check' is true, take care of monospaced fonts by returning the */
- /* advance width maximum. */
+ /* Returns the horizontal metrics in font units for a given glyph. If */
+ /* `check' is true, take care of monospaced fonts by returning the */
+ /* advance width maximum. */
/* */
static
void Get_HMetrics( TT_Face face,
@@ -415,8 +415,8 @@
FT_Error TT_Load_Composite_Glyph( TT_Loader* loader )
{
FT_Error error;
- FT_Stream stream = loader->stream;
- FT_GlyphLoader* gloader = loader->gloader;
+ FT_Stream stream = loader->stream;
+ FT_GlyphLoader* gloader = loader->gloader;
FT_SubGlyph* subglyph;
FT_UInt num_subglyphs;
@@ -429,7 +429,7 @@
/* check that we can load a new subglyph */
- error = FT_GlyphLoader_Check_Subglyphs( gloader, num_subglyphs+1 );
+ error = FT_GlyphLoader_Check_Subglyphs( gloader, num_subglyphs + 1 );
if ( error )
goto Fail;
@@ -480,8 +480,7 @@
subglyph->transform.yy = yy;
num_subglyphs++;
- }
- while (subglyph->flags & MORE_COMPONENTS);
+ } while ( subglyph->flags & MORE_COMPONENTS );
gloader->current.num_subglyphs = num_subglyphs;
@@ -562,7 +561,7 @@
/* Note that we return two more points that are not */
/* part of the glyph outline. */
- n_points += 2;
+ n_points += 2;
/* set up zone for hinting */
tt_prepare_zone( zone, &gloader->current, 0, 0 );
@@ -691,7 +690,7 @@
Get_HMetrics( face, index,
(FT_Bool)!(loader->load_flags &
- FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
+ FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
&left_bearing,
&advance_width );
@@ -721,8 +720,10 @@
loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
if ( loader->exec )
loader->exec->glyphSize = 0;
+
#endif
error = FT_Err_Ok;
goto Exit;
@@ -777,13 +778,20 @@
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
{
TT_Size size = (TT_Size)loader->size;
+
+
error = TT_Process_Simple_Glyph( loader,
(FT_Bool)( size && size->debug ) );
}
+
#else
+
error = Process_Simple_Glyph( loader, 0 );
+
#endif
- if ( error ) goto Fail;
+
+ if ( error )
+ goto Fail;
FT_GlyphLoader_Add( gloader );
@@ -830,15 +838,14 @@
}
- /***********************************************************************/
- /***********************************************************************/
- /***********************************************************************/
-
/*********************************************************************/
- /* Now, read each subglyph independently.. */
+ /*********************************************************************/
+ /*********************************************************************/
+
+ /* Now, read each subglyph independently. */
{
FT_Int n, num_base_points, num_new_points;
- FT_SubGlyph* subglyph;
+ FT_SubGlyph* subglyph = 0;
FT_UInt num_subglyphs = gloader->current.num_subglyphs;
FT_UInt num_base_subgs = gloader->base.num_subglyphs;
@@ -851,6 +858,7 @@
FT_Vector pp1, pp2;
FT_Pos x, y;
+
/* Each time we call load_truetype_glyph in this loop, the */
/* value of `gloader.base.subglyphs' can change due to table */
/* reallocations. We thus need to recompute the subglyph */
@@ -879,7 +887,7 @@
loader->pp2 = pp2;
}
- num_points = gloader->base.outline.n_points;
+ num_points = gloader->base.outline.n_points;
num_new_points = num_points - num_base_points;
@@ -895,6 +903,7 @@
num_base_points;
FT_Vector* limit = cur + num_new_points;
+
for ( ; cur < limit; cur++, org++ )
{
FT_Vector_Transform( cur, &subglyph->transform );
@@ -949,9 +958,9 @@
cur_to_org( num_new_points, &loader->zone );
}
- /***********************************************************************/
- /***********************************************************************/
- /***********************************************************************/
+ /*******************************************************************/
+ /*******************************************************************/
+ /*******************************************************************/
/* we have finished loading all sub-glyphs, now, look for */
/* instructions for this composite! */
@@ -1036,11 +1045,11 @@
cur_to_org( n_points, pts );
/* now consider hinting */
- if ( IS_HINTED(loader->load_flags) && n_ins > 0 )
+ if ( IS_HINTED( loader->load_flags ) && n_ins > 0 )
{
exec->is_composite = TRUE;
exec->pedantic_hinting =
- (FT_Bool)(loader->load_flags & FT_LOAD_PEDANTIC);
+ (FT_Bool)( loader->load_flags & FT_LOAD_PEDANTIC );
error = TT_Run_Context( exec, ((TT_Size)loader->size)->debug );
if ( error && exec->pedantic_hinting )
@@ -1051,7 +1060,9 @@
loader->pp1 = pp1[0];
loader->pp2 = pp1[1];
}
+
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
+
}
/* end of composite loading */
}
@@ -1059,7 +1070,6 @@
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
- /***********************************************************************/
Fail:
if ( opened_frame )
@@ -1080,6 +1090,7 @@
TT_GlyphSlot glyph = loader->glyph;
TT_Size size = (TT_Size)loader->size;
+
x_scale = 0x10000L;
y_scale = 0x10000L;
if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
@@ -1234,12 +1245,14 @@
glyph->metrics.vertAdvance = advance;
}
- /* Adjust advance width to the value contained in the hdmx table. */
+ /* adjust advance width to the value contained in the hdmx table */
if ( !face->postscript.isFixedPitch && size &&
IS_HINTED( loader->load_flags ) )
{
FT_Byte* widths = Get_Advance_Widths( face,
size->root.metrics.x_ppem );
+
+
if ( widths )
glyph->metrics.horiAdvance = widths[glyph_index] << 6;
}
@@ -1247,7 +1260,6 @@
/* set glyph dimensions */
glyph->metrics.width = bbox.xMax - bbox.xMin;
glyph->metrics.height = bbox.yMax - bbox.yMin;
-
}
@@ -1367,7 +1379,7 @@
error = face->goto_table( face, TTAG_glyf, stream, 0 );
if ( error )
{
- FT_ERROR(( "TT_Load_Glyph: Could not access glyph table\n" ));
+ FT_ERROR(( "TT_Load_Glyph: could not access glyph table\n" ));
goto Exit;
}
@@ -1439,9 +1451,11 @@
compute_glyph_metrics( &loader, glyph_index );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+
if ( !size || !size->debug )
TT_Done_Context( loader.exec );
-#endif
+
+#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
Exit:
return error;