@@ -60,8 +60,6 @@ class GlyphToType3
6060
6161 int stack_depth; /* A book-keeping variable for keeping track of the depth of the PS stack */
6262
63- bool pdf_mode;
64-
6563 void load_char (TTFONT* font, BYTE *glyph);
6664 void stack (TTStreamWriter& stream, int new_elem);
6765 void stack_end (TTStreamWriter& stream);
@@ -111,9 +109,8 @@ double area(FWord *x, FWord *y, int n);
111109*/
112110void GlyphToType3::stack (TTStreamWriter& stream, int new_elem)
113111{
114- if ( !pdf_mode && num_pts > 25 ) /* Only do something of we will */
112+ if ( num_pts > 25 ) /* Only do something of we will have a log of points. */
115113 {
116- /* have a log of points. */
117114 if (stack_depth == 0 )
118115 {
119116 stream.put_char (' {' );
@@ -132,7 +129,7 @@ void GlyphToType3::stack(TTStreamWriter& stream, int new_elem)
132129
133130void GlyphToType3::stack_end (TTStreamWriter& stream) /* called at end */
134131{
135- if ( !pdf_mode && stack_depth )
132+ if ( stack_depth )
136133 {
137134 stream.puts (" }_e" );
138135 stack_depth=0 ;
@@ -238,19 +235,17 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
238235
239236 /* Now, we can fill the whole thing. */
240237 stack (stream, 1 );
241- stream.puts ( pdf_mode ? " f " : " _cl" );
238+ stream.puts (" _cl" );
242239} /* end of PSConvert() */
243240
244241void GlyphToType3::PSMoveto (TTStreamWriter& stream, int x, int y)
245242{
246- stream.printf (pdf_mode ? " %d %d m\n " : " %d %d _m\n " ,
247- x, y);
243+ stream.printf (" %d %d _m\n " , x, y);
248244}
249245
250246void GlyphToType3::PSLineto (TTStreamWriter& stream, int x, int y)
251247{
252- stream.printf (pdf_mode ? " %d %d l\n " : " %d %d _l\n " ,
253- x, y);
248+ stream.printf (" %d %d _l\n " , x, y);
254249}
255250
256251/*
@@ -278,9 +273,9 @@ void GlyphToType3::PSCurveto(TTStreamWriter& stream,
278273 cy[1 ] = (sy[2 ]+2 *sy[1 ])/3 ;
279274 cx[2 ] = sx[2 ];
280275 cy[2 ] = sy[2 ];
281- stream.printf (" %d %d %d %d %d %d %s \n " ,
276+ stream.printf (" %d %d %d %d %d %d _c \n " ,
282277 (int )cx[0 ], (int )cy[0 ], (int )cx[1 ], (int )cy[1 ],
283- (int )cx[2 ], (int )cy[2 ], pdf_mode ? " c " : " _c " );
278+ (int )cx[2 ], (int )cy[2 ]);
284279}
285280
286281/*
@@ -464,50 +459,27 @@ void GlyphToType3::do_composite(TTStreamWriter& stream, struct TTFONT *font, BYT
464459 (int )flags,arg1,arg2);
465460#endif
466461
467- if (pdf_mode)
462+ /* If we have an (X,Y) shift and it is non-zero, */
463+ /* translate the coordinate system. */
464+ if ( flags & ARGS_ARE_XY_VALUES )
468465 {
469- if ( flags & ARGS_ARE_XY_VALUES )
470- {
471- /* We should have been able to use 'Do' to reference the
472- subglyph here. However, that doesn't seem to work with
473- xpdf or gs (only acrobat), so instead, this just includes
474- the subglyph here inline. */
475- stream.printf (" q 1 0 0 1 %d %d cm\n " , topost (arg1), topost (arg2));
476- }
477- else
478- {
479- stream.printf (" %% unimplemented shift, arg1=%d, arg2=%d\n " ,arg1,arg2);
480- }
481- GlyphToType3 (stream, font, glyphIndex, true );
482- if ( flags & ARGS_ARE_XY_VALUES )
483- {
484- stream.printf (" \n Q\n " );
485- }
466+ if ( arg1 != 0 || arg2 != 0 )
467+ stream.printf (" gsave %d %d translate\n " , topost (arg1), topost (arg2) );
486468 }
487469 else
488470 {
489- /* If we have an (X,Y) shif and it is non-zero, */
490- /* translate the coordinate system. */
491- if ( flags & ARGS_ARE_XY_VALUES )
492- {
493- if ( arg1 != 0 || arg2 != 0 )
494- stream.printf (" gsave %d %d translate\n " , topost (arg1), topost (arg2) );
495- }
496- else
497- {
498- stream.printf (" %% unimplemented shift, arg1=%d, arg2=%d\n " ,arg1,arg2);
499- }
471+ stream.printf (" %% unimplemented shift, arg1=%d, arg2=%d\n " ,arg1,arg2);
472+ }
500473
501- /* Invoke the CharStrings procedure to print the component. */
502- stream.printf (" false CharStrings /%s get exec\n " ,
503- ttfont_CharStrings_getname (font,glyphIndex));
474+ /* Invoke the CharStrings procedure to print the component. */
475+ stream.printf (" false CharStrings /%s get exec\n " ,
476+ ttfont_CharStrings_getname (font, glyphIndex));
504477
505- /* If we translated the coordinate system, */
506- /* put it back the way it was. */
507- if ( flags & ARGS_ARE_XY_VALUES && (arg1 != 0 || arg2 != 0 ) )
508- {
509- stream.puts (" grestore " );
510- }
478+ /* If we translated the coordinate system, */
479+ /* put it back the way it was. */
480+ if ( flags & ARGS_ARE_XY_VALUES && (arg1 != 0 || arg2 != 0 ) )
481+ {
482+ stream.puts (" grestore " );
511483 }
512484
513485 }
@@ -559,7 +531,6 @@ GlyphToType3::GlyphToType3(TTStreamWriter& stream, struct TTFONT *font, int char
559531 ycoor = NULL ;
560532 epts_ctr = NULL ;
561533 stack_depth = 0 ;
562- pdf_mode = font->target_type < 0 ;
563534
564535 /* Get a pointer to the data. */
565536 glyph = find_glyph_data ( font, charindex );
@@ -610,15 +581,7 @@ GlyphToType3::GlyphToType3(TTStreamWriter& stream, struct TTFONT *font, int char
610581 /* Execute setcachedevice in order to inform the font machinery */
611582 /* of the character bounding box and advance width. */
612583 stack (stream, 7 );
613- if (pdf_mode)
614- {
615- if (!embedded) {
616- stream.printf (" %d 0 %d %d %d %d d1\n " ,
617- topost (advance_width),
618- topost (llx), topost (lly), topost (urx), topost (ury) );
619- }
620- }
621- else if (font->target_type == PS_TYPE_42_3_HYBRID)
584+ if (font->target_type == PS_TYPE_42_3_HYBRID)
622585 {
623586 stream.printf (" pop gsave .001 .001 scale %d 0 %d %d %d %d setcachedevice\n " ,
624587 topost (advance_width),
0 commit comments