summaryrefslogtreecommitdiff
path: root/src/psaux/psobjs.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2018-07-25 22:07:22 +0200
committerWerner Lemberg <wl@gnu.org>2018-07-25 22:07:22 +0200
commit8ed53468772ec0bc70d121cc1af2c77b1a15e8d0 (patch)
tree8396a1cc8e4535bea321c7f185929a8d6d110d03 /src/psaux/psobjs.c
parent580c94d8f71d08066d67bc5d8a2f2033d62f9317 (diff)
downloadfreetype2-8ed53468772ec0bc70d121cc1af2c77b1a15e8d0.tar.gz
[psaux, type1] Trace PostScript dictionaries and other things.
The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary right now. * src/psaux/psobjs.c (ps_parser_load_field, ps_parser_load_field_table): Add tracing calls. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing output more compact. * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add tracing messages. * src/type1/t1load.c (parse_blend_axis_types, parse_blend_design_positions, parse_blend_design_map, parse_weight_vector, t1_load_keyword, t1_parse_font_matrix, parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add tracing calls. * src/type1/t1objs.c (T1_Face_Init): Add tracing call. * src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more verbose.
Diffstat (limited to 'src/psaux/psobjs.c')
-rw-r--r--src/psaux/psobjs.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index f22c5b949..36ee66328 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1108,18 +1108,22 @@
{
case T1_FIELD_TYPE_BOOL:
val = ps_tobool( &cur, limit );
+ FT_TRACE4(( " %s", val ? "true" : "false" ));
goto Store_Integer;
case T1_FIELD_TYPE_FIXED:
val = PS_Conv_ToFixed( &cur, limit, 0 );
+ FT_TRACE4(( " %f", (double)val / 65536 ));
goto Store_Integer;
case T1_FIELD_TYPE_FIXED_1000:
val = PS_Conv_ToFixed( &cur, limit, 3 );
+ FT_TRACE4(( " %f", (double)val / 65536 / 1000 ));
goto Store_Integer;
case T1_FIELD_TYPE_INTEGER:
val = PS_Conv_ToInt( &cur, limit );
+ FT_TRACE4(( " %ld", val ));
/* fall through */
Store_Integer:
@@ -1196,6 +1200,13 @@
FT_MEM_COPY( string, cur, len );
string[len] = 0;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( token.type == T1_TOKEN_TYPE_STRING )
+ FT_TRACE4(( " (%s)", string ));
+ else
+ FT_TRACE4(( " /%s", string ));
+#endif
+
*(FT_String**)q = string;
}
break;
@@ -1221,6 +1232,12 @@
bbox->yMin = FT_RoundFix( temp[1] );
bbox->xMax = FT_RoundFix( temp[2] );
bbox->yMax = FT_RoundFix( temp[3] );
+
+ FT_TRACE4(( " [%d %d %d %d]",
+ bbox->xMin / 65536,
+ bbox->yMin / 65536,
+ bbox->xMax / 65536,
+ bbox->yMax / 65536 ));
}
break;
@@ -1259,6 +1276,7 @@
skip_spaces( &cur, limit );
}
+ FT_TRACE4(( " [" ));
for ( i = 0; i < max_objects; i++ )
{
FT_BBox* bbox = (FT_BBox*)objects[i];
@@ -1268,7 +1286,14 @@
bbox->yMin = FT_RoundFix( temp[i + max_objects] );
bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );
bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );
+
+ FT_TRACE4(( " [%d %d %d %d]",
+ bbox->xMin / 65536,
+ bbox->yMin / 65536,
+ bbox->xMax / 65536,
+ bbox->yMax / 65536 ));
}
+ FT_TRACE4(( "]" ));
FT_FREE( temp );
}
@@ -1341,6 +1366,8 @@
*(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) =
(FT_Byte)num_elements;
+ FT_TRACE4(( " [" ));
+
/* we now load each element, adjusting the field.offset on each one */
token = elements;
for ( ; num_elements > 0; num_elements--, token++ )
@@ -1359,6 +1386,8 @@
fieldrec.offset += fieldrec.size;
}
+ FT_TRACE4(( "]" ));
+
#if 0 /* obsolete -- keep for reference */
if ( pflags )
*pflags |= 1L << field->flag_bit;