ReactOS 0.4.16-dev-2332-g4cba65d
psintrp.c
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * psintrp.c
4 *
5 * Adobe's CFF Interpreter (body).
6 *
7 * Copyright 2007-2014 Adobe Systems Incorporated.
8 *
9 * This software, and all works of authorship, whether in source or
10 * object code form as indicated by the copyright notice(s) included
11 * herein (collectively, the "Work") is made available, and may only be
12 * used, modified, and distributed under the FreeType Project License,
13 * LICENSE.TXT. Additionally, subject to the terms and conditions of the
14 * FreeType Project License, each contributor to the Work hereby grants
15 * to any individual or legal entity exercising permissions granted by
16 * the FreeType Project License and this section (hereafter, "You" or
17 * "Your") a perpetual, worldwide, non-exclusive, no-charge,
18 * royalty-free, irrevocable (except as stated in this section) patent
19 * license to make, have made, use, offer to sell, sell, import, and
20 * otherwise transfer the Work, where such license applies only to those
21 * patent claims licensable by such contributor that are necessarily
22 * infringed by their contribution(s) alone or by combination of their
23 * contribution(s) with the Work to which such contribution(s) was
24 * submitted. If You institute patent litigation against any entity
25 * (including a cross-claim or counterclaim in a lawsuit) alleging that
26 * the Work or a contribution incorporated within the Work constitutes
27 * direct or contributory patent infringement, then any patent licenses
28 * granted to You under this License for that Work shall terminate as of
29 * the date such litigation is filed.
30 *
31 * By using, modifying, or distributing the Work you indicate that you
32 * have read and understood the terms and conditions of the
33 * FreeType Project License as well as those provided in this section,
34 * and you accept them fully.
35 *
36 */
37
38
39#include "psft.h"
42
43#include "psglue.h"
44#include "psfont.h"
45#include "psstack.h"
46#include "pshints.h"
47#include "psintrp.h"
48
49#include "pserror.h"
50
51#include "psobjs.h" /* for cff_random */
52#include "t1decode.h" /* for t1 seac */
53
54
55 /**************************************************************************
56 *
57 * The macro FT_COMPONENT is used in trace mode. It is an implicit
58 * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
59 * messages during execution.
60 */
61#undef FT_COMPONENT
62#define FT_COMPONENT cf2interp
63
64
65 FT_LOCAL_DEF( void )
68 {
69 FT_ZERO( hintmask );
70
71 hintmask->error = error;
72 }
73
74
77 {
78 return hintmask->isValid;
79 }
80
81
84 {
85 return hintmask->isNew;
86 }
87
88
89 FT_LOCAL_DEF( void )
91 FT_Bool val )
92 {
93 hintmask->isNew = val;
94 }
95
96
97 /* clients call `getMaskPtr' in order to iterate */
98 /* through hint mask */
99
102 {
103 return hintmask->mask;
104 }
105
106
107 static size_t
109 size_t bitCount )
110 {
111 if ( bitCount > CF2_MAX_HINTS )
112 {
113 /* total of h and v stems must be <= 96 */
114 CF2_SET_ERROR( hintmask->error, Invalid_Glyph_Format );
115 return 0;
116 }
117
118 hintmask->bitCount = bitCount;
119 hintmask->byteCount = ( hintmask->bitCount + 7 ) / 8;
120
121 hintmask->isValid = TRUE;
122 hintmask->isNew = TRUE;
123
124 return bitCount;
125 }
126
127
128 /* consume the hintmask bytes from the charstring, advancing the src */
129 /* pointer */
130 static void
132 CF2_Buffer charstring,
133 size_t bitCount )
134 {
135 size_t i;
136
137#ifndef CF2_NDEBUG
138 /* these are the bits in the final mask byte that should be zero */
139 /* Note: this variable is only used in an assert expression below */
140 /* and then only if CF2_NDEBUG is not defined */
141 CF2_UInt mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
142#endif
143
144
145 /* initialize counts and isValid */
146 if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
147 return;
148
149 FT_ASSERT( hintmask->byteCount > 0 );
150
151 FT_TRACE4(( " (maskbytes:" ));
152
153 /* set mask and advance interpreter's charstring pointer */
154 for ( i = 0; i < hintmask->byteCount; i++ )
155 {
156 hintmask->mask[i] = (FT_Byte)cf2_buf_readByte( charstring );
157 FT_TRACE4(( " 0x%02X", hintmask->mask[i] ));
158 }
159
160 FT_TRACE4(( ")\n" ));
161
162 /* assert any unused bits in last byte are zero unless there's a prior */
163 /* error */
164 /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */
165#ifndef CF2_NDEBUG
166 FT_ASSERT( ( hintmask->mask[hintmask->byteCount - 1] & mask ) == 0 ||
167 *hintmask->error );
168#endif
169 }
170
171
172 FT_LOCAL_DEF( void )
174 size_t bitCount )
175 {
176 size_t i;
177 CF2_UInt mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
178
179
180 /* initialize counts and isValid */
181 if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
182 return;
183
184 FT_ASSERT( hintmask->byteCount > 0 );
185 FT_ASSERT( hintmask->byteCount <=
186 sizeof ( hintmask->mask ) / sizeof ( hintmask->mask[0] ) );
187
188 /* set mask to all ones */
189 for ( i = 0; i < hintmask->byteCount; i++ )
190 hintmask->mask[i] = 0xFF;
191
192 /* clear unused bits */
193 /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */
194 hintmask->mask[hintmask->byteCount - 1] &= ~mask;
195 }
196
197
198 /* Type2 charstring opcodes */
199 enum
200 {
210 cf2_cmdCLOSEPATH, /* 9 T1 only */
213 cf2_cmdESC, /* 12 */
214 cf2_cmdHSBW, /* 13 T1 only */
217 cf2_cmdBLEND, /* 16 */
232 cf2_cmdHVCURVETO /* 31 */
233 };
234
235 enum
236 {
238 cf2_escVSTEM3, /* 1 T1 only */
239 cf2_escHSTEM3, /* 2 T1 only */
240 cf2_escAND, /* 3 */
241 cf2_escOR, /* 4 */
242 cf2_escNOT, /* 5 */
243 cf2_escSEAC, /* 6 T1 only */
244 cf2_escSBW, /* 7 T1 only */
246 cf2_escABS, /* 9 */
247 cf2_escADD, /* 10 like otherADD */
248 cf2_escSUB, /* 11 like otherSUB */
249 cf2_escDIV, /* 12 */
251 cf2_escNEG, /* 14 */
252 cf2_escEQ, /* 15 */
253 cf2_escCALLOTHERSUBR,/* 16 T1 only */
254 cf2_escPOP, /* 17 T1 only */
255 cf2_escDROP, /* 18 */
257 cf2_escPUT, /* 20 like otherPUT */
258 cf2_escGET, /* 21 like otherGET */
259 cf2_escIFELSE, /* 22 like otherIFELSE */
260 cf2_escRANDOM, /* 23 like otherRANDOM */
261 cf2_escMUL, /* 24 like otherMUL */
263 cf2_escSQRT, /* 26 */
264 cf2_escDUP, /* 27 like otherDUP */
265 cf2_escEXCH, /* 28 like otherEXCH */
266 cf2_escINDEX, /* 29 */
267 cf2_escROLL, /* 30 */
270 cf2_escSETCURRENTPT, /* 33 T1 only */
271 cf2_escHFLEX, /* 34 */
272 cf2_escFLEX, /* 35 */
274 cf2_escFLEX1, /* 37 */
275 cf2_escRESERVED_38 /* 38 & all higher */
276 };
277
278
279 /* `stemHintArray' does not change once we start drawing the outline. */
280 static void
282 CF2_Stack opStack,
283 CF2_ArrStack stemHintArray,
285 FT_Bool* haveWidth,
286 CF2_Fixed hintOffset )
287 {
288 CF2_UInt i;
289 CF2_UInt count = cf2_stack_count( opStack );
290 FT_Bool hasWidthArg = FT_BOOL( count & 1 );
291
292 /* variable accumulates delta values from operand stack */
293 CF2_Fixed position = hintOffset;
294
295 if ( font->isT1 && !font->decoder->flex_state && !*haveWidth )
296 FT_ERROR(( "cf2_doStems (Type 1 mode):"
297 " No width. Use hsbw/sbw as first op\n" ));
298
299 if ( !font->isT1 && hasWidthArg && !*haveWidth )
300 *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
301 cf2_getNominalWidthX( font->decoder ) );
302
303 if ( font->decoder->width_only )
304 goto exit;
305
306 for ( i = hasWidthArg ? 1 : 0; i < count; i += 2 )
307 {
308 /* construct a CF2_StemHint and push it onto the list */
309 CF2_StemHintRec stemhint;
310
311
312 stemhint.min =
313 position = ADD_INT32( position,
314 cf2_stack_getReal( opStack, i ) );
315 stemhint.max =
316 position = ADD_INT32( position,
317 cf2_stack_getReal( opStack, i + 1 ) );
318
319 stemhint.used = FALSE;
320 stemhint.maxDS =
321 stemhint.minDS = 0;
322
323 cf2_arrstack_push( stemHintArray, &stemhint ); /* defer error check */
324 }
325
326 cf2_stack_clear( opStack );
327
328 exit:
329 /* cf2_doStems must define a width (may be default) */
330 *haveWidth = TRUE;
331 }
332
333
334 static void
336 CF2_Fixed* curX,
337 CF2_Fixed* curY,
338 CF2_GlyphPath glyphPath,
339 const FT_Bool* readFromStack,
340 FT_Bool doConditionalLastRead )
341 {
342 CF2_Fixed vals[14];
344 FT_Bool isHFlex;
345 CF2_Int top, i, j;
346
347
348 vals[0] = *curX;
349 vals[1] = *curY;
350 idx = 0;
351 isHFlex = FT_BOOL( readFromStack[9] == FALSE );
352 top = isHFlex ? 9 : 10;
353
354 for ( i = 0; i < top; i++ )
355 {
356 vals[i + 2] = vals[i];
357 if ( readFromStack[i] )
358 vals[i + 2] = ADD_INT32( vals[i + 2], cf2_stack_getReal( opStack,
359 idx++ ) );
360 }
361
362 if ( isHFlex )
363 vals[9 + 2] = *curY;
364
365 if ( doConditionalLastRead )
366 {
367 FT_Bool lastIsX = FT_BOOL(
368 cf2_fixedAbs( SUB_INT32( vals[10], *curX ) ) >
369 cf2_fixedAbs( SUB_INT32( vals[11], *curY ) ) );
370 CF2_Fixed lastVal = cf2_stack_getReal( opStack, idx );
371
372
373 if ( lastIsX )
374 {
375 vals[12] = ADD_INT32( vals[10], lastVal );
376 vals[13] = *curY;
377 }
378 else
379 {
380 vals[12] = *curX;
381 vals[13] = ADD_INT32( vals[11], lastVal );
382 }
383 }
384 else
385 {
386 if ( readFromStack[10] )
387 vals[12] = ADD_INT32( vals[10],
388 cf2_stack_getReal( opStack, idx++ ) );
389 else
390 vals[12] = *curX;
391
392 if ( readFromStack[11] )
393 vals[13] = ADD_INT32( vals[11],
394 cf2_stack_getReal( opStack, idx ) );
395 else
396 vals[13] = *curY;
397 }
398
399 for ( j = 0; j < 2; j++ )
400 cf2_glyphpath_curveTo( glyphPath, vals[j * 6 + 2],
401 vals[j * 6 + 3],
402 vals[j * 6 + 4],
403 vals[j * 6 + 5],
404 vals[j * 6 + 6],
405 vals[j * 6 + 7] );
406
407 cf2_stack_clear( opStack );
408
409 *curX = vals[12];
410 *curY = vals[13];
411 }
412
413
414 /* Blend numOperands on the stack, */
415 /* store results into the first numBlends values, */
416 /* then pop remaining arguments. */
417 static void
418 cf2_doBlend( const CFF_Blend blend,
419 CF2_Stack opStack,
420 CF2_UInt numBlends )
421 {
422 CF2_UInt delta;
424 CF2_UInt i, j;
425 CF2_UInt numOperands = (CF2_UInt)( numBlends * blend->lenBV );
426
427
428 base = cf2_stack_count( opStack ) - numOperands;
429 delta = base + numBlends;
430
431 for ( i = 0; i < numBlends; i++ )
432 {
433 const CF2_Fixed* weight = &blend->BV[1];
434
435 /* start with first term */
436 CF2_Fixed sum = cf2_stack_getReal( opStack, i + base );
437
438
439 for ( j = 1; j < blend->lenBV; j++ )
440 sum = ADD_INT32( sum,
441 FT_MulFix( *weight++,
442 cf2_stack_getReal( opStack,
443 delta++ ) ) );
444
445 /* store blended result */
446 cf2_stack_setReal( opStack, i + base, sum );
447 }
448
449 /* leave only `numBlends' results on stack */
450 cf2_stack_pop( opStack, numOperands - numBlends );
451 }
452
453
454 /*
455 * `error' is a shared error code used by many objects in this
456 * routine. Before the code continues from an error, it must check and
457 * record the error in `*error'. The idea is that this shared
458 * error code will record the first error encountered. If testing
459 * for an error anyway, the cost of `goto exit' is small, so we do it,
460 * even if continuing would be safe. In this case, `lastError' is
461 * set, so the testing and storing can be done in one place, at `exit'.
462 *
463 * Continuing after an error is intended for objects which do their own
464 * testing of `*error', e.g., array stack functions. This allows us to
465 * avoid an extra test after the call.
466 *
467 * Unimplemented opcodes are ignored.
468 *
469 */
470 FT_LOCAL_DEF( void )
473 CF2_OutlineCallbacks callbacks,
474 const FT_Vector* translation,
475 FT_Bool doingSeac,
476 CF2_Fixed curX,
477 CF2_Fixed curY,
479 {
480 /* lastError is used for errors that are immediately tested */
481 FT_Error lastError = FT_Err_Ok;
482
483 /* pointer to parsed font object */
484 PS_Decoder* decoder = font->decoder;
485
486 FT_Error* error = &font->error;
487 FT_Memory memory = font->memory;
488
489 CF2_Fixed scaleY = font->innerTransform.d;
490 CF2_Fixed nominalWidthX = cf2_getNominalWidthX( decoder );
491
492 /* stuff for Type 1 */
493 FT_Int known_othersubr_result_cnt = 0;
494 FT_Bool large_int = FALSE;
495 FT_Bool initial_map_ready = FALSE;
496
497#define PS_STORAGE_SIZE 3
498 CF2_F16Dot16 results[PS_STORAGE_SIZE]; /* for othersubr results */
499 FT_Int result_cnt = 0;
500
501 /* save this for hinting seac accents */
502 CF2_Fixed hintOriginY = curY;
503
504 CF2_Stack opStack = NULL;
505 FT_UInt stackSize;
506 FT_Byte op1; /* first opcode byte */
507
508 CF2_F16Dot16 storage[CF2_STORAGE_SIZE]; /* for `put' and `get' */
509 CF2_F16Dot16 flexStore[6]; /* for Type 1 flex */
510
511 /* instruction limit; 20,000,000 matches Avalon */
512 FT_UInt32 instructionLimit = 20000000UL;
513
514 CF2_ArrStackRec subrStack;
515
516 FT_Bool haveWidth;
517 CF2_Buffer charstring = NULL;
518
519 CF2_Int charstringIndex = -1; /* initialize to empty */
520
521 /* TODO: placeholders for hint structures */
522
523 /* objects used for hinting */
524 CF2_ArrStackRec hStemHintArray;
525 CF2_ArrStackRec vStemHintArray;
526
527 CF2_HintMaskRec hintMask;
528#ifdef __REACTOS__
529 CF2_GlyphPathRec *glyphPath_allocated = malloc(sizeof(*glyphPath_allocated));
530 if (!glyphPath_allocated) return;
531/* Ugly but it allows us to reduce the diff */
532#define glyphPath (*glyphPath_allocated)
533#else
534 CF2_GlyphPathRec glyphPath;
535#endif
536
537 FT_ZERO( &storage );
538 FT_ZERO( &results );
539 FT_ZERO( &flexStore );
540
541 /* initialize the remaining objects */
542 cf2_arrstack_init( &subrStack,
543 memory,
544 error,
545 sizeof ( CF2_BufferRec ) );
546 cf2_arrstack_init( &hStemHintArray,
547 memory,
548 error,
549 sizeof ( CF2_StemHintRec ) );
550 cf2_arrstack_init( &vStemHintArray,
551 memory,
552 error,
553 sizeof ( CF2_StemHintRec ) );
554
555 /* initialize CF2_StemHint arrays */
556 cf2_hintmask_init( &hintMask, error );
557
558 /* initialize path map to manage drawing operations */
559
560 /* Note: last 4 params are used to handle `MoveToPermissive', which */
561 /* may need to call `hintMap.Build' */
562 /* TODO: MoveToPermissive is gone; are these still needed? */
563 cf2_glyphpath_init( &glyphPath,
564 font,
565 callbacks,
566 scaleY,
567 /* hShift, */
568 &hStemHintArray,
569 &vStemHintArray,
570 &hintMask,
571 hintOriginY,
572 &font->blues,
573 translation );
574
575 /*
576 * Initialize state for width parsing. From the CFF Spec:
577 *
578 * The first stack-clearing operator, which must be one of hstem,
579 * hstemhm, vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto,
580 * rmoveto, or endchar, takes an additional argument - the width (as
581 * described earlier), which may be expressed as zero or one numeric
582 * argument.
583 *
584 * What we implement here uses the first validly specified width, but
585 * does not detect errors for specifying more than one width.
586 *
587 * If one of the above operators occurs without explicitly specifying
588 * a width, we assume the default width.
589 *
590 * CFF2 charstrings always return the default width (0).
591 *
592 */
593 haveWidth = font->isCFF2 ? TRUE : FALSE;
595
596 /*
597 * Note: At this point, all pointers to resources must be NULL
598 * and all local objects must be initialized.
599 * There must be no branches to `exit:' above this point.
600 *
601 */
602
603 /* allocate an operand stack */
604 stackSize = font->isCFF2 ? cf2_getMaxstack( decoder )
606 opStack = cf2_stack_init( memory, error, stackSize );
607
608 if ( !opStack )
609 {
610 lastError = FT_THROW( Out_Of_Memory );
611 goto exit;
612 }
613
614 /* initialize subroutine stack by placing top level charstring as */
615 /* first element (max depth plus one for the charstring) */
616 /* Note: Caller owns and must finalize the first charstring. */
617 /* Our copy of it does not change that requirement. */
618 cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );
619
620 charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
621
622 /* catch errors so far */
623 if ( *error )
624 goto exit;
625
626 *charstring = *buf; /* structure copy */
627 charstringIndex = 0; /* entry is valid now */
628
629 /* main interpreter loop */
630 while ( 1 )
631 {
632 if ( font->isT1 )
633 FT_ASSERT( known_othersubr_result_cnt == 0 ||
634 result_cnt == 0 );
635
636 if ( cf2_buf_isEnd( charstring ) )
637 {
638 /* If we've reached the end of the charstring, simulate a */
639 /* cf2_cmdRETURN or cf2_cmdENDCHAR. */
640 /* We do this for both CFF and CFF2. */
641 if ( charstringIndex )
642 op1 = cf2_cmdRETURN; /* end of buffer for subroutine */
643 else
644 op1 = cf2_cmdENDCHAR; /* end of buffer for top level charstring */
645 }
646 else
647 {
648 op1 = (FT_Byte)cf2_buf_readByte( charstring );
649
650 /* Explicit RETURN and ENDCHAR in CFF2 should be ignored. */
651 /* Note: Trace message will report 0 instead of 11 or 14. */
652 if ( ( op1 == cf2_cmdRETURN || op1 == cf2_cmdENDCHAR ) &&
653 font->isCFF2 )
654 op1 = cf2_cmdRESERVED_0;
655 }
656
657 if ( font->isT1 )
658 {
659 if ( !initial_map_ready &&
660 !( op1 == cf2_cmdHSTEM ||
661 op1 == cf2_cmdVSTEM ||
662 op1 == cf2_cmdHSBW ||
663 op1 == cf2_cmdCALLSUBR ||
664 op1 == cf2_cmdRETURN ||
665 op1 == cf2_cmdESC ||
666 op1 == cf2_cmdENDCHAR ||
667 op1 >= 32 /* Numbers */ ) )
668 {
669 /* Skip outline commands first time round. */
670 /* `endchar' will trigger initial hintmap build */
671 /* and rewind the charstring. */
672 FT_TRACE4(( " <outline command skipped>\n" ));
673 cf2_stack_clear( opStack );
674 continue;
675 }
676
677 if ( result_cnt > 0 &&
678 !( op1 == cf2_cmdCALLSUBR ||
679 op1 == cf2_cmdRETURN ||
680 op1 == cf2_cmdESC ||
681 op1 >= 32 /* Numbers */ ) )
682 {
683 /* all operands have been transferred by previous pops */
684 result_cnt = 0;
685 }
686
687 if ( large_int && !( op1 >= 32 || op1 == cf2_escDIV ) )
688 {
689 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
690 " no `div' after large integer\n" ));
691
692 large_int = FALSE;
693 }
694 }
695
696 /* check for errors once per loop */
697 if ( *error )
698 goto exit;
699
700 instructionLimit--;
701 if ( instructionLimit == 0 )
702 {
703 lastError = FT_THROW( Invalid_Glyph_Format );
704 goto exit;
705 }
706
707 switch( op1 )
708 {
712 /* we may get here if we have a prior error */
713 FT_TRACE4(( " unknown op (%d)\n", op1 ));
714 break;
715
716 case cf2_cmdVSINDEX:
717 FT_TRACE4(( " vsindex\n" ));
718
719 if ( !font->isCFF2 )
720 break; /* clear stack & ignore */
721
722 if ( font->blend.usedBV )
723 {
724 /* vsindex not allowed after blend */
725 lastError = FT_THROW( Invalid_Glyph_Format );
726 goto exit;
727 }
728
729 {
730 FT_Int temp = cf2_stack_popInt( opStack );
731
732
733 if ( temp >= 0 )
734 font->vsindex = (FT_UInt)temp;
735 }
736 break;
737
738 case cf2_cmdBLEND:
739 {
740 FT_UInt numBlends;
741
742
743 FT_TRACE4(( " blend\n" ));
744
745 if ( !font->isCFF2 )
746 break; /* clear stack & ignore */
747
748 /* do we have a `blend' op in a non-variant font? */
749 if ( !font->blend.font )
750 {
751 lastError = FT_THROW( Invalid_Glyph_Format );
752 goto exit;
753 }
754
755 /* check cached blend vector */
756 if ( font->cffload->blend_check_vector( &font->blend,
757 font->vsindex,
758 font->lenNDV,
759 font->NDV ) )
760 {
761 lastError = font->cffload->blend_build_vector( &font->blend,
762 font->vsindex,
763 font->lenNDV,
764 font->NDV );
765 if ( lastError )
766 goto exit;
767 }
768
769 /* do the blend */
770 numBlends = (FT_UInt)cf2_stack_popInt( opStack );
771 if ( numBlends > stackSize )
772 {
773 lastError = FT_THROW( Invalid_Glyph_Format );
774 goto exit;
775 }
776
777 cf2_doBlend( &font->blend, opStack, numBlends );
778
779 font->blend.usedBV = TRUE;
780 }
781 continue; /* do not clear the stack */
782
783 case cf2_cmdHSTEMHM:
784 case cf2_cmdHSTEM:
785 FT_TRACE4(( "%s\n", op1 == cf2_cmdHSTEMHM ? " hstemhm"
786 : " hstem" ));
787
788 if ( !font->isT1 )
789 {
790 /* never add hints after the mask is computed */
791 /* except if in Type 1 mode (no hintmask op) */
792 if ( cf2_hintmask_isValid( &hintMask ) )
793 {
794 FT_TRACE4(( "cf2_interpT2CharString:"
795 " invalid horizontal hint mask\n" ));
796 break;
797 }
798 }
799
800 /* add left-sidebearing correction in Type 1 mode */
802 opStack,
803 &hStemHintArray,
804 width,
805 &haveWidth,
806 font->isT1 ? decoder->builder.left_bearing->y
807 : 0 );
808
809 if ( decoder->width_only )
810 goto exit;
811
812 break;
813
814 case cf2_cmdVSTEMHM:
815 case cf2_cmdVSTEM:
816 FT_TRACE4(( "%s\n", op1 == cf2_cmdVSTEMHM ? " vstemhm"
817 : " vstem" ));
818
819 if ( !font->isT1 )
820 {
821 /* never add hints after the mask is computed */
822 /* except if in Type 1 mode (no hintmask op) */
823 if ( cf2_hintmask_isValid( &hintMask ) )
824 {
825 FT_TRACE4(( "cf2_interpT2CharString:"
826 " invalid vertical hint mask\n" ));
827 break;
828 }
829 }
830
831 /* add left-sidebearing correction in Type 1 mode */
833 opStack,
834 &vStemHintArray,
835 width,
836 &haveWidth,
837 font->isT1 ? decoder->builder.left_bearing->x
838 : 0 );
839
840 if ( decoder->width_only )
841 goto exit;
842
843 break;
844
845 case cf2_cmdVMOVETO:
846 FT_TRACE4(( " vmoveto\n" ));
847
848 if ( font->isT1 && !decoder->flex_state && !haveWidth )
849 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
850 " No width. Use hsbw/sbw as first op\n" ));
851
852 if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
853 *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
854 nominalWidthX );
855
856 /* width is defined or default after this */
857 haveWidth = TRUE;
858
859 if ( decoder->width_only )
860 goto exit;
861
862 curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) );
863
864 if ( !decoder->flex_state )
865 cf2_glyphpath_moveTo( &glyphPath, curX, curY );
866
867 break;
868
869 case cf2_cmdRLINETO:
870 {
872 CF2_UInt count = cf2_stack_count( opStack );
873
874
875 FT_TRACE4(( " rlineto\n" ));
876
877 for ( idx = 0; idx < count; idx += 2 )
878 {
879 curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
880 idx + 0 ) );
881 curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
882 idx + 1 ) );
883
884 cf2_glyphpath_lineTo( &glyphPath, curX, curY );
885 }
886
887 cf2_stack_clear( opStack );
888 }
889 continue; /* no need to clear stack again */
890
891 case cf2_cmdHLINETO:
892 case cf2_cmdVLINETO:
893 {
895 CF2_UInt count = cf2_stack_count( opStack );
896
897 FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO );
898
899
900 FT_TRACE4(( "%s\n", isX ? " hlineto" : " vlineto" ));
901
902 for ( idx = 0; idx < count; idx++ )
903 {
904 CF2_Fixed v = cf2_stack_getReal( opStack, idx );
905
906
907 if ( isX )
908 curX = ADD_INT32( curX, v );
909 else
910 curY = ADD_INT32( curY, v );
911
912 isX = !isX;
913
914 cf2_glyphpath_lineTo( &glyphPath, curX, curY );
915 }
916
917 cf2_stack_clear( opStack );
918 }
919 continue;
920
922 case cf2_cmdRRCURVETO:
923 {
924 CF2_UInt count = cf2_stack_count( opStack );
925 CF2_UInt idx = 0;
926
927
928 FT_TRACE4(( "%s\n", op1 == cf2_cmdRCURVELINE ? " rcurveline"
929 : " rrcurveto" ));
930
931 while ( idx + 6 <= count )
932 {
933 CF2_Fixed x1, y1, x2, y2, x3, y3;
934
935
936 x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
937 y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), curY );
938 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), x1 );
939 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y1 );
940 x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
941 y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 5 ), y2 );
942
943 cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
944
945 curX = x3;
946 curY = y3;
947 idx += 6;
948 }
949
950 if ( op1 == cf2_cmdRCURVELINE )
951 {
952 curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
953 idx + 0 ) );
954 curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
955 idx + 1 ) );
956
957 cf2_glyphpath_lineTo( &glyphPath, curX, curY );
958 }
959
960 cf2_stack_clear( opStack );
961 }
962 continue; /* no need to clear stack again */
963
964 case cf2_cmdCLOSEPATH:
965 if ( !font->isT1 )
966 FT_TRACE4(( " unknown op (%d)\n", op1 ));
967 else
968 {
969 FT_TRACE4(( " closepath\n" ));
970
971 /* if there is no path, `closepath' is a no-op */
972 cf2_glyphpath_closeOpenPath( &glyphPath );
973
974 haveWidth = TRUE;
975 }
976 break;
977
978 case cf2_cmdCALLGSUBR:
979 case cf2_cmdCALLSUBR:
980 {
981 CF2_Int subrNum;
982
983
984 FT_TRACE4(( "%s", op1 == cf2_cmdCALLGSUBR ? " callgsubr"
985 : " callsubr" ));
986
987 if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) ||
988 ( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) )
989 {
990 /* max subr plus one for charstring */
991 lastError = FT_THROW( Invalid_Glyph_Format );
992 goto exit; /* overflow of stack */
993 }
994
995 /* push our current CFF charstring region on subrStack */
996 charstring = (CF2_Buffer)
998 &subrStack,
999 (size_t)charstringIndex + 1 );
1000
1001 /* set up the new CFF region and pointer */
1002 subrNum = cf2_stack_popInt( opStack );
1003
1004 if ( font->isT1 && decoder->locals_hash )
1005 {
1006 size_t* val = ft_hash_num_lookup( subrNum,
1007 decoder->locals_hash );
1008
1009
1010 if ( val )
1011 subrNum = *val;
1012 else
1013 subrNum = -1;
1014 }
1015
1016 switch ( op1 )
1017 {
1018 case cf2_cmdCALLGSUBR:
1019 FT_TRACE4(( " (idx %d, entering level %d)\n",
1020 subrNum + decoder->globals_bias,
1021 charstringIndex + 1 ));
1022
1024 subrNum,
1025 charstring ) )
1026 {
1027 lastError = FT_THROW( Invalid_Glyph_Format );
1028 goto exit; /* subroutine lookup or stream error */
1029 }
1030 break;
1031
1032 default:
1033 /* cf2_cmdCALLSUBR */
1034 FT_TRACE4(( " (idx %d, entering level %d)\n",
1035 subrNum + decoder->locals_bias,
1036 charstringIndex + 1 ));
1037
1039 subrNum,
1040 charstring ) )
1041 {
1042 lastError = FT_THROW( Invalid_Glyph_Format );
1043 goto exit; /* subroutine lookup or stream error */
1044 }
1045 }
1046
1047 charstringIndex += 1; /* entry is valid now */
1048 }
1049 continue; /* do not clear the stack */
1050
1051 case cf2_cmdRETURN:
1052 FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
1053
1054 if ( charstringIndex < 1 )
1055 {
1056 /* Note: cannot return from top charstring */
1057 lastError = FT_THROW( Invalid_Glyph_Format );
1058 goto exit; /* underflow of stack */
1059 }
1060
1061 /* restore position in previous charstring */
1062 charstring = (CF2_Buffer)
1064 &subrStack,
1065 (CF2_UInt)--charstringIndex );
1066 continue; /* do not clear the stack */
1067
1068 case cf2_cmdESC:
1069 {
1070 FT_Byte op2 = (FT_Byte)cf2_buf_readByte( charstring );
1071
1072
1073 /* first switch for 2-byte operators handles CFF2 */
1074 /* and opcodes that are reserved for both CFF and CFF2 */
1075 switch ( op2 )
1076 {
1077 case cf2_escHFLEX:
1078 {
1079 static const FT_Bool readFromStack[12] =
1080 {
1081 TRUE /* dx1 */, FALSE /* dy1 */,
1082 TRUE /* dx2 */, TRUE /* dy2 */,
1083 TRUE /* dx3 */, FALSE /* dy3 */,
1084 TRUE /* dx4 */, FALSE /* dy4 */,
1085 TRUE /* dx5 */, FALSE /* dy5 */,
1086 TRUE /* dx6 */, FALSE /* dy6 */
1087 };
1088
1089
1090 FT_TRACE4(( " hflex\n" ));
1091
1092 cf2_doFlex( opStack,
1093 &curX,
1094 &curY,
1095 &glyphPath,
1096 readFromStack,
1097 FALSE /* doConditionalLastRead */ );
1098 }
1099 continue;
1100
1101 case cf2_escFLEX:
1102 {
1103 static const FT_Bool readFromStack[12] =
1104 {
1105 TRUE /* dx1 */, TRUE /* dy1 */,
1106 TRUE /* dx2 */, TRUE /* dy2 */,
1107 TRUE /* dx3 */, TRUE /* dy3 */,
1108 TRUE /* dx4 */, TRUE /* dy4 */,
1109 TRUE /* dx5 */, TRUE /* dy5 */,
1110 TRUE /* dx6 */, TRUE /* dy6 */
1111 };
1112
1113
1114 FT_TRACE4(( " flex\n" ));
1115
1116 cf2_doFlex( opStack,
1117 &curX,
1118 &curY,
1119 &glyphPath,
1120 readFromStack,
1121 FALSE /* doConditionalLastRead */ );
1122 }
1123 break; /* TODO: why is this not a continue? */
1124
1125 case cf2_escHFLEX1:
1126 {
1127 static const FT_Bool readFromStack[12] =
1128 {
1129 TRUE /* dx1 */, TRUE /* dy1 */,
1130 TRUE /* dx2 */, TRUE /* dy2 */,
1131 TRUE /* dx3 */, FALSE /* dy3 */,
1132 TRUE /* dx4 */, FALSE /* dy4 */,
1133 TRUE /* dx5 */, TRUE /* dy5 */,
1134 TRUE /* dx6 */, FALSE /* dy6 */
1135 };
1136
1137
1138 FT_TRACE4(( " hflex1\n" ));
1139
1140 cf2_doFlex( opStack,
1141 &curX,
1142 &curY,
1143 &glyphPath,
1144 readFromStack,
1145 FALSE /* doConditionalLastRead */ );
1146 }
1147 continue;
1148
1149 case cf2_escFLEX1:
1150 {
1151 static const FT_Bool readFromStack[12] =
1152 {
1153 TRUE /* dx1 */, TRUE /* dy1 */,
1154 TRUE /* dx2 */, TRUE /* dy2 */,
1155 TRUE /* dx3 */, TRUE /* dy3 */,
1156 TRUE /* dx4 */, TRUE /* dy4 */,
1157 TRUE /* dx5 */, TRUE /* dy5 */,
1158 FALSE /* dx6 */, FALSE /* dy6 */
1159 };
1160
1161
1162 FT_TRACE4(( " flex1\n" ));
1163
1164 cf2_doFlex( opStack,
1165 &curX,
1166 &curY,
1167 &glyphPath,
1168 readFromStack,
1169 TRUE /* doConditionalLastRead */ );
1170 }
1171 continue;
1172
1173 /* these opcodes are always reserved */
1174 case cf2_escRESERVED_8:
1175 case cf2_escRESERVED_13:
1176 case cf2_escRESERVED_19:
1177 case cf2_escRESERVED_25:
1178 case cf2_escRESERVED_31:
1179 case cf2_escRESERVED_32:
1180 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1181 break;
1182
1183 default:
1184 {
1185 if ( font->isCFF2 || op2 >= cf2_escRESERVED_38 )
1186 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1187 else if ( font->isT1 && result_cnt > 0 && op2 != cf2_escPOP )
1188 {
1189 /* all operands have been transferred by previous pops */
1190 result_cnt = 0;
1191 }
1192 else
1193 {
1194 /* second switch for 2-byte operators handles */
1195 /* CFF and Type 1 */
1196 switch ( op2 )
1197 {
1198
1199 case cf2_escDOTSECTION:
1200 /* something about `flip type of locking' -- ignore it */
1201 FT_TRACE4(( " dotsection\n" ));
1202
1203 break;
1204
1205 case cf2_escVSTEM3:
1206 case cf2_escHSTEM3:
1207 /*
1208 * Type 1: Type 2:
1209 * x0 dx0 x1 dx1 x2 dx2 vstem3 x dx {dxa dxb}* vstem
1210 * y0 dy0 y1 dy1 y2 dy2 hstem3 y dy {dya dyb}* hstem
1211 * relative to lsb point relative to zero
1212 *
1213 */
1214 {
1215 if ( !font->isT1 )
1216 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1217 else
1218 {
1219 CF2_F16Dot16 v0, v1, v2;
1220
1221 FT_Bool isV = FT_BOOL( op2 == cf2_escVSTEM3 );
1222
1223
1224 FT_TRACE4(( "%s\n", isV ? " vstem3"
1225 : " hstem3" ));
1226
1227 FT_ASSERT( cf2_stack_count( opStack ) == 6 );
1228
1229 v0 = cf2_stack_getReal( opStack, 0 );
1230 v1 = cf2_stack_getReal( opStack, 2 );
1231 v2 = cf2_stack_getReal( opStack, 4 );
1232
1234 opStack, 2,
1235 SUB_INT32( SUB_INT32( v1, v0 ),
1236 cf2_stack_getReal( opStack, 1 ) ) );
1238 opStack, 4,
1239 SUB_INT32( SUB_INT32( v2, v1 ),
1240 cf2_stack_getReal( opStack, 3 ) ) );
1241
1242 /* add left-sidebearing correction */
1244 opStack,
1245 isV ? &vStemHintArray : &hStemHintArray,
1246 width,
1247 &haveWidth,
1248 isV ? decoder->builder.left_bearing->x
1249 : decoder->builder.left_bearing->y );
1250
1251 if ( decoder->width_only )
1252 goto exit;
1253 }
1254 }
1255 break;
1256
1257 case cf2_escAND:
1258 {
1261
1262
1263 FT_TRACE4(( " and\n" ));
1264
1265 arg2 = cf2_stack_popFixed( opStack );
1266 arg1 = cf2_stack_popFixed( opStack );
1267
1268 cf2_stack_pushInt( opStack, arg1 && arg2 );
1269 }
1270 continue; /* do not clear the stack */
1271
1272 case cf2_escOR:
1273 {
1276
1277
1278 FT_TRACE4(( " or\n" ));
1279
1280 arg2 = cf2_stack_popFixed( opStack );
1281 arg1 = cf2_stack_popFixed( opStack );
1282
1283 cf2_stack_pushInt( opStack, arg1 || arg2 );
1284 }
1285 continue; /* do not clear the stack */
1286
1287 case cf2_escNOT:
1288 {
1290
1291
1292 FT_TRACE4(( " not\n" ));
1293
1294 arg = cf2_stack_popFixed( opStack );
1295
1296 cf2_stack_pushInt( opStack, !arg );
1297 }
1298 continue; /* do not clear the stack */
1299
1300 case cf2_escSEAC:
1301 if ( !font->isT1 )
1302 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1303 else
1304 {
1306 CF2_Int bchar_index, achar_index;
1307 FT_Vector left_bearing, advance;
1308
1309#ifdef FT_CONFIG_OPTION_INCREMENTAL
1310 T1_Face face = (T1_Face)decoder->builder.face;
1311#endif
1312 CF2_BufferRec component;
1313 CF2_Fixed dummyWidth;
1314
1315 CF2_Int achar = cf2_stack_popInt( opStack );
1316 CF2_Int bchar = cf2_stack_popInt( opStack );
1317
1318 FT_Pos ady = cf2_stack_popFixed ( opStack );
1319 FT_Pos adx = cf2_stack_popFixed ( opStack );
1320 FT_Pos asb = cf2_stack_popFixed ( opStack );
1321
1322
1323 FT_TRACE4(( " seac\n" ));
1324
1325 if ( doingSeac )
1326 {
1327 FT_ERROR(( " nested seac\n" ));
1328 lastError = FT_THROW( Invalid_Glyph_Format );
1329 goto exit; /* nested seac */
1330 }
1331
1332 if ( decoder->builder.metrics_only )
1333 {
1334 FT_ERROR(( " unexpected seac\n" ));
1335 lastError = FT_THROW( Invalid_Glyph_Format );
1336 goto exit; /* unexpected seac */
1337 }
1338
1339 /* `glyph_names' is set to 0 for CID fonts which do */
1340 /* not include an encoding. How can we deal with */
1341 /* these? */
1342#ifdef FT_CONFIG_OPTION_INCREMENTAL
1343 if ( decoder->glyph_names == 0 &&
1344 !face->root.internal->incremental_interface )
1345#else
1346 if ( decoder->glyph_names == 0 )
1347#endif /* FT_CONFIG_OPTION_INCREMENTAL */
1348 {
1349 FT_ERROR((
1350 "cf2_interpT2CharString: (Type 1 seac)"
1351 " glyph names table not available in this font\n" ));
1352 lastError = FT_THROW( Invalid_Glyph_Format );
1353 goto exit;
1354 }
1355
1356 /* seac weirdness */
1357 adx += decoder->builder.left_bearing->x;
1358
1359#ifdef FT_CONFIG_OPTION_INCREMENTAL
1360 if ( face->root.internal->incremental_interface )
1361 {
1362 /* the caller must handle the font encoding also */
1363 bchar_index = bchar;
1364 achar_index = achar;
1365 }
1366 else
1367#endif
1368 {
1370 decoder, bchar );
1372 decoder, achar );
1373 }
1374
1375 if ( bchar_index < 0 || achar_index < 0 )
1376 {
1377 FT_ERROR((
1378 "cf2_interpT2CharString: (Type 1 seac)"
1379 " invalid seac character code arguments\n" ));
1380 lastError = FT_THROW( Invalid_Glyph_Format );
1381 goto exit;
1382 }
1383
1384 /* if we are trying to load a composite glyph, */
1385 /* do not load the accent character and return */
1386 /* the array of subglyphs. */
1387 if ( decoder->builder.no_recurse )
1388 {
1389 FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
1390 FT_GlyphLoader loader = glyph->internal->loader;
1391 FT_SubGlyph subg;
1392
1393
1394 /* reallocate subglyph array if necessary */
1396 if ( error2 )
1397 {
1398 lastError = error2; /* pass FreeType error through */
1399 goto exit;
1400 }
1401
1402 subg = loader->current.subglyphs;
1403
1404 /* subglyph 0 = base character */
1405 subg->index = bchar_index;
1408 subg->arg1 = 0;
1409 subg->arg2 = 0;
1410 subg++;
1411
1412 /* subglyph 1 = accent character */
1413 subg->index = achar_index;
1415 subg->arg1 = (FT_Int)FIXED_TO_INT( adx - asb );
1416 subg->arg2 = (FT_Int)FIXED_TO_INT( ady );
1417
1418 /* set up remaining glyph fields */
1419 glyph->num_subglyphs = 2;
1420 glyph->subglyphs = loader->base.subglyphs;
1421 glyph->format = FT_GLYPH_FORMAT_COMPOSITE;
1422
1423 loader->current.num_subglyphs = 2;
1424
1425 goto exit;
1426 }
1427
1428 /* First load `bchar' in builder */
1429 /* now load the unscaled outline */
1430
1431 /* prepare loader */
1432 FT_GlyphLoader_Prepare( decoder->builder.loader );
1433
1435 (FT_UInt)bchar_index,
1436 &component );
1437 if ( error2 )
1438 {
1439 lastError = error2; /* pass FreeType error through */
1440 goto exit;
1441 }
1442
1443 /* save the left bearing and width of the SEAC */
1444 /* glyph as they will be erased by the next load */
1445
1446 left_bearing = *decoder->builder.left_bearing;
1447 advance = *decoder->builder.advance;
1448
1450 &component,
1451 callbacks,
1452 translation,
1453 TRUE,
1454 0,
1455 0,
1456 &dummyWidth );
1457 cf2_freeT1SeacComponent( decoder, &component );
1458
1459 /* If the SEAC glyph doesn't have a (H)SBW of its */
1460 /* own use the values from the base glyph. */
1461
1462 if ( !haveWidth )
1463 {
1464 left_bearing = *decoder->builder.left_bearing;
1465 advance = *decoder->builder.advance;
1466 }
1467
1468 decoder->builder.left_bearing->x = 0;
1469 decoder->builder.left_bearing->y = 0;
1470
1471 /* Now load `achar' on top of */
1472 /* the base outline */
1473
1475 (FT_UInt)achar_index,
1476 &component );
1477 if ( error2 )
1478 {
1479 lastError = error2; /* pass FreeType error through */
1480 goto exit;
1481 }
1483 &component,
1484 callbacks,
1485 translation,
1486 TRUE,
1487 adx - asb,
1488 ady,
1489 &dummyWidth );
1490 cf2_freeT1SeacComponent( decoder, &component );
1491
1492 /* restore the left side bearing and advance width */
1493 /* of the SEAC glyph or base character (saved above) */
1494
1495 *decoder->builder.left_bearing = left_bearing;
1496 *decoder->builder.advance = advance;
1497
1498 goto exit;
1499 }
1500 break;
1501
1502 case cf2_escSBW:
1503 if ( !font->isT1 )
1504 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1505 else
1506 {
1507 CF2_Fixed lsb_x, lsb_y;
1508 PS_Builder* builder;
1509
1510
1511 FT_TRACE4(( " sbw" ));
1512
1513 builder = &decoder->builder;
1514
1515 builder->advance->y = cf2_stack_popFixed( opStack );
1516 builder->advance->x = cf2_stack_popFixed( opStack );
1517
1518 lsb_y = cf2_stack_popFixed( opStack );
1519 lsb_x = cf2_stack_popFixed( opStack );
1520
1521 builder->left_bearing->x =
1522 ADD_INT32( builder->left_bearing->x, lsb_x );
1523 builder->left_bearing->y =
1524 ADD_INT32( builder->left_bearing->y, lsb_y );
1525
1526 haveWidth = TRUE;
1527
1528 /* the `metrics_only' indicates that we only want */
1529 /* to compute the glyph's metrics (lsb + advance */
1530 /* width), not load the rest of it; so exit */
1531 /* immediately */
1532 if ( builder->metrics_only )
1533 goto exit;
1534
1535 if ( initial_map_ready )
1536 {
1537 curX = ADD_INT32( curX, lsb_x );
1538 curY = ADD_INT32( curY, lsb_y );
1539 }
1540 }
1541 break;
1542
1543 case cf2_escABS:
1544 {
1546
1547
1548 FT_TRACE4(( " abs\n" ));
1549
1550 arg = cf2_stack_popFixed( opStack );
1551
1552 if ( arg < -CF2_FIXED_MAX )
1554 else
1555 cf2_stack_pushFixed( opStack, FT_ABS( arg ) );
1556 }
1557 continue; /* do not clear the stack */
1558
1559 case cf2_escADD:
1560 {
1561 CF2_F16Dot16 summand1;
1562 CF2_F16Dot16 summand2;
1563
1564
1565 FT_TRACE4(( " add\n" ));
1566
1567 summand2 = cf2_stack_popFixed( opStack );
1568 summand1 = cf2_stack_popFixed( opStack );
1569
1570 cf2_stack_pushFixed( opStack,
1571 ADD_INT32( summand1,
1572 summand2 ) );
1573 }
1574 continue; /* do not clear the stack */
1575
1576 case cf2_escSUB:
1577 {
1578 CF2_F16Dot16 minuend;
1579 CF2_F16Dot16 subtrahend;
1580
1581
1582 FT_TRACE4(( " sub\n" ));
1583
1584 subtrahend = cf2_stack_popFixed( opStack );
1585 minuend = cf2_stack_popFixed( opStack );
1586
1587 cf2_stack_pushFixed( opStack,
1588 SUB_INT32( minuend, subtrahend ) );
1589 }
1590 continue; /* do not clear the stack */
1591
1592 case cf2_escDIV:
1593 {
1594 CF2_F16Dot16 dividend;
1596
1597
1598 FT_TRACE4(( " div\n" ));
1599
1600 if ( font->isT1 && large_int )
1601 {
1603 dividend = (CF2_F16Dot16)cf2_stack_popInt( opStack );
1604
1605 large_int = FALSE;
1606 }
1607 else
1608 {
1609 divisor = cf2_stack_popFixed( opStack );
1610 dividend = cf2_stack_popFixed( opStack );
1611 }
1612
1613 cf2_stack_pushFixed( opStack,
1614 FT_DivFix( dividend, divisor ) );
1615
1616 }
1617 continue; /* do not clear the stack */
1618
1619 case cf2_escNEG:
1620 {
1622
1623
1624 FT_TRACE4(( " neg\n" ));
1625
1626 arg = cf2_stack_popFixed( opStack );
1627
1628 if ( arg < -CF2_FIXED_MAX )
1630 else
1631 cf2_stack_pushFixed( opStack, -arg );
1632 }
1633 continue; /* do not clear the stack */
1634
1635 case cf2_escEQ:
1636 {
1639
1640
1641 FT_TRACE4(( " eq\n" ));
1642
1643 arg2 = cf2_stack_popFixed( opStack );
1644 arg1 = cf2_stack_popFixed( opStack );
1645
1646 cf2_stack_pushInt( opStack, arg1 == arg2 );
1647 }
1648 continue; /* do not clear the stack */
1649
1651 if ( !font->isT1 )
1652 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
1653 else
1654 {
1655 CF2_Int subr_no;
1658 CF2_UInt opIdx = 0;
1659
1660
1661 FT_TRACE4(( " callothersubr\n" ));
1662
1663 subr_no = cf2_stack_popInt( opStack );
1664 arg_cnt = cf2_stack_popInt( opStack );
1665
1666 /********************************************************
1667 *
1668 * remove all operands to callothersubr from the stack
1669 *
1670 * for handled othersubrs, where we know the number of
1671 * arguments, we increase the stack by the value of
1672 * known_othersubr_result_cnt
1673 *
1674 * for unhandled othersubrs the following pops adjust
1675 * the stack pointer as necessary
1676 */
1677
1678 count = cf2_stack_count( opStack );
1680
1681 opIdx += count - (CF2_UInt)arg_cnt;
1682
1683 known_othersubr_result_cnt = 0;
1684 result_cnt = 0;
1685
1686 /* XXX TODO: The checks to `arg_count == <whatever>' */
1687 /* might not be correct; an othersubr expects a */
1688 /* certain number of operands on the PostScript stack */
1689 /* (as opposed to the T1 stack) but it doesn't have to */
1690 /* put them there by itself; previous othersubrs might */
1691 /* have left the operands there if they were not */
1692 /* followed by an appropriate number of pops */
1693 /* */
1694 /* On the other hand, Adobe Reader 7.0.8 for Linux */
1695 /* doesn't accept a font that contains charstrings */
1696 /* like */
1697 /* */
1698 /* 100 200 2 20 callothersubr */
1699 /* 300 1 20 callothersubr pop */
1700 /* */
1701 /* Perhaps this is the reason why BuildCharArray */
1702 /* exists. */
1703
1704 switch ( subr_no )
1705 {
1706 case 0: /* end flex feature */
1707 if ( arg_cnt != 3 )
1708 goto Unexpected_OtherSubr;
1709
1710 if ( initial_map_ready &&
1711 ( !decoder->flex_state ||
1712 decoder->num_flex_vectors != 7 ) )
1713 {
1714 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
1715 " unexpected flex end\n" ));
1716 lastError = FT_THROW( Invalid_Glyph_Format );
1717 goto exit;
1718 }
1719
1720 /* the two `results' are popped */
1721 /* by the following setcurrentpoint */
1722 cf2_stack_pushFixed( opStack, curX );
1723 cf2_stack_pushFixed( opStack, curY );
1724 known_othersubr_result_cnt = 2;
1725 break;
1726
1727 case 1: /* start flex feature */
1728 if ( arg_cnt != 0 )
1729 goto Unexpected_OtherSubr;
1730
1731 if ( !initial_map_ready )
1732 break;
1733
1734 if ( ps_builder_check_points( &decoder->builder, 6 ) )
1735 goto exit;
1736
1737 decoder->flex_state = 1;
1738 decoder->num_flex_vectors = 0;
1739 break;
1740
1741 case 2: /* add flex vectors */
1742 {
1743 FT_Int idx;
1744 FT_Int idx2;
1745
1746
1747 if ( arg_cnt != 0 )
1748 goto Unexpected_OtherSubr;
1749
1750 if ( !initial_map_ready )
1751 break;
1752
1753 if ( !decoder->flex_state )
1754 {
1755 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
1756 " missing flex start\n" ));
1757 lastError = FT_THROW( Invalid_Glyph_Format );
1758 goto exit;
1759 }
1760
1761 /* note that we should not add a point for */
1762 /* index 0; this will move our current position */
1763 /* to the flex point without adding any point */
1764 /* to the outline */
1765 idx = decoder->num_flex_vectors++;
1766 if ( idx > 0 && idx < 7 )
1767 {
1768 /* in malformed fonts it is possible to have */
1769 /* other opcodes in the middle of a flex (which */
1770 /* don't increase `num_flex_vectors'); we thus */
1771 /* have to check whether we can add a point */
1772
1773 if ( ps_builder_check_points( &decoder->builder,
1774 1 ) )
1775 {
1776 lastError = FT_THROW( Invalid_Glyph_Format );
1777 goto exit;
1778 }
1779
1780 /* map: 1->2 2->4 3->6 4->2 5->4 6->6 */
1781 idx2 = ( idx > 3 ? idx - 3 : idx ) * 2;
1782
1783 flexStore[idx2 - 2] = curX;
1784 flexStore[idx2 - 1] = curY;
1785
1786 if ( idx == 3 || idx == 6 )
1787 cf2_glyphpath_curveTo( &glyphPath,
1788 flexStore[0],
1789 flexStore[1],
1790 flexStore[2],
1791 flexStore[3],
1792 flexStore[4],
1793 flexStore[5] );
1794 }
1795 }
1796 break;
1797
1798 case 3: /* change hints */
1799 if ( arg_cnt != 1 )
1800 goto Unexpected_OtherSubr;
1801
1802 if ( initial_map_ready )
1803 {
1804 /* do not clear hints if initial hintmap */
1805 /* is not ready - we need to collate all */
1806 cf2_arrstack_clear( &vStemHintArray );
1807 cf2_arrstack_clear( &hStemHintArray );
1808
1809 cf2_hintmask_init( &hintMask, error );
1810 hintMask.isValid = FALSE;
1811 hintMask.isNew = TRUE;
1812 }
1813
1814 known_othersubr_result_cnt = 1;
1815 break;
1816
1817 case 12:
1818 case 13:
1819 /* counter control hints, clear stack */
1820 cf2_stack_clear( opStack );
1821 break;
1822
1823 case 14:
1824 case 15:
1825 case 16:
1826 case 17:
1827 case 18: /* multiple masters */
1828 {
1829 PS_Blend blend = decoder->blend;
1830 FT_UInt num_points, nn, mm;
1831 CF2_UInt delta;
1833
1834
1835 if ( !blend )
1836 {
1837 FT_ERROR((
1838 "cf2_interpT2CharString:"
1839 " unexpected multiple masters operator\n" ));
1840 lastError = FT_THROW( Invalid_Glyph_Format );
1841 goto exit;
1842 }
1843
1844 num_points = (FT_UInt)subr_no - 13 +
1845 ( subr_no == 18 );
1846 if ( arg_cnt != (FT_Int)( num_points *
1847 blend->num_designs ) )
1848 {
1849 FT_ERROR((
1850 "cf2_interpT2CharString:"
1851 " incorrect number of multiple masters arguments\n" ));
1852 lastError = FT_THROW( Invalid_Glyph_Format );
1853 goto exit;
1854 }
1855
1856 /* We want to compute */
1857 /* */
1858 /* a0*w0 + a1*w1 + ... + ak*wk */
1859 /* */
1860 /* but we only have a0, a1-a0, a2-a0, ..., ak-a0. */
1861 /* */
1862 /* However, given that w0 + w1 + ... + wk == 1, we */
1863 /* can rewrite it easily as */
1864 /* */
1865 /* a0 + (a1-a0)*w1 + (a2-a0)*w2 + ... + (ak-a0)*wk */
1866 /* */
1867 /* where k == num_designs-1. */
1868 /* */
1869 /* I guess that's why it's written in this `compact' */
1870 /* form. */
1871 /* */
1872 delta = opIdx + num_points;
1873 values = opIdx;
1874 for ( nn = 0; nn < num_points; nn++ )
1875 {
1876 CF2_Fixed tmp = cf2_stack_getReal( opStack,
1877 values );
1878
1879
1880 for ( mm = 1; mm < blend->num_designs; mm++ )
1881 tmp = ADD_INT32( tmp,
1882 FT_MulFix(
1883 cf2_stack_getReal( opStack,
1884 delta++ ),
1885 blend->weight_vector[mm] ) );
1886
1887 cf2_stack_setReal( opStack, values++, tmp );
1888 }
1889 cf2_stack_pop( opStack,
1890 (CF2_UInt)arg_cnt - num_points );
1891
1892 known_othersubr_result_cnt = (FT_Int)num_points;
1893 break;
1894 }
1895
1896 case 19:
1897 /* <idx> 1 19 callothersubr */
1898 /* ==> replace elements starting from index */
1899 /* cvi( <idx> ) of BuildCharArray with */
1900 /* WeightVector */
1901 {
1902 FT_Int idx;
1903 PS_Blend blend = decoder->blend;
1904
1905
1906 if ( arg_cnt != 1 || !blend )
1907 goto Unexpected_OtherSubr;
1908
1909 idx = cf2_stack_popInt( opStack );
1910
1911 if ( idx < 0 ||
1912 (FT_UInt)idx + blend->num_designs >
1913 decoder->len_buildchar )
1914 goto Unexpected_OtherSubr;
1915
1916 ft_memcpy( &decoder->buildchar[idx],
1917 blend->weight_vector,
1918 blend->num_designs *
1919 sizeof ( blend->weight_vector[0] ) );
1920 }
1921 break;
1922
1923 case 20:
1924 /* <arg1> <arg2> 2 20 callothersubr pop */
1925 /* ==> push <arg1> + <arg2> onto T1 stack */
1926 {
1927 CF2_F16Dot16 summand1;
1928 CF2_F16Dot16 summand2;
1929
1930
1931 if ( arg_cnt != 2 )
1932 goto Unexpected_OtherSubr;
1933
1934 summand2 = cf2_stack_popFixed( opStack );
1935 summand1 = cf2_stack_popFixed( opStack );
1936
1937 cf2_stack_pushFixed( opStack,
1938 ADD_INT32( summand1,
1939 summand2 ) );
1940 known_othersubr_result_cnt = 1;
1941 }
1942 break;
1943
1944 case 21:
1945 /* <arg1> <arg2> 2 21 callothersubr pop */
1946 /* ==> push <arg1> - <arg2> onto T1 stack */
1947 {
1948 CF2_F16Dot16 minuend;
1949 CF2_F16Dot16 subtrahend;
1950
1951
1952 if ( arg_cnt != 2 )
1953 goto Unexpected_OtherSubr;
1954
1955 subtrahend = cf2_stack_popFixed( opStack );
1956 minuend = cf2_stack_popFixed( opStack );
1957
1958 cf2_stack_pushFixed( opStack,
1959 SUB_INT32( minuend,
1960 subtrahend ) );
1961 known_othersubr_result_cnt = 1;
1962 }
1963 break;
1964
1965 case 22:
1966 /* <arg1> <arg2> 2 22 callothersubr pop */
1967 /* ==> push <arg1> * <arg2> onto T1 stack */
1968 {
1969 CF2_F16Dot16 factor1;
1970 CF2_F16Dot16 factor2;
1971
1972
1973 if ( arg_cnt != 2 )
1974 goto Unexpected_OtherSubr;
1975
1976 factor2 = cf2_stack_popFixed( opStack );
1977 factor1 = cf2_stack_popFixed( opStack );
1978
1979 cf2_stack_pushFixed( opStack,
1980 FT_MulFix( factor1, factor2 ) );
1981 known_othersubr_result_cnt = 1;
1982 }
1983 break;
1984
1985 case 23:
1986 /* <arg1> <arg2> 2 23 callothersubr pop */
1987 /* ==> push <arg1> / <arg2> onto T1 stack */
1988 {
1989 CF2_F16Dot16 dividend;
1991
1992
1993 if ( arg_cnt != 2 )
1994 goto Unexpected_OtherSubr;
1995
1996 divisor = cf2_stack_popFixed( opStack );
1997 dividend = cf2_stack_popFixed( opStack );
1998
1999 if ( divisor == 0 )
2000 goto Unexpected_OtherSubr;
2001
2002 cf2_stack_pushFixed( opStack,
2003 FT_DivFix( dividend,
2004 divisor ) );
2005 known_othersubr_result_cnt = 1;
2006 }
2007 break;
2008
2009 case 24:
2010 /* <val> <idx> 2 24 callothersubr */
2011 /* ==> set BuildCharArray[cvi( <idx> )] = <val> */
2012 {
2013 CF2_Int idx;
2014 PS_Blend blend = decoder->blend;
2015
2016
2017 if ( arg_cnt != 2 || !blend )
2018 goto Unexpected_OtherSubr;
2019
2020 idx = cf2_stack_popInt( opStack );
2021
2022 if ( idx < 0 ||
2023 (FT_UInt)idx >= decoder->len_buildchar )
2024 goto Unexpected_OtherSubr;
2025
2026 decoder->buildchar[idx] =
2027 cf2_stack_popFixed( opStack );
2028 }
2029 break;
2030
2031 case 25:
2032 /* <idx> 1 25 callothersubr pop */
2033 /* ==> push BuildCharArray[cvi( idx )] */
2034 /* onto T1 stack */
2035 {
2036 CF2_Int idx;
2037 PS_Blend blend = decoder->blend;
2038
2039
2040 if ( arg_cnt != 1 || !blend )
2041 goto Unexpected_OtherSubr;
2042
2043 idx = cf2_stack_popInt( opStack );
2044
2045 if ( idx < 0 ||
2046 (FT_UInt)idx >= decoder->len_buildchar )
2047 goto Unexpected_OtherSubr;
2048
2049 cf2_stack_pushFixed( opStack,
2050 decoder->buildchar[idx] );
2051 known_othersubr_result_cnt = 1;
2052 }
2053 break;
2054
2055#if 0
2056 case 26:
2057 /* <val> mark <idx> */
2058 /* ==> set BuildCharArray[cvi( <idx> )] = <val>, */
2059 /* leave mark on T1 stack */
2060 /* <val> <idx> */
2061 /* ==> set BuildCharArray[cvi( <idx> )] = <val> */
2062 XXX which routine has left its mark on the
2063 XXX (PostScript) stack?;
2064 break;
2065#endif
2066
2067 case 27:
2068 /* <res1> <res2> <val1> <val2> 4 27 callothersubr pop */
2069 /* ==> push <res1> onto T1 stack if <val1> <= <val2>, */
2070 /* otherwise push <res2> */
2071 {
2074 CF2_F16Dot16 cond1;
2075 CF2_F16Dot16 cond2;
2076
2077
2078 if ( arg_cnt != 4 )
2079 goto Unexpected_OtherSubr;
2080
2081 cond2 = cf2_stack_popFixed( opStack );
2082 cond1 = cf2_stack_popFixed( opStack );
2083 arg2 = cf2_stack_popFixed( opStack );
2084 arg1 = cf2_stack_popFixed( opStack );
2085
2086 cf2_stack_pushFixed( opStack,
2087 cond1 <= cond2 ? arg1 : arg2 );
2088 known_othersubr_result_cnt = 1;
2089 }
2090 break;
2091
2092 case 28:
2093 /* 0 28 callothersubr pop */
2094 /* ==> push random value from interval [0, 1) */
2095 /* onto stack */
2096 {
2098
2099
2100 if ( arg_cnt != 0 )
2101 goto Unexpected_OtherSubr;
2102
2103 /* only use the lower 16 bits of `random' */
2104 /* to generate a number in the range (0;1] */
2105 r = (CF2_F16Dot16)
2106 ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
2107
2108 decoder->current_subfont->random =
2109 cff_random( decoder->current_subfont->random );
2110
2111 cf2_stack_pushFixed( opStack, r );
2112 known_othersubr_result_cnt = 1;
2113 }
2114 break;
2115
2116 default:
2117 if ( arg_cnt >= 0 && subr_no >= 0 )
2118 {
2119 FT_Int i;
2120
2121
2122 FT_ERROR((
2123 "cf2_interpT2CharString (Type 1 mode):"
2124 " unknown othersubr [%d %d], wish me luck\n",
2125 arg_cnt, subr_no ));
2126
2127 /* store the unused args */
2128 /* for this unhandled OtherSubr */
2129
2130 if ( arg_cnt > PS_STORAGE_SIZE )
2132 result_cnt = arg_cnt;
2133
2134 for ( i = 1; i <= arg_cnt; i++ )
2135 results[result_cnt - i] =
2136 cf2_stack_popFixed( opStack );
2137
2138 break;
2139 }
2140 /* fall through */
2141
2142 Unexpected_OtherSubr:
2143 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
2144 " invalid othersubr [%d %d]\n",
2145 arg_cnt, subr_no ));
2146 lastError = FT_THROW( Invalid_Glyph_Format );
2147 goto exit;
2148 }
2149 }
2150 continue; /* do not clear the stack */
2151
2152 case cf2_escPOP:
2153 if ( !font->isT1 )
2154 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
2155 else
2156 {
2157 FT_TRACE4(( " pop" ));
2158
2159 if ( known_othersubr_result_cnt > 0 )
2160 {
2161 known_othersubr_result_cnt--;
2162 /* ignore, we pushed the operands ourselves */
2163 continue;
2164 }
2165
2166 if ( result_cnt == 0 )
2167 {
2168 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
2169 " no more operands for othersubr\n" ));
2170 lastError = FT_THROW( Invalid_Glyph_Format );
2171 goto exit;
2172 }
2173
2174 result_cnt--;
2175 cf2_stack_pushFixed( opStack, results[result_cnt] );
2176 }
2177 continue; /* do not clear the stack */
2178
2179 case cf2_escDROP:
2180 FT_TRACE4(( " drop\n" ));
2181
2182 (void)cf2_stack_popFixed( opStack );
2183 continue; /* do not clear the stack */
2184
2185 case cf2_escPUT:
2186 {
2188 CF2_Int idx;
2189
2190
2191 FT_TRACE4(( " put\n" ));
2192
2193 idx = cf2_stack_popInt( opStack );
2194 val = cf2_stack_popFixed( opStack );
2195
2196 if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
2197 storage[idx] = val;
2198 }
2199 continue; /* do not clear the stack */
2200
2201 case cf2_escGET:
2202 {
2203 CF2_Int idx;
2204
2205
2206 FT_TRACE4(( " get\n" ));
2207
2208 idx = cf2_stack_popInt( opStack );
2209
2210 if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
2211 cf2_stack_pushFixed( opStack, storage[idx] );
2212 }
2213 continue; /* do not clear the stack */
2214
2215 case cf2_escIFELSE:
2216 {
2219 CF2_F16Dot16 cond1;
2220 CF2_F16Dot16 cond2;
2221
2222
2223 FT_TRACE4(( " ifelse\n" ));
2224
2225 cond2 = cf2_stack_popFixed( opStack );
2226 cond1 = cf2_stack_popFixed( opStack );
2227 arg2 = cf2_stack_popFixed( opStack );
2228 arg1 = cf2_stack_popFixed( opStack );
2229
2230 cf2_stack_pushFixed( opStack,
2231 cond1 <= cond2 ? arg1 : arg2 );
2232 }
2233 continue; /* do not clear the stack */
2234
2235 case cf2_escRANDOM: /* in spec */
2236 {
2238
2239
2240 FT_TRACE4(( " random\n" ));
2241
2242 /* only use the lower 16 bits of `random' */
2243 /* to generate a number in the range (0;1] */
2244 r = (CF2_F16Dot16)
2245 ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
2246
2247 decoder->current_subfont->random =
2248 cff_random( decoder->current_subfont->random );
2249
2250 cf2_stack_pushFixed( opStack, r );
2251 }
2252 continue; /* do not clear the stack */
2253
2254 case cf2_escMUL:
2255 {
2256 CF2_F16Dot16 factor1;
2257 CF2_F16Dot16 factor2;
2258
2259
2260 FT_TRACE4(( " mul\n" ));
2261
2262 factor2 = cf2_stack_popFixed( opStack );
2263 factor1 = cf2_stack_popFixed( opStack );
2264
2265 cf2_stack_pushFixed( opStack,
2266 FT_MulFix( factor1, factor2 ) );
2267 }
2268 continue; /* do not clear the stack */
2269
2270 case cf2_escSQRT:
2271 {
2273
2274
2275 FT_TRACE4(( " sqrt\n" ));
2276
2277 arg = cf2_stack_popFixed( opStack );
2278 if ( arg > 0 )
2279 {
2280 /* use a start value that doesn't make */
2281 /* the algorithm's addition overflow */
2282 FT_Fixed root = arg < 10 ? arg : arg >> 1;
2283 FT_Fixed new_root;
2284
2285
2286 /* Babylonian method */
2287 for (;;)
2288 {
2289 new_root = ( root + FT_DivFix( arg, root ) + 1 ) >> 1;
2290 if ( new_root == root )
2291 break;
2292 root = new_root;
2293 }
2294 arg = new_root;
2295 }
2296 else
2297 arg = 0;
2298
2299 cf2_stack_pushFixed( opStack, arg );
2300 }
2301 continue; /* do not clear the stack */
2302
2303 case cf2_escDUP:
2304 {
2306
2307
2308 FT_TRACE4(( " dup\n" ));
2309
2310 arg = cf2_stack_popFixed( opStack );
2311
2312 cf2_stack_pushFixed( opStack, arg );
2313 cf2_stack_pushFixed( opStack, arg );
2314 }
2315 continue; /* do not clear the stack */
2316
2317 case cf2_escEXCH:
2318 {
2321
2322
2323 FT_TRACE4(( " exch\n" ));
2324
2325 arg2 = cf2_stack_popFixed( opStack );
2326 arg1 = cf2_stack_popFixed( opStack );
2327
2328 cf2_stack_pushFixed( opStack, arg2 );
2329 cf2_stack_pushFixed( opStack, arg1 );
2330 }
2331 continue; /* do not clear the stack */
2332
2333 case cf2_escINDEX:
2334 {
2335 CF2_Int idx;
2336 CF2_UInt size;
2337
2338
2339 FT_TRACE4(( " index\n" ));
2340
2341 idx = cf2_stack_popInt( opStack );
2342 size = cf2_stack_count( opStack );
2343
2344 if ( size > 0 )
2345 {
2346 /* for `cf2_stack_getReal', */
2347 /* index 0 is bottom of stack */
2348 CF2_UInt gr_idx;
2349
2350
2351 if ( idx < 0 )
2352 gr_idx = size - 1;
2353 else if ( (CF2_UInt)idx >= size )
2354 gr_idx = 0;
2355 else
2356 gr_idx = size - 1 - (CF2_UInt)idx;
2357
2358 cf2_stack_pushFixed( opStack,
2359 cf2_stack_getReal( opStack,
2360 gr_idx ) );
2361 }
2362 }
2363 continue; /* do not clear the stack */
2364
2365 case cf2_escROLL:
2366 {
2367 CF2_Int idx;
2368 CF2_Int count;
2369
2370
2371 FT_TRACE4(( " roll\n" ));
2372
2373 idx = cf2_stack_popInt( opStack );
2374 count = cf2_stack_popInt( opStack );
2375
2376 cf2_stack_roll( opStack, count, idx );
2377 }
2378 continue; /* do not clear the stack */
2379
2381 if ( !font->isT1 )
2382 FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
2383 else
2384 {
2385 FT_TRACE4(( " setcurrentpoint" ));
2386
2387 if ( !initial_map_ready )
2388 break;
2389
2390 /* From the T1 specification, section 6.4: */
2391 /* */
2392 /* The setcurrentpoint command is used only in */
2393 /* conjunction with results from OtherSubrs */
2394 /* procedures. */
2395
2396 /* known_othersubr_result_cnt != 0 is already handled */
2397 /* above. */
2398
2399 /* Note, however, that both Ghostscript and Adobe */
2400 /* Distiller handle this situation by silently */
2401 /* ignoring the inappropriate `setcurrentpoint' */
2402 /* instruction. So we do the same. */
2403#if 0
2404
2405 if ( decoder->flex_state != 1 )
2406 {
2407 FT_ERROR(( "cf2_interpT2CharString:"
2408 " unexpected `setcurrentpoint'\n" ));
2409 goto Syntax_Error;
2410 }
2411 else
2412 ...
2413#endif
2414
2415 curY = cf2_stack_popFixed( opStack );
2416 curX = cf2_stack_popFixed( opStack );
2417
2418 decoder->flex_state = 0;
2419 }
2420 break;
2421
2422 } /* end of 2nd switch checking op2 */
2423 }
2424 }
2425 } /* end of 1st switch checking op2 */
2426 } /* case cf2_cmdESC */
2427
2428 break;
2429
2430 case cf2_cmdHSBW:
2431 if ( !font->isT1 )
2432 FT_TRACE4(( " unknown op (%d)\n", op1 ));
2433 else
2434 {
2435 CF2_Fixed lsb_x;
2436 PS_Builder* builder;
2437
2438
2439 FT_TRACE4(( " hsbw\n" ));
2440
2441 builder = &decoder->builder;
2442
2443 builder->advance->x = cf2_stack_popFixed( opStack );
2444 builder->advance->y = 0;
2445
2446 lsb_x = cf2_stack_popFixed( opStack );
2447
2448 builder->left_bearing->x = ADD_INT32( builder->left_bearing->x,
2449 lsb_x );
2450
2451 haveWidth = TRUE;
2452
2453 /* the `metrics_only' indicates that we only want to compute */
2454 /* the glyph's metrics (lsb + advance width), not load the */
2455 /* rest of it; so exit immediately */
2456 if ( builder->metrics_only )
2457 goto exit;
2458
2459 if ( initial_map_ready )
2460 curX = ADD_INT32( curX, lsb_x );
2461 }
2462 break;
2463
2464 case cf2_cmdENDCHAR:
2465 FT_TRACE4(( " endchar\n" ));
2466
2467 if ( font->isT1 && !initial_map_ready )
2468 {
2469 FT_TRACE5(( "cf2_interpT2CharString (Type 1 mode): "
2470 "Build initial hintmap, rewinding...\n" ));
2471
2472 /* trigger initial hintmap build */
2473 cf2_glyphpath_moveTo( &glyphPath, curX, curY );
2474
2475 initial_map_ready = TRUE;
2476
2477 /* change hints routine - clear for rewind */
2478 cf2_arrstack_clear( &vStemHintArray );
2479 cf2_arrstack_clear( &hStemHintArray );
2480
2481 cf2_hintmask_init( &hintMask, error );
2482 hintMask.isValid = FALSE;
2483 hintMask.isNew = TRUE;
2484
2485 /* rewind charstring */
2486 /* some charstrings use endchar from a final subroutine call */
2487 /* without returning, detect these and exit to the top level */
2488 /* charstring */
2489 while ( charstringIndex > 0 )
2490 {
2491 FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
2492
2493 /* restore position in previous charstring */
2494 charstring = (CF2_Buffer)
2496 &subrStack,
2497 (CF2_UInt)--charstringIndex );
2498 }
2499 charstring->ptr = charstring->start;
2500
2501 break;
2502 }
2503
2504 if ( cf2_stack_count( opStack ) == 1 ||
2505 cf2_stack_count( opStack ) == 5 )
2506 {
2507 if ( !haveWidth )
2508 *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
2509 nominalWidthX );
2510 }
2511
2512 /* width is defined or default after this */
2513 haveWidth = TRUE;
2514
2515 if ( decoder->width_only )
2516 goto exit;
2517
2518 /* close path if still open */
2519 cf2_glyphpath_closeOpenPath( &glyphPath );
2520
2521 /* disable seac for CFF2 and Type1 */
2522 /* (charstring ending with args on stack) */
2523 if ( !font->isCFF2 && !font->isT1 && cf2_stack_count( opStack ) > 1 )
2524 {
2525 /* must be either 4 or 5 -- */
2526 /* this is a (deprecated) implied `seac' operator */
2527
2528 CF2_Int achar;
2529 CF2_Int bchar;
2530 CF2_BufferRec component;
2531 CF2_Fixed dummyWidth; /* ignore component width */
2533
2534
2535 if ( doingSeac )
2536 {
2537 lastError = FT_THROW( Invalid_Glyph_Format );
2538 goto exit; /* nested seac */
2539 }
2540
2541 achar = cf2_stack_popInt( opStack );
2542 bchar = cf2_stack_popInt( opStack );
2543
2544 curY = cf2_stack_popFixed( opStack );
2545 curX = cf2_stack_popFixed( opStack );
2546
2547 error2 = cf2_getSeacComponent( decoder, achar, &component );
2548 if ( error2 )
2549 {
2550 lastError = error2; /* pass FreeType error through */
2551 goto exit;
2552 }
2554 &component,
2555 callbacks,
2556 translation,
2557 TRUE,
2558 curX,
2559 curY,
2560 &dummyWidth );
2561 cf2_freeSeacComponent( decoder, &component );
2562
2563 error2 = cf2_getSeacComponent( decoder, bchar, &component );
2564 if ( error2 )
2565 {
2566 lastError = error2; /* pass FreeType error through */
2567 goto exit;
2568 }
2570 &component,
2571 callbacks,
2572 translation,
2573 TRUE,
2574 0,
2575 0,
2576 &dummyWidth );
2577 cf2_freeSeacComponent( decoder, &component );
2578 }
2579 goto exit;
2580
2581 case cf2_cmdCNTRMASK:
2582 case cf2_cmdHINTMASK:
2583 /* the final \n in the tracing message gets added in */
2584 /* `cf2_hintmask_read' (which also traces the mask bytes) */
2585 FT_TRACE4(( "%s", op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
2586
2587 /* never add hints after the mask is computed */
2588 if ( cf2_stack_count( opStack ) > 1 &&
2589 cf2_hintmask_isValid( &hintMask ) )
2590 {
2591 FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" ));
2592 break;
2593 }
2594
2595 /* if there are arguments on the stack, there this is an */
2596 /* implied cf2_cmdVSTEMHM */
2598 opStack,
2599 &vStemHintArray,
2600 width,
2601 &haveWidth,
2602 0 );
2603
2604 if ( decoder->width_only )
2605 goto exit;
2606
2607 if ( op1 == cf2_cmdHINTMASK )
2608 {
2609 /* consume the hint mask bytes which follow the operator */
2610 cf2_hintmask_read( &hintMask,
2611 charstring,
2612 cf2_arrstack_size( &hStemHintArray ) +
2613 cf2_arrstack_size( &vStemHintArray ) );
2614 }
2615 else
2616 {
2617 /*
2618 * Consume the counter mask bytes which follow the operator:
2619 * Build a temporary hint map, just to place and lock those
2620 * stems participating in the counter mask. These are most
2621 * likely the dominant hstems, and are grouped together in a
2622 * few counter groups, not necessarily in correspondence
2623 * with the hint groups. This reduces the chances of
2624 * conflicts between hstems that are initially placed in
2625 * separate hint groups and then brought together. The
2626 * positions are copied back to `hStemHintArray', so we can
2627 * discard `counterMask' and `counterHintMap'.
2628 *
2629 */
2630#ifdef __REACTOS__
2631 CF2_HintMapRec *counterHintMap_allocated = malloc(sizeof(*counterHintMap_allocated));
2632 CF2_HintMaskRec counterMask;
2633 if (!counterHintMap_allocated)
2634 {
2635 lastError = FT_Err_Out_Of_Memory;
2636 goto exit;
2637 }
2638/* Ugly but it allows us to reduce the diff */
2639#define counterHintMap (*counterHintMap_allocated)
2640#else
2641 CF2_HintMapRec counterHintMap;
2642 CF2_HintMaskRec counterMask;
2643#endif
2644
2645 cf2_hintmap_init( &counterHintMap,
2646 font,
2647 &glyphPath.initialHintMap,
2648 &glyphPath.hintMoves,
2649 scaleY );
2650 cf2_hintmask_init( &counterMask, error );
2651
2652 cf2_hintmask_read( &counterMask,
2653 charstring,
2654 cf2_arrstack_size( &hStemHintArray ) +
2655 cf2_arrstack_size( &vStemHintArray ) );
2656 cf2_hintmap_build( &counterHintMap,
2657 &hStemHintArray,
2658 &vStemHintArray,
2659 &counterMask,
2660 0,
2661 FALSE );
2662#ifdef __REACTOS__
2663 free(counterHintMap_allocated);
2664#undef counterHintMap
2665#endif
2666 }
2667 break;
2668
2669 case cf2_cmdRMOVETO:
2670 FT_TRACE4(( " rmoveto\n" ));
2671
2672 if ( font->isT1 && !decoder->flex_state && !haveWidth )
2673 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
2674 " No width. Use hsbw/sbw as first op\n" ));
2675
2676 if ( cf2_stack_count( opStack ) > 2 && !haveWidth )
2677 *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
2678 nominalWidthX );
2679
2680 /* width is defined or default after this */
2681 haveWidth = TRUE;
2682
2683 if ( decoder->width_only )
2684 goto exit;
2685
2686 curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) );
2687 curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) );
2688
2689 if ( !decoder->flex_state )
2690 cf2_glyphpath_moveTo( &glyphPath, curX, curY );
2691
2692 break;
2693
2694 case cf2_cmdHMOVETO:
2695 FT_TRACE4(( " hmoveto\n" ));
2696
2697 if ( font->isT1 && !decoder->flex_state && !haveWidth )
2698 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
2699 " No width. Use hsbw/sbw as first op\n" ));
2700
2701 if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
2702 *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
2703 nominalWidthX );
2704
2705 /* width is defined or default after this */
2706 haveWidth = TRUE;
2707
2708 if ( decoder->width_only )
2709 goto exit;
2710
2711 curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) );
2712
2713 if ( !decoder->flex_state )
2714 cf2_glyphpath_moveTo( &glyphPath, curX, curY );
2715
2716 break;
2717
2718 case cf2_cmdRLINECURVE:
2719 {
2720 CF2_UInt count = cf2_stack_count( opStack );
2721 CF2_UInt idx = 0;
2722
2723
2724 FT_TRACE4(( " rlinecurve\n" ));
2725
2726 while ( idx + 6 < count )
2727 {
2728 curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
2729 idx + 0 ) );
2730 curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
2731 idx + 1 ) );
2732
2733 cf2_glyphpath_lineTo( &glyphPath, curX, curY );
2734 idx += 2;
2735 }
2736
2737 while ( idx < count )
2738 {
2739 CF2_Fixed x1, y1, x2, y2, x3, y3;
2740
2741
2742 x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
2743 y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), curY );
2744 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), x1 );
2745 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y1 );
2746 x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
2747 y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 5 ), y2 );
2748
2749 cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
2750
2751 curX = x3;
2752 curY = y3;
2753 idx += 6;
2754 }
2755
2756 cf2_stack_clear( opStack );
2757 }
2758 continue; /* no need to clear stack again */
2759
2760 case cf2_cmdVVCURVETO:
2761 {
2762 CF2_UInt count, count1 = cf2_stack_count( opStack );
2763 CF2_UInt idx = 0;
2764
2765
2766 /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
2767 /* we enforce it by clearing the second bit */
2768 /* (and sorting the stack indexing to suit) */
2769 count = count1 & ~2U;
2770 idx += count1 - count;
2771
2772 FT_TRACE4(( " vvcurveto\n" ));
2773
2774 while ( idx < count )
2775 {
2776 CF2_Fixed x1, y1, x2, y2, x3, y3;
2777
2778
2779 if ( ( count - idx ) & 1 )
2780 {
2781 x1 = ADD_INT32( cf2_stack_getReal( opStack, idx ), curX );
2782
2783 idx++;
2784 }
2785 else
2786 x1 = curX;
2787
2788 y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curY );
2789 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
2790 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
2791 x3 = x2;
2792 y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y2 );
2793
2794 cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
2795
2796 curX = x3;
2797 curY = y3;
2798 idx += 4;
2799 }
2800
2801 cf2_stack_clear( opStack );
2802 }
2803 continue; /* no need to clear stack again */
2804
2805 case cf2_cmdHHCURVETO:
2806 {
2807 CF2_UInt count, count1 = cf2_stack_count( opStack );
2808 CF2_UInt idx = 0;
2809
2810
2811 /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
2812 /* we enforce it by clearing the second bit */
2813 /* (and sorting the stack indexing to suit) */
2814 count = count1 & ~2U;
2815 idx += count1 - count;
2816
2817 FT_TRACE4(( " hhcurveto\n" ));
2818
2819 while ( idx < count )
2820 {
2821 CF2_Fixed x1, y1, x2, y2, x3, y3;
2822
2823
2824 if ( ( count - idx ) & 1 )
2825 {
2826 y1 = ADD_INT32( cf2_stack_getReal( opStack, idx ), curY );
2827
2828 idx++;
2829 }
2830 else
2831 y1 = curY;
2832
2833 x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
2834 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
2835 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
2836 x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), x2 );
2837 y3 = y2;
2838
2839 cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
2840
2841 curX = x3;
2842 curY = y3;
2843 idx += 4;
2844 }
2845
2846 cf2_stack_clear( opStack );
2847 }
2848 continue; /* no need to clear stack again */
2849
2850 case cf2_cmdVHCURVETO:
2851 case cf2_cmdHVCURVETO:
2852 {
2853 CF2_UInt count, count1 = cf2_stack_count( opStack );
2854 CF2_UInt idx = 0;
2855
2856 FT_Bool alternate = FT_BOOL( op1 == cf2_cmdHVCURVETO );
2857
2858
2859 /* if `cf2_stack_count' isn't of the form 8n, 8n+1, */
2860 /* 8n+4, or 8n+5, we enforce it by clearing the */
2861 /* second bit */
2862 /* (and sorting the stack indexing to suit) */
2863 count = count1 & ~2U;
2864 idx += count1 - count;
2865
2866 FT_TRACE4(( "%s\n", alternate ? " hvcurveto" : " vhcurveto" ));
2867
2868 while ( idx < count )
2869 {
2870 CF2_Fixed x1, x2, x3, y1, y2, y3;
2871
2872
2873 if ( alternate )
2874 {
2875 x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
2876 y1 = curY;
2877 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
2878 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
2879 y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y2 );
2880
2881 if ( count - idx == 5 )
2882 {
2883 x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
2884
2885 idx++;
2886 }
2887 else
2888 x3 = x2;
2889
2890 alternate = FALSE;
2891 }
2892 else
2893 {
2894 x1 = curX;
2895 y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curY );
2896 x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
2897 y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
2898 x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), x2 );
2899
2900 if ( count - idx == 5 )
2901 {
2902 y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), y2 );
2903
2904 idx++;
2905 }
2906 else
2907 y3 = y2;
2908
2909 alternate = TRUE;
2910 }
2911
2912 cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
2913
2914 curX = x3;
2915 curY = y3;
2916 idx += 4;
2917 }
2918
2919 cf2_stack_clear( opStack );
2920 }
2921 continue; /* no need to clear stack again */
2922
2924 {
2925 CF2_Int v;
2926
2927 CF2_Int byte1 = cf2_buf_readByte( charstring );
2928 CF2_Int byte2 = cf2_buf_readByte( charstring );
2929
2930
2931 v = (FT_Short)( ( byte1 << 8 ) |
2932 byte2 );
2933
2934 FT_TRACE4(( " %d", v ));
2935
2936 cf2_stack_pushInt( opStack, v );
2937 }
2938 continue;
2939
2940 default:
2941 /* numbers */
2942 {
2943 if ( /* op1 >= 32 && */ op1 <= 246 )
2944 {
2945 CF2_Int v;
2946
2947
2948 v = op1 - 139;
2949
2950 FT_TRACE4(( " %d", v ));
2951
2952 /* -107 .. 107 */
2953 cf2_stack_pushInt( opStack, v );
2954 }
2955
2956 else if ( /* op1 >= 247 && */ op1 <= 250 )
2957 {
2958 CF2_Int v;
2959
2960
2961 v = op1;
2962 v -= 247;
2963 v *= 256;
2964 v += cf2_buf_readByte( charstring );
2965 v += 108;
2966
2967 FT_TRACE4(( " %d", v ));
2968
2969 /* 108 .. 1131 */
2970 cf2_stack_pushInt( opStack, v );
2971 }
2972
2973 else if ( /* op1 >= 251 && */ op1 <= 254 )
2974 {
2975 CF2_Int v;
2976
2977
2978 v = op1;
2979 v -= 251;
2980 v *= 256;
2981 v += cf2_buf_readByte( charstring );
2982 v = -v - 108;
2983
2984 FT_TRACE4(( " %d", v ));
2985
2986 /* -1131 .. -108 */
2987 cf2_stack_pushInt( opStack, v );
2988 }
2989
2990 else /* op1 == 255 */
2991 {
2992 CF2_Fixed v;
2993
2994 FT_UInt32 byte1 = (FT_UInt32)cf2_buf_readByte( charstring );
2995 FT_UInt32 byte2 = (FT_UInt32)cf2_buf_readByte( charstring );
2996 FT_UInt32 byte3 = (FT_UInt32)cf2_buf_readByte( charstring );
2997 FT_UInt32 byte4 = (FT_UInt32)cf2_buf_readByte( charstring );
2998
2999
3000 v = (CF2_Fixed)( ( byte1 << 24 ) |
3001 ( byte2 << 16 ) |
3002 ( byte3 << 8 ) |
3003 byte4 );
3004
3005 /*
3006 * For Type 1:
3007 *
3008 * According to the specification, values > 32000 or < -32000
3009 * must be followed by a `div' operator to make the result be
3010 * in the range [-32000;32000]. We expect that the second
3011 * argument of `div' is not a large number. Additionally, we
3012 * don't handle stuff like `<large1> <large2> <num> div <num>
3013 * div' or <large1> <large2> <num> div div'. This is probably
3014 * not allowed anyway.
3015 *
3016 * <large> <num> <num>+ div is not checked but should not be
3017 * allowed as the large value remains untouched.
3018 *
3019 */
3020 if ( font->isT1 )
3021 {
3022 if ( v > 32000 || v < -32000 )
3023 {
3024 if ( large_int )
3025 FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
3026 " no `div' after large integer\n" ));
3027 else
3028 large_int = TRUE;
3029 }
3030
3031 FT_TRACE4(( " %d", v ));
3032
3033 cf2_stack_pushInt( opStack, (CF2_Int)v );
3034 }
3035 else
3036 {
3037 FT_TRACE4(( " %.5fF", v / 65536.0 ));
3038
3039 cf2_stack_pushFixed( opStack, v );
3040 }
3041 }
3042 }
3043 continue; /* don't clear stack */
3044
3045 } /* end of switch statement checking `op1' */
3046
3047 cf2_stack_clear( opStack );
3048
3049 } /* end of main interpreter loop */
3050
3051 /* we get here if the charstring ends without cf2_cmdENDCHAR */
3052 FT_TRACE4(( "cf2_interpT2CharString:"
3053 " charstring ends without ENDCHAR\n" ));
3054
3055 exit:
3056 /* check whether last error seen is also the first one */
3057 cf2_setError( error, lastError );
3058
3059 if ( *error )
3060 FT_TRACE4(( "charstring error %d\n", *error ));
3061
3062 /* free resources from objects we've used */
3063 cf2_glyphpath_finalize( &glyphPath );
3064 cf2_arrstack_finalize( &vStemHintArray );
3065 cf2_arrstack_finalize( &hStemHintArray );
3066 cf2_arrstack_finalize( &subrStack );
3067 cf2_stack_free( opStack );
3068
3069 FT_TRACE4(( "\n" ));
3070
3071#ifdef __REACTOS__
3072 free(glyphPath_allocated);
3073#undef glyphPath
3074#endif
3075 return;
3076 }
3077
3078
3079/* END */
static struct _test_info results[8]
Definition: SetCursorPos.c:31
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
#define FT_LOCAL_DEF(x)
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:607
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS
Definition: freetype.h:3960
struct FT_GlyphSlotRec_ * FT_GlyphSlot
Definition: freetype.h:532
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES
Definition: freetype.h:3955
FT_MulFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:508
return FT_Err_Ok
Definition: ftbbox.c:526
#define FIXED_TO_INT(x)
Definition: ftcalc.h:450
#define SUB_INT32(a, b)
Definition: ftcalc.h:483
#define ADD_INT32(a, b)
Definition: ftcalc.h:481
#define FT_ASSERT(condition)
Definition: ftdebug.h:241
#define FT_ERROR(varformat)
Definition: ftdebug.h:211
#define FT_TRACE5(varformat)
Definition: ftdebug.h:192
#define FT_THROW(e)
Definition: ftdebug.h:243
#define FT_TRACE4(varformat)
Definition: ftdebug.h:191
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid glyph index unsupported glyph image format invalid outline too many hints invalid object handle invalid module handle invalid size handle invalid charmap handle invalid stream handle too many extensions unlisted object invalid stream seek invalid stream read invalid frame operation invalid frame read raster corrupted negative height while rastering invalid opcode stack overflow bad argument invalid reference found ENDF opcode in execution stream invalid code range too many function definitions SFNT font table missing name table missing horizontal PostScript(post) table missing" ) FT_ERRORDEF_( Invalid_Horiz_Metrics
FT_GlyphLoader_Prepare(FT_GlyphLoader loader)
Definition: ftgloadr.c:324
FT_GlyphLoader_CheckSubGlyphs(FT_GlyphLoader loader, FT_UInt n_subs)
Definition: ftgloadr.c:293
size_t * ft_hash_num_lookup(FT_Int num, FT_Hash hash)
Definition: fthash.c:326
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:57
#define FT_ZERO(p)
Definition: ftmemory.h:246
#define FT_ABS(a)
Definition: ftobjs.h:73
#define T1_MAX_SUBRS_CALLS
Definition: ftoption.h:766
#define ft_memcpy
Definition: ftstdlib.h:82
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:64
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
unsigned char FT_Byte
Definition: fttypes.h:154
signed long FT_Fixed
Definition: fttypes.h:287
int FT_Error
Definition: fttypes.h:299
signed short FT_Short
Definition: fttypes.h:198
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_BOOL(x)
Definition: fttypes.h:591
signed int FT_Int
Definition: fttypes.h:220
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLenum GLint GLuint mask
Definition: glext.h:6028
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLint left
Definition: glext.h:7726
GLuint divisor
Definition: glext.h:6313
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat v0
Definition: glext.h:6061
GLfloat GLfloat v1
Definition: glext.h:6062
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
int jpeg_marker_parser_method routine
Definition: jpeglib.h:1093
#define CF2_UInt
Definition: pstypes.h:63
#define CF2_Int
Definition: pstypes.h:64
FT_Int32 CF2_F16Dot16
Definition: pstypes.h:68
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:122
static float int float int float int x3
Definition: server.c:79
static float int float int float int float y3
Definition: server.c:79
Definition: mk_font.cpp:20
cf2_arrstack_getPointer(const CF2_ArrStack arrstack, size_t idx)
Definition: psarrst.c:187
cf2_arrstack_setCount(CF2_ArrStack arrstack, size_t numElements)
Definition: psarrst.c:140
cf2_arrstack_push(CF2_ArrStack arrstack, const void *ptr)
Definition: psarrst.c:212
cf2_arrstack_finalize(CF2_ArrStack arrstack)
Definition: psarrst.c:76
cf2_arrstack_init(CF2_ArrStack arrstack, FT_Memory memory, FT_Error *error, size_t sizeItem)
Definition: psarrst.c:56
cf2_arrstack_getBuffer(const CF2_ArrStack arrstack)
Definition: psarrst.c:177
cf2_arrstack_clear(CF2_ArrStack arrstack)
Definition: psarrst.c:158
cf2_arrstack_size(const CF2_ArrStack arrstack)
Definition: psarrst.c:168
FT_BEGIN_HEADER struct CF2_ArrStackRec_ * CF2_ArrStack
FT_BEGIN_HEADER struct CF2_ArrStackRec_ CF2_ArrStackRec
cf2_setError(FT_Error *error, FT_Error value)
Definition: pserror.c:44
#define CF2_SET_ERROR(error, e)
Definition: pserror.h:110
#define CF2_Fixed
Definition: psfixed.h:48
#define CF2_FIXED_MAX
Definition: psfixed.h:52
#define cf2_fixedAbs(x)
Definition: psfixed.h:68
#define CF2_OPERAND_STACK_SIZE
Definition: psfont.h:52
#define CF2_MAX_SUBR
Definition: psfont.h:53
#define CF2_STORAGE_SIZE
Definition: psfont.h:59
cf2_freeSeacComponent(PS_Decoder *decoder, CF2_Buffer buf)
Definition: psft.c:708
cf2_freeT1SeacComponent(PS_Decoder *decoder, CF2_Buffer buf)
Definition: psft.c:767
cf2_initLocalRegionBuffer(PS_Decoder *decoder, CF2_Int subrNum, CF2_Buffer buf)
Definition: psft.c:798
cf2_getNominalWidthX(PS_Decoder *decoder)
Definition: psft.c:860
cf2_initGlobalRegionBuffer(PS_Decoder *decoder, CF2_Int subrNum, CF2_Buffer buf)
Definition: psft.c:632
cf2_getT1SeacComponent(PS_Decoder *decoder, FT_UInt glyph_index, CF2_Buffer buf)
Definition: psft.c:721
cf2_getMaxstack(PS_Decoder *decoder)
Definition: psft.c:468
cf2_getDefaultWidthX(PS_Decoder *decoder)
Definition: psft.c:850
cf2_getSeacComponent(PS_Decoder *decoder, CF2_Int code, CF2_Buffer buf)
Definition: psft.c:660
cf2_glyphpath_moveTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
Definition: pshints.c:1678
cf2_glyphpath_finalize(CF2_GlyphPath glyphpath)
Definition: pshints.c:1151
cf2_hintmap_build(CF2_HintMap hintmap, CF2_ArrStack hStemHintArray, CF2_ArrStack vStemHintArray, CF2_HintMask hintMask, CF2_Fixed hintOrigin, FT_Bool initialMap)
Definition: pshints.c:805
cf2_glyphpath_curveTo(CF2_GlyphPath glyphpath, CF2_Fixed x1, CF2_Fixed y1, CF2_Fixed x2, CF2_Fixed y2, CF2_Fixed x3, CF2_Fixed y3)
Definition: pshints.c:1814
cf2_glyphpath_closeOpenPath(CF2_GlyphPath glyphpath)
Definition: pshints.c:1904
cf2_glyphpath_lineTo(CF2_GlyphPath glyphpath, CF2_Fixed x, CF2_Fixed y)
Definition: pshints.c:1708
cf2_hintmap_init(CF2_HintMap hintmap, CF2_Font font, CF2_HintMap initialMap, CF2_ArrStack hintMoves, CF2_Fixed scale)
Definition: pshints.c:274
cf2_glyphpath_init(CF2_GlyphPath glyphpath, CF2_Font font, CF2_OutlineCallbacks callbacks, CF2_Fixed scaleY, CF2_ArrStack hStemHintArray, CF2_ArrStack vStemHintArray, CF2_HintMask hintMask, CF2_Fixed hintOriginY, const CF2_Blues blues, const FT_Vector *fractionalTranslation)
Definition: pshints.c:1080
cf2_hintmask_isNew(const CF2_HintMask hintmask)
Definition: psintrp.c:83
static void cf2_doFlex(CF2_Stack opStack, CF2_Fixed *curX, CF2_Fixed *curY, CF2_GlyphPath glyphPath, const FT_Bool *readFromStack, FT_Bool doConditionalLastRead)
Definition: psintrp.c:335
cf2_hintmask_getMaskPtr(CF2_HintMask hintmask)
Definition: psintrp.c:101
@ cf2_cmdVSTEMHM
Definition: psintrp.c:224
@ cf2_cmdRESERVED_2
Definition: psintrp.c:203
@ cf2_cmdVLINETO
Definition: psintrp.c:208
@ cf2_cmdHLINETO
Definition: psintrp.c:207
@ cf2_cmdBLEND
Definition: psintrp.c:217
@ cf2_cmdRLINETO
Definition: psintrp.c:206
@ cf2_cmdRETURN
Definition: psintrp.c:212
@ cf2_cmdENDCHAR
Definition: psintrp.c:215
@ cf2_cmdHVCURVETO
Definition: psintrp.c:232
@ cf2_cmdRCURVELINE
Definition: psintrp.c:225
@ cf2_cmdVMOVETO
Definition: psintrp.c:205
@ cf2_cmdCALLSUBR
Definition: psintrp.c:211
@ cf2_cmdHSTEMHM
Definition: psintrp.c:219
@ cf2_cmdHSTEM
Definition: psintrp.c:202
@ cf2_cmdEXTENDEDNMBR
Definition: psintrp.c:229
@ cf2_cmdRESERVED_17
Definition: psintrp.c:218
@ cf2_cmdHHCURVETO
Definition: psintrp.c:228
@ cf2_cmdVSTEM
Definition: psintrp.c:204
@ cf2_cmdRRCURVETO
Definition: psintrp.c:209
@ cf2_cmdRESERVED_0
Definition: psintrp.c:201
@ cf2_cmdRLINECURVE
Definition: psintrp.c:226
@ cf2_cmdVVCURVETO
Definition: psintrp.c:227
@ cf2_cmdVSINDEX
Definition: psintrp.c:216
@ cf2_cmdCLOSEPATH
Definition: psintrp.c:210
@ cf2_cmdRMOVETO
Definition: psintrp.c:222
@ cf2_cmdHINTMASK
Definition: psintrp.c:220
@ cf2_cmdCNTRMASK
Definition: psintrp.c:221
@ cf2_cmdESC
Definition: psintrp.c:213
@ cf2_cmdHMOVETO
Definition: psintrp.c:223
@ cf2_cmdVHCURVETO
Definition: psintrp.c:231
@ cf2_cmdCALLGSUBR
Definition: psintrp.c:230
@ cf2_cmdHSBW
Definition: psintrp.c:214
static size_t cf2_hintmask_setCounts(CF2_HintMask hintmask, size_t bitCount)
Definition: psintrp.c:108
static void cf2_doStems(const CF2_Font font, CF2_Stack opStack, CF2_ArrStack stemHintArray, CF2_Fixed *width, FT_Bool *haveWidth, CF2_Fixed hintOffset)
Definition: psintrp.c:281
cf2_hintmask_setAll(CF2_HintMask hintmask, size_t bitCount)
Definition: psintrp.c:173
@ cf2_escSBW
Definition: psintrp.c:244
@ cf2_escROLL
Definition: psintrp.c:267
@ cf2_escDUP
Definition: psintrp.c:264
@ cf2_escPOP
Definition: psintrp.c:254
@ cf2_escOR
Definition: psintrp.c:241
@ cf2_escEQ
Definition: psintrp.c:252
@ cf2_escRESERVED_19
Definition: psintrp.c:256
@ cf2_escINDEX
Definition: psintrp.c:266
@ cf2_escVSTEM3
Definition: psintrp.c:238
@ cf2_escRESERVED_13
Definition: psintrp.c:250
@ cf2_escFLEX1
Definition: psintrp.c:274
@ cf2_escRESERVED_8
Definition: psintrp.c:245
@ cf2_escHSTEM3
Definition: psintrp.c:239
@ cf2_escCALLOTHERSUBR
Definition: psintrp.c:253
@ cf2_escSETCURRENTPT
Definition: psintrp.c:270
@ cf2_escPUT
Definition: psintrp.c:257
@ cf2_escRESERVED_31
Definition: psintrp.c:268
@ cf2_escRANDOM
Definition: psintrp.c:260
@ cf2_escRESERVED_32
Definition: psintrp.c:269
@ cf2_escDIV
Definition: psintrp.c:249
@ cf2_escSUB
Definition: psintrp.c:248
@ cf2_escRESERVED_38
Definition: psintrp.c:275
@ cf2_escDROP
Definition: psintrp.c:255
@ cf2_escABS
Definition: psintrp.c:246
@ cf2_escSQRT
Definition: psintrp.c:263
@ cf2_escNEG
Definition: psintrp.c:251
@ cf2_escFLEX
Definition: psintrp.c:272
@ cf2_escSEAC
Definition: psintrp.c:243
@ cf2_escMUL
Definition: psintrp.c:261
@ cf2_escRESERVED_25
Definition: psintrp.c:262
@ cf2_escHFLEX
Definition: psintrp.c:271
@ cf2_escIFELSE
Definition: psintrp.c:259
@ cf2_escHFLEX1
Definition: psintrp.c:273
@ cf2_escDOTSECTION
Definition: psintrp.c:237
@ cf2_escAND
Definition: psintrp.c:240
@ cf2_escGET
Definition: psintrp.c:258
@ cf2_escADD
Definition: psintrp.c:247
@ cf2_escEXCH
Definition: psintrp.c:265
@ cf2_escNOT
Definition: psintrp.c:242
#define PS_STORAGE_SIZE
static void cf2_doBlend(const CFF_Blend blend, CF2_Stack opStack, CF2_UInt numBlends)
Definition: psintrp.c:418
static void cf2_hintmask_read(CF2_HintMask hintmask, CF2_Buffer charstring, size_t bitCount)
Definition: psintrp.c:131
cf2_hintmask_isValid(const CF2_HintMask hintmask)
Definition: psintrp.c:76
cf2_hintmask_init(CF2_HintMask hintmask, FT_Error *error)
Definition: psintrp.c:66
cf2_interpT2CharString(CF2_Font font, CF2_Buffer buf, CF2_OutlineCallbacks callbacks, const FT_Vector *translation, FT_Bool doingSeac, CF2_Fixed curX, CF2_Fixed curY, CF2_Fixed *width)
Definition: psintrp.c:471
cf2_hintmask_setNew(CF2_HintMask hintmask, FT_Bool val)
Definition: psintrp.c:90
cff_random(FT_UInt32 r)
Definition: psobjs.c:2587
ps_builder_check_points(PS_Builder *builder, FT_Int count)
Definition: psobjs.c:2207
cf2_buf_readByte(CF2_Buffer buf)
Definition: psread.c:80
cf2_buf_isEnd(CF2_Buffer buf)
Definition: psread.c:106
FT_BEGIN_HEADER struct CF2_BufferRec_ CF2_BufferRec
FT_BEGIN_HEADER struct CF2_BufferRec_ * CF2_Buffer
cf2_stack_pushInt(CF2_Stack stack, CF2_Int val)
Definition: psstack.c:107
cf2_stack_popFixed(CF2_Stack stack)
Definition: psstack.c:162
cf2_stack_count(CF2_Stack stack)
Definition: psstack.c:100
cf2_stack_setReal(CF2_Stack stack, CF2_UInt idx, CF2_Fixed val)
Definition: psstack.c:212
cf2_stack_clear(CF2_Stack stack)
Definition: psstack.c:325
cf2_stack_popInt(CF2_Stack stack)
Definition: psstack.c:140
cf2_stack_pop(CF2_Stack stack, CF2_UInt num)
Definition: psstack.c:229
cf2_stack_free(CF2_Stack stack)
Definition: psstack.c:84
cf2_stack_roll(CF2_Stack stack, CF2_Int count, CF2_Int shift)
Definition: psstack.c:242
cf2_stack_init(FT_Memory memory, FT_Error *e, FT_UInt stackSize)
Definition: psstack.c:53
cf2_stack_pushFixed(CF2_Stack stack, CF2_Fixed val)
Definition: psstack.c:123
cf2_stack_getReal(CF2_Stack stack, CF2_UInt idx)
Definition: psstack.c:187
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
static calc_node_t temp
Definition: rpn_ieee.c:38
#define error2(s, a, b)
Definition: debug.h:126
#define exit(n)
Definition: config.h:202
weight
Definition: sortkey.c:157
@ CF2_MAX_HINTS
Definition: pshints.h:47
CF2_ArrStackRec hintMoves
Definition: pshints.h:193
CF2_HintMapRec initialHintMap
Definition: pshints.h:191
FT_Bool isNew
Definition: pshints.h:75
size_t byteCount
Definition: pshints.h:78
FT_Error * error
Definition: pshints.h:72
FT_Bool isValid
Definition: pshints.h:74
size_t bitCount
Definition: pshints.h:77
FT_Byte mask[(CF2_MAX_HINTS+7)/8]
Definition: pshints.h:80
CF2_Fixed maxDS
Definition: pshints.h:93
CF2_Fixed min
Definition: pshints.h:89
CF2_Fixed max
Definition: pshints.h:90
FT_Bool used
Definition: pshints.h:87
CF2_Fixed minDS
Definition: pshints.h:92
FT_UInt lenBV
Definition: cfftypes.h:178
FT_Int32 * BV
Definition: cfftypes.h:179
FT_SubGlyph subglyphs
Definition: freetype.h:1893
FT_UInt num_subglyphs
Definition: freetype.h:1892
FT_Slot_Internal internal
Definition: freetype.h:1903
FT_Glyph_Format format
Definition: freetype.h:1884
FT_GlyphLoader loader
Definition: ftobjs.h:425
FT_Pos x
Definition: ftimage.h:77
FT_Pos y
Definition: ftimage.h:78
FT_UInt num_designs
Definition: t1tables.h:297
FT_Fixed * weight_vector
Definition: t1tables.h:304
FT_Vector * advance
Definition: psaux.h:576
FT_Vector * left_bearing
Definition: psaux.h:575
FT_Bool metrics_only
Definition: psaux.h:583
Definition: format.c:80
t1_lookup_glyph_by_stdcharcode_ps(PS_Decoder *decoder, FT_Int charcode)
Definition: t1decode.c:132
struct T1_FaceRec_ * T1_Face
Definition: t1types.h:198
static unsigned arg_cnt(const DISPPARAMS *dp)
Definition: vbscript.h:162
static GLenum which
Definition: wgl_font.c:159
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
void * arg
Definition: msvc.h:10
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define const
Definition: zconf.h:233