fixed a bug which appeared when loading unscaled composite glyphs
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
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 3b012f6..5e66247 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -532,7 +532,8 @@
loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- loader->exec->glyphSize = 0;
+ if (loader->exec)
+ loader->exec->glyphSize = 0;
#endif
goto Load_End;
}
@@ -722,7 +723,12 @@
num_base_points = loader->base.n_points;
error = load_truetype_glyph( loader, subglyph->index );
- if ((subglyph->flags & USE_MY_METRICS) == 0)
+ if ( subglyph->flags & USE_MY_METRICS )
+ {
+ pp1 = loader->pp1;
+ pp2 = loader->pp2;
+ }
+ else
{
loader->pp1 = pp1;
loader->pp2 = pp2;
@@ -818,7 +824,7 @@
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
subglyph--;
- if (num_subglyphs > 0 && subglyph->flags & WE_HAVE_INSTR)
+ if (num_subglyphs > 0 && loader->exec && subglyph->flags & WE_HAVE_INSTR)
{
TT_UShort n_ins;
TT_ExecContext exec = loader->exec;
@@ -839,6 +845,9 @@
return TT_Err_Too_Many_Ins;
}
+ if (exec)
+ {
+ }
/* read the instructions */
if ( FILE_Read( exec->glyphIns, n_ins ) )
goto Fail;
@@ -1117,7 +1126,8 @@
}
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- glyph->outline.dropout_mode = (TT_Char)loader->exec->GS.scan_type;
+ if (loader->exec)
+ glyph->outline.dropout_mode = (TT_Char)loader->exec->GS.scan_type;
#else
glyph->outline.dropout_mode = 2;
#endif
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index abd19b8..21a7661 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -108,8 +108,8 @@
/* parse an AFM file - for now, only read the kerning pairs */
LOCAL_FUNC
- FT_Error T1_Read_AFM( FT_Stream stream,
- FT_Face t1_face )
+ FT_Error T1_Read_AFM( FT_Face t1_face,
+ FT_Stream stream )
{
FT_Error error;
FT_Memory memory = stream->memory;
@@ -121,7 +121,7 @@
T1_Font* type1 = &((T1_Face)t1_face)->type1;
T1_AFM* afm = 0;
- if ( !ACCESS_Frame(stream->size) )
+ if ( ACCESS_Frame(stream->size) )
return error;
start = (FT_Byte*)stream->cursor;