@@ -60,8 +60,6 @@ class GlyphToType3
60
60
61
61
int stack_depth; /* A book-keeping variable for keeping track of the depth of the PS stack */
62
62
63
- bool pdf_mode;
64
-
65
63
void load_char (TTFONT* font, BYTE *glyph);
66
64
void stack (TTStreamWriter& stream, int new_elem);
67
65
void stack_end (TTStreamWriter& stream);
@@ -111,9 +109,8 @@ double area(FWord *x, FWord *y, int n);
111
109
*/
112
110
void GlyphToType3::stack (TTStreamWriter& stream, int new_elem)
113
111
{
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. */
115
113
{
116
- /* have a log of points. */
117
114
if (stack_depth == 0 )
118
115
{
119
116
stream.put_char (' {' );
@@ -132,7 +129,7 @@ void GlyphToType3::stack(TTStreamWriter& stream, int new_elem)
132
129
133
130
void GlyphToType3::stack_end (TTStreamWriter& stream) /* called at end */
134
131
{
135
- if ( !pdf_mode && stack_depth )
132
+ if ( stack_depth )
136
133
{
137
134
stream.puts (" }_e" );
138
135
stack_depth=0 ;
@@ -238,19 +235,17 @@ void GlyphToType3::PSConvert(TTStreamWriter& stream)
238
235
239
236
/* Now, we can fill the whole thing. */
240
237
stack (stream, 1 );
241
- stream.puts ( pdf_mode ? " f " : " _cl" );
238
+ stream.puts (" _cl" );
242
239
} /* end of PSConvert() */
243
240
244
241
void GlyphToType3::PSMoveto (TTStreamWriter& stream, int x, int y)
245
242
{
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);
248
244
}
249
245
250
246
void GlyphToType3::PSLineto (TTStreamWriter& stream, int x, int y)
251
247
{
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);
254
249
}
255
250
256
251
/*
@@ -278,9 +273,9 @@ void GlyphToType3::PSCurveto(TTStreamWriter& stream,
278
273
cy[1 ] = (sy[2 ]+2 *sy[1 ])/3 ;
279
274
cx[2 ] = sx[2 ];
280
275
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 " ,
282
277
(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 ]);
284
279
}
285
280
286
281
/*
@@ -464,50 +459,27 @@ void GlyphToType3::do_composite(TTStreamWriter& stream, struct TTFONT *font, BYT
464
459
(int )flags,arg1,arg2);
465
460
#endif
466
461
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 )
468
465
{
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) );
486
468
}
487
469
else
488
470
{
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
+ }
500
473
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));
504
477
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 " );
511
483
}
512
484
513
485
}
@@ -559,7 +531,6 @@ GlyphToType3::GlyphToType3(TTStreamWriter& stream, struct TTFONT *font, int char
559
531
ycoor = NULL ;
560
532
epts_ctr = NULL ;
561
533
stack_depth = 0 ;
562
- pdf_mode = font->target_type < 0 ;
563
534
564
535
/* Get a pointer to the data. */
565
536
glyph = find_glyph_data ( font, charindex );
@@ -610,15 +581,7 @@ GlyphToType3::GlyphToType3(TTStreamWriter& stream, struct TTFONT *font, int char
610
581
/* Execute setcachedevice in order to inform the font machinery */
611
582
/* of the character bounding box and advance width. */
612
583
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)
622
585
{
623
586
stream.printf (" pop gsave .001 .001 scale %d 0 %d %d %d %d setcachedevice\n " ,
624
587
topost (advance_width),
0 commit comments