Use formatting string in FT_TRACEX calls for non-simple arguments.

* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
<cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>:
Do it.

* src/psaux/pshints.c (cf2_hintmap_build): Ditto.

* src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR,
cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto.

* src/truetype/ttinterp.c (TT_RunIns): Ditto.
This commit is contained in:
Werner Lemberg 2018-08-14 15:48:17 +02:00
parent e001a17d73
commit 1d7b034cd8
5 changed files with 44 additions and 25 deletions

View File

@ -1,3 +1,19 @@
2018-08-14 Werner Lemberg <wl@gnu.org>
Use formatting string in FT_TRACEX calls for non-simple arguments.
* src/psaux/cffdecode.c (cff_decoder_parse_charstrings)
<cff_op_hstem, cff_op_hintmask, cff_op_hlineto, cff_op_vhcurveto>:
Do it.
* src/psaux/pshints.c (cf2_hintmap_build): Ditto.
* src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
cf2_cmdVSTEM, cf2_cmdHLINETO, cf2_cmdRRCURVETO, cf2_cmdCALLSUBR,
cf2_escHSTEM3, cf2_cmdHINTMASK, cf2_cmdHVCURVETO>: Ditto.
* src/truetype/ttinterp.c (TT_RunIns): Ditto.
2018-08-14 Alexei Podtelezhnikov <apodtele@gmail.com> 2018-08-14 Alexei Podtelezhnikov <apodtele@gmail.com>
[bdf] Remove unused fields. [bdf] Remove unused fields.

View File

@ -964,10 +964,10 @@
case cff_op_hstemhm: case cff_op_hstemhm:
case cff_op_vstemhm: case cff_op_vstemhm:
/* the number of arguments is always even here */ /* the number of arguments is always even here */
FT_TRACE4(( FT_TRACE4(( "%s\n",
op == cff_op_hstem ? " hstem\n" : op == cff_op_hstem ? " hstem" :
( op == cff_op_vstem ? " vstem\n" : ( op == cff_op_vstem ? " vstem" :
( op == cff_op_hstemhm ? " hstemhm\n" : " vstemhm\n" ) ) )); ( op == cff_op_hstemhm ? " hstemhm" : " vstemhm" ) ) ));
if ( hinter ) if ( hinter )
hinter->stems( hinter->hints, hinter->stems( hinter->hints,
@ -981,7 +981,8 @@
case cff_op_hintmask: case cff_op_hintmask:
case cff_op_cntrmask: case cff_op_cntrmask:
FT_TRACE4(( op == cff_op_hintmask ? " hintmask" : " cntrmask" )); FT_TRACE4(( "%s", op == cff_op_hintmask ? " hintmask"
: " cntrmask" ));
/* implement vstem when needed -- */ /* implement vstem when needed -- */
/* the specification doesn't say it, but this also works */ /* the specification doesn't say it, but this also works */
@ -1094,8 +1095,8 @@
FT_Int phase = ( op == cff_op_hlineto ); FT_Int phase = ( op == cff_op_hlineto );
FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n" FT_TRACE4(( "%s\n", op == cff_op_hlineto ? " hlineto"
: " vlineto\n" )); : " vlineto" ));
if ( num_args < 0 ) if ( num_args < 0 )
goto Stack_Underflow; goto Stack_Underflow;
@ -1266,8 +1267,8 @@
FT_Int nargs; FT_Int nargs;
FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto\n" FT_TRACE4(( "%s\n", op == cff_op_vhcurveto ? " vhcurveto"
: " hvcurveto\n" )); : " hvcurveto" ));
if ( cff_builder_start_point( builder, x, y ) ) if ( cff_builder_start_point( builder, x, y ) )
goto Fail; goto Fail;

View File

@ -1025,10 +1025,10 @@
} }
} }
FT_TRACE6(( initialMap ? "flags: [p]air [g]host [t]op " FT_TRACE6(( "%s\n", initialMap ? "flags: [p]air [g]host [t]op"
"[b]ottom [L]ocked [S]ynthetic\n" " [b]ottom [L]ocked [S]ynthetic\n"
"Initial hintmap\n" "Initial hintmap"
: "Hints:\n" )); : "Hints:" ));
cf2_hintmap_dump( hintmap ); cf2_hintmap_dump( hintmap );
/* /*

View File

@ -776,7 +776,8 @@
case cf2_cmdHSTEMHM: case cf2_cmdHSTEMHM:
case cf2_cmdHSTEM: case cf2_cmdHSTEM:
FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? " hstemhm\n" : " hstem\n" )); FT_TRACE4(( "%s\n", op1 == cf2_cmdHSTEMHM ? " hstemhm"
: " hstem" ));
if ( !font->isT1 ) if ( !font->isT1 )
{ {
@ -806,7 +807,8 @@
case cf2_cmdVSTEMHM: case cf2_cmdVSTEMHM:
case cf2_cmdVSTEM: case cf2_cmdVSTEM:
FT_TRACE4(( op1 == cf2_cmdVSTEMHM ? " vstemhm\n" : " vstem\n" )); FT_TRACE4(( "%s\n", op1 == cf2_cmdVSTEMHM ? " vstemhm"
: " vstem" ));
if ( !font->isT1 ) if ( !font->isT1 )
{ {
@ -889,7 +891,7 @@
FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO ); FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO );
FT_TRACE4(( isX ? " hlineto\n" : " vlineto\n" )); FT_TRACE4(( "%s\n", isX ? " hlineto" : " vlineto" ));
for ( idx = 0; idx < count; idx++ ) for ( idx = 0; idx < count; idx++ )
{ {
@ -917,8 +919,8 @@
CF2_UInt idx = 0; CF2_UInt idx = 0;
FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? " rcurveline\n" FT_TRACE4(( "%s\n", op1 == cf2_cmdRCURVELINE ? " rcurveline"
: " rrcurveto\n" )); : " rrcurveto" ));
while ( idx + 6 <= count ) while ( idx + 6 <= count )
{ {
@ -973,8 +975,8 @@
CF2_Int subrNum; CF2_Int subrNum;
FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? " callgsubr" FT_TRACE4(( "%s", op1 == cf2_cmdCALLGSUBR ? " callgsubr"
: " callsubr" )); : " callsubr" ));
if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) || if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) ||
( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) ) ( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) )
@ -1213,8 +1215,8 @@
FT_Bool isV = FT_BOOL( op2 == cf2_escVSTEM3 ); FT_Bool isV = FT_BOOL( op2 == cf2_escVSTEM3 );
FT_TRACE4(( isV ? " vstem3\n" FT_TRACE4(( "%s\n", isV ? " vstem3"
: " hstem3\n" )); : " hstem3" ));
FT_ASSERT( cf2_stack_count( opStack ) == 6 ); FT_ASSERT( cf2_stack_count( opStack ) == 6 );
@ -2564,7 +2566,7 @@
case cf2_cmdHINTMASK: case cf2_cmdHINTMASK:
/* the final \n in the tracing message gets added in */ /* the final \n in the tracing message gets added in */
/* `cf2_hintmask_read' (which also traces the mask bytes) */ /* `cf2_hintmask_read' (which also traces the mask bytes) */
FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" )); FT_TRACE4(( "%s", op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
/* never add hints after the mask is computed */ /* never add hints after the mask is computed */
if ( cf2_stack_count( opStack ) > 1 && if ( cf2_stack_count( opStack ) > 1 &&
@ -2830,7 +2832,7 @@
count = count1 & ~2U; count = count1 & ~2U;
idx += count1 - count; idx += count1 - count;
FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" )); FT_TRACE4(( "%s\n", alternate ? " hvcurveto" : " vhcurveto" ));
while ( idx < count ) while ( idx < count )
{ {

View File

@ -7874,7 +7874,7 @@
/* and the first few stack elements also */ /* and the first few stack elements also */
FT_TRACE6(( " " )); FT_TRACE6(( " " ));
FT_TRACE7(( "%06d ", exc->IP )); FT_TRACE7(( "%06d ", exc->IP ));
FT_TRACE6(( opcode_name[exc->opcode] + 2 )); FT_TRACE6(( "%s", opcode_name[exc->opcode] + 2 ));
FT_TRACE7(( "%*s", *opcode_name[exc->opcode] == 'A' FT_TRACE7(( "%*s", *opcode_name[exc->opcode] == 'A'
? 2 ? 2
: 12 - ( *opcode_name[exc->opcode] - '0' ), : 12 - ( *opcode_name[exc->opcode] - '0' ),