Lines Matching full:env
223 template <typename ENV, typename PARAM>
226 static void rmoveto (ENV &env, PARAM& param) {} in rmoveto()
227 static void hmoveto (ENV &env, PARAM& param) {} in hmoveto()
228 static void vmoveto (ENV &env, PARAM& param) {} in vmoveto()
229 static void rlineto (ENV &env, PARAM& param) {} in rlineto()
230 static void hlineto (ENV &env, PARAM& param) {} in hlineto()
231 static void vlineto (ENV &env, PARAM& param) {} in vlineto()
232 static void rrcurveto (ENV &env, PARAM& param) {} in rrcurveto()
233 static void rcurveline (ENV &env, PARAM& param) {} in rcurveline()
234 static void rlinecurve (ENV &env, PARAM& param) {} in rlinecurve()
235 static void vvcurveto (ENV &env, PARAM& param) {} in vvcurveto()
236 static void hhcurveto (ENV &env, PARAM& param) {} in hhcurveto()
237 static void vhcurveto (ENV &env, PARAM& param) {} in vhcurveto()
238 static void hvcurveto (ENV &env, PARAM& param) {} in hvcurveto()
239 static void moveto (ENV &env, PARAM& param, const Point &pt) {} in moveto()
240 static void line (ENV &env, PARAM& param, const Point &pt1) {} in line()
241 …static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) {} in curve()
242 static void hflex (ENV &env, PARAM& param) {} in hflex()
243 static void flex (ENV &env, PARAM& param) {} in flex()
244 static void hflex1 (ENV &env, PARAM& param) {} in hflex1()
245 static void flex1 (ENV &env, PARAM& param) {} in flex1()
248 template <typename ARG, typename OPSET, typename ENV, typename PARAM, typename PATH=PathProcsNull<E…
251 static void process_op (OpCode op, ENV &env, PARAM& param) in process_op()
256 env.returnFromSubr (); in process_op()
259 OPSET::check_width (op, env, param); in process_op()
260 env.set_endchar (true); in process_op()
261 OPSET::flush_args_and_op (op, env, param); in process_op()
265 env.argStack.push_fixed_from_substr (env.substr); in process_op()
269 env.callSubr (env.localSubrs, CSType_LocalSubr); in process_op()
273 env.callSubr (env.globalSubrs, CSType_GlobalSubr); in process_op()
278 OPSET::check_width (op, env, param); in process_op()
279 OPSET::process_hstem (op, env, param); in process_op()
283 OPSET::check_width (op, env, param); in process_op()
284 OPSET::process_vstem (op, env, param); in process_op()
288 OPSET::check_width (op, env, param); in process_op()
289 OPSET::process_hintmask (op, env, param); in process_op()
292 OPSET::check_width (op, env, param); in process_op()
293 PATH::rmoveto (env, param); in process_op()
294 OPSET::process_post_move (op, env, param); in process_op()
297 OPSET::check_width (op, env, param); in process_op()
298 PATH::hmoveto (env, param); in process_op()
299 OPSET::process_post_move (op, env, param); in process_op()
302 OPSET::check_width (op, env, param); in process_op()
303 PATH::vmoveto (env, param); in process_op()
304 OPSET::process_post_move (op, env, param); in process_op()
307 PATH::rlineto (env, param); in process_op()
308 process_post_path (op, env, param); in process_op()
311 PATH::hlineto (env, param); in process_op()
312 process_post_path (op, env, param); in process_op()
315 PATH::vlineto (env, param); in process_op()
316 process_post_path (op, env, param); in process_op()
319 PATH::rrcurveto (env, param); in process_op()
320 process_post_path (op, env, param); in process_op()
323 PATH::rcurveline (env, param); in process_op()
324 process_post_path (op, env, param); in process_op()
327 PATH::rlinecurve (env, param); in process_op()
328 process_post_path (op, env, param); in process_op()
331 PATH::vvcurveto (env, param); in process_op()
332 process_post_path (op, env, param); in process_op()
335 PATH::hhcurveto (env, param); in process_op()
336 process_post_path (op, env, param); in process_op()
339 PATH::vhcurveto (env, param); in process_op()
340 process_post_path (op, env, param); in process_op()
343 PATH::hvcurveto (env, param); in process_op()
344 process_post_path (op, env, param); in process_op()
348 PATH::hflex (env, param); in process_op()
349 OPSET::process_post_flex (op, env, param); in process_op()
353 PATH::flex (env, param); in process_op()
354 OPSET::process_post_flex (op, env, param); in process_op()
358 PATH::hflex1 (env, param); in process_op()
359 OPSET::process_post_flex (op, env, param); in process_op()
363 PATH::flex1 (env, param); in process_op()
364 OPSET::process_post_flex (op, env, param); in process_op()
368 SUPER::process_op (op, env); in process_op()
373 static void process_hstem (OpCode op, ENV &env, PARAM& param) in process_hstem()
375 env.hstem_count += env.argStack.get_count () / 2; in process_hstem()
376 OPSET::flush_args_and_op (op, env, param); in process_hstem()
379 static void process_vstem (OpCode op, ENV &env, PARAM& param) in process_vstem()
381 env.vstem_count += env.argStack.get_count () / 2; in process_vstem()
382 OPSET::flush_args_and_op (op, env, param); in process_vstem()
385 static void process_hintmask (OpCode op, ENV &env, PARAM& param) in process_hintmask()
387 env.determine_hintmask_size (); in process_hintmask()
388 if (likely (env.substr.avail (env.hintmask_size))) in process_hintmask()
390 OPSET::flush_hintmask (op, env, param); in process_hintmask()
391 env.substr.inc (env.hintmask_size); in process_hintmask()
395 static void process_post_flex (OpCode op, ENV &env, PARAM& param) in process_post_flex()
397 OPSET::flush_args_and_op (op, env, param); in process_post_flex()
400 static void check_width (OpCode op, ENV &env, PARAM& param) in check_width()
403 static void process_post_move (OpCode op, ENV &env, PARAM& param) in process_post_move()
405 if (!env.seen_moveto) in process_post_move()
407 env.determine_hintmask_size (); in process_post_move()
408 env.seen_moveto = true; in process_post_move()
410 OPSET::flush_args_and_op (op, env, param); in process_post_move()
413 static void process_post_path (OpCode op, ENV &env, PARAM& param) in process_post_path()
415 OPSET::flush_args_and_op (op, env, param); in process_post_path()
418 static void flush_args_and_op (OpCode op, ENV &env, PARAM& param) in flush_args_and_op()
420 OPSET::flush_args (env, param); in flush_args_and_op()
421 OPSET::flush_op (op, env, param); in flush_args_and_op()
424 static void flush_args (ENV &env, PARAM& param) in flush_args()
426 env.pop_n_args (env.argStack.get_count ()); in flush_args()
429 static void flush_op (OpCode op, ENV &env, PARAM& param) in flush_op()
433 static void flush_hintmask (OpCode op, ENV &env, PARAM& param) in flush_hintmask()
435 OPSET::flush_args_and_op (op, env, param); in flush_hintmask()
460 template <typename PATH, typename ENV, typename PARAM>
463 static void rmoveto (ENV &env, PARAM& param) in rmoveto()
465 Point pt1 = env.get_pt (); in rmoveto()
466 const Number &dy = env.pop_arg (); in rmoveto()
467 const Number &dx = env.pop_arg (); in rmoveto()
469 PATH::moveto (env, param, pt1); in rmoveto()
472 static void hmoveto (ENV &env, PARAM& param) in hmoveto()
474 Point pt1 = env.get_pt (); in hmoveto()
475 pt1.move_x (env.pop_arg ()); in hmoveto()
476 PATH::moveto (env, param, pt1); in hmoveto()
479 static void vmoveto (ENV &env, PARAM& param) in vmoveto()
481 Point pt1 = env.get_pt (); in vmoveto()
482 pt1.move_y (env.pop_arg ()); in vmoveto()
483 PATH::moveto (env, param, pt1); in vmoveto()
486 static void rlineto (ENV &env, PARAM& param) in rlineto()
488 for (unsigned int i = 0; i + 2 <= env.argStack.get_count (); i += 2) in rlineto()
490 Point pt1 = env.get_pt (); in rlineto()
491 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rlineto()
492 PATH::line (env, param, pt1); in rlineto()
496 static void hlineto (ENV &env, PARAM& param) in hlineto()
500 for (; i + 2 <= env.argStack.get_count (); i += 2) in hlineto()
502 pt1 = env.get_pt (); in hlineto()
503 pt1.move_x (env.eval_arg (i)); in hlineto()
504 PATH::line (env, param, pt1); in hlineto()
505 pt1.move_y (env.eval_arg (i+1)); in hlineto()
506 PATH::line (env, param, pt1); in hlineto()
508 if (i < env.argStack.get_count ()) in hlineto()
510 pt1 = env.get_pt (); in hlineto()
511 pt1.move_x (env.eval_arg (i)); in hlineto()
512 PATH::line (env, param, pt1); in hlineto()
516 static void vlineto (ENV &env, PARAM& param) in vlineto()
520 for (; i + 2 <= env.argStack.get_count (); i += 2) in vlineto()
522 pt1 = env.get_pt (); in vlineto()
523 pt1.move_y (env.eval_arg (i)); in vlineto()
524 PATH::line (env, param, pt1); in vlineto()
525 pt1.move_x (env.eval_arg (i+1)); in vlineto()
526 PATH::line (env, param, pt1); in vlineto()
528 if (i < env.argStack.get_count ()) in vlineto()
530 pt1 = env.get_pt (); in vlineto()
531 pt1.move_y (env.eval_arg (i)); in vlineto()
532 PATH::line (env, param, pt1); in vlineto()
536 static void rrcurveto (ENV &env, PARAM& param) in rrcurveto()
538 for (unsigned int i = 0; i + 6 <= env.argStack.get_count (); i += 6) in rrcurveto()
540 Point pt1 = env.get_pt (); in rrcurveto()
541 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rrcurveto()
543 pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); in rrcurveto()
545 pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); in rrcurveto()
546 PATH::curve (env, param, pt1, pt2, pt3); in rrcurveto()
550 static void rcurveline (ENV &env, PARAM& param) in rcurveline()
553 for (; i + 6 <= env.argStack.get_count (); i += 6) in rcurveline()
555 Point pt1 = env.get_pt (); in rcurveline()
556 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rcurveline()
558 pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); in rcurveline()
560 pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); in rcurveline()
561 PATH::curve (env, param, pt1, pt2, pt3); in rcurveline()
563 for (; i + 2 <= env.argStack.get_count (); i += 2) in rcurveline()
565 Point pt1 = env.get_pt (); in rcurveline()
566 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rcurveline()
567 PATH::line (env, param, pt1); in rcurveline()
571 static void rlinecurve (ENV &env, PARAM& param) in rlinecurve()
574 unsigned int line_limit = (env.argStack.get_count () % 6); in rlinecurve()
577 Point pt1 = env.get_pt (); in rlinecurve()
578 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rlinecurve()
579 PATH::line (env, param, pt1); in rlinecurve()
581 for (; i + 6 <= env.argStack.get_count (); i += 6) in rlinecurve()
583 Point pt1 = env.get_pt (); in rlinecurve()
584 pt1.move (env.eval_arg (i), env.eval_arg (i+1)); in rlinecurve()
586 pt2.move (env.eval_arg (i+2), env.eval_arg (i+3)); in rlinecurve()
588 pt3.move (env.eval_arg (i+4), env.eval_arg (i+5)); in rlinecurve()
589 PATH::curve (env, param, pt1, pt2, pt3); in rlinecurve()
593 static void vvcurveto (ENV &env, PARAM& param) in vvcurveto()
596 Point pt1 = env.get_pt (); in vvcurveto()
597 if ((env.argStack.get_count () & 1) != 0) in vvcurveto()
598 pt1.move_x (env.eval_arg (i++)); in vvcurveto()
599 for (; i + 4 <= env.argStack.get_count (); i += 4) in vvcurveto()
601 pt1.move_y (env.eval_arg (i)); in vvcurveto()
603 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in vvcurveto()
605 pt3.move_y (env.eval_arg (i+3)); in vvcurveto()
606 PATH::curve (env, param, pt1, pt2, pt3); in vvcurveto()
607 pt1 = env.get_pt (); in vvcurveto()
611 static void hhcurveto (ENV &env, PARAM& param) in hhcurveto()
614 Point pt1 = env.get_pt (); in hhcurveto()
615 if ((env.argStack.get_count () & 1) != 0) in hhcurveto()
616 pt1.move_y (env.eval_arg (i++)); in hhcurveto()
617 for (; i + 4 <= env.argStack.get_count (); i += 4) in hhcurveto()
619 pt1.move_x (env.eval_arg (i)); in hhcurveto()
621 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in hhcurveto()
623 pt3.move_x (env.eval_arg (i+3)); in hhcurveto()
624 PATH::curve (env, param, pt1, pt2, pt3); in hhcurveto()
625 pt1 = env.get_pt (); in hhcurveto()
629 static void vhcurveto (ENV &env, PARAM& param) in vhcurveto()
633 if ((env.argStack.get_count () % 8) >= 4) in vhcurveto()
635 Point pt1 = env.get_pt (); in vhcurveto()
636 pt1.move_y (env.eval_arg (i)); in vhcurveto()
638 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in vhcurveto()
640 pt3.move_x (env.eval_arg (i+3)); in vhcurveto()
643 for (; i + 8 <= env.argStack.get_count (); i += 8) in vhcurveto()
645 PATH::curve (env, param, pt1, pt2, pt3); in vhcurveto()
646 pt1 = env.get_pt (); in vhcurveto()
647 pt1.move_x (env.eval_arg (i)); in vhcurveto()
649 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in vhcurveto()
651 pt3.move_y (env.eval_arg (i+3)); in vhcurveto()
652 PATH::curve (env, param, pt1, pt2, pt3); in vhcurveto()
655 pt1.move_y (env.eval_arg (i+4)); in vhcurveto()
657 pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); in vhcurveto()
659 pt3.move_x (env.eval_arg (i+7)); in vhcurveto()
661 if (i < env.argStack.get_count ()) in vhcurveto()
662 pt3.move_y (env.eval_arg (i)); in vhcurveto()
663 PATH::curve (env, param, pt1, pt2, pt3); in vhcurveto()
667 for (; i + 8 <= env.argStack.get_count (); i += 8) in vhcurveto()
669 pt1 = env.get_pt (); in vhcurveto()
670 pt1.move_y (env.eval_arg (i)); in vhcurveto()
672 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in vhcurveto()
674 pt3.move_x (env.eval_arg (i+3)); in vhcurveto()
675 PATH::curve (env, param, pt1, pt2, pt3); in vhcurveto()
678 pt1.move_x (env.eval_arg (i+4)); in vhcurveto()
680 pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); in vhcurveto()
682 pt3.move_y (env.eval_arg (i+7)); in vhcurveto()
683 if ((env.argStack.get_count () - i < 16) && ((env.argStack.get_count () & 1) != 0)) in vhcurveto()
684 pt3.move_x (env.eval_arg (i+8)); in vhcurveto()
685 PATH::curve (env, param, pt1, pt2, pt3); in vhcurveto()
690 static void hvcurveto (ENV &env, PARAM& param) in hvcurveto()
694 if ((env.argStack.get_count () % 8) >= 4) in hvcurveto()
696 Point pt1 = env.get_pt (); in hvcurveto()
697 pt1.move_x (env.eval_arg (i)); in hvcurveto()
699 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in hvcurveto()
701 pt3.move_y (env.eval_arg (i+3)); in hvcurveto()
704 for (; i + 8 <= env.argStack.get_count (); i += 8) in hvcurveto()
706 PATH::curve (env, param, pt1, pt2, pt3); in hvcurveto()
707 pt1 = env.get_pt (); in hvcurveto()
708 pt1.move_y (env.eval_arg (i)); in hvcurveto()
710 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in hvcurveto()
712 pt3.move_x (env.eval_arg (i+3)); in hvcurveto()
713 PATH::curve (env, param, pt1, pt2, pt3); in hvcurveto()
716 pt1.move_x (env.eval_arg (i+4)); in hvcurveto()
718 pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); in hvcurveto()
720 pt3.move_y (env.eval_arg (i+7)); in hvcurveto()
722 if (i < env.argStack.get_count ()) in hvcurveto()
723 pt3.move_x (env.eval_arg (i)); in hvcurveto()
724 PATH::curve (env, param, pt1, pt2, pt3); in hvcurveto()
728 for (; i + 8 <= env.argStack.get_count (); i += 8) in hvcurveto()
730 pt1 = env.get_pt (); in hvcurveto()
731 pt1.move_x (env.eval_arg (i)); in hvcurveto()
733 pt2.move (env.eval_arg (i+1), env.eval_arg (i+2)); in hvcurveto()
735 pt3.move_y (env.eval_arg (i+3)); in hvcurveto()
736 PATH::curve (env, param, pt1, pt2, pt3); in hvcurveto()
739 pt1.move_y (env.eval_arg (i+4)); in hvcurveto()
741 pt2.move (env.eval_arg (i+5), env.eval_arg (i+6)); in hvcurveto()
743 pt3.move_x (env.eval_arg (i+7)); in hvcurveto()
744 if ((env.argStack.get_count () - i < 16) && ((env.argStack.get_count () & 1) != 0)) in hvcurveto()
745 pt3.move_y (env.eval_arg (i+8)); in hvcurveto()
746 PATH::curve (env, param, pt1, pt2, pt3); in hvcurveto()
752 static void moveto (ENV &env, PARAM& param, const Point &pt) in moveto()
753 { env.moveto (pt); } in moveto()
755 static void line (ENV &env, PARAM& param, const Point &pt1) in line()
756 { PATH::moveto (env, param, pt1); } in line()
758 static void curve (ENV &env, PARAM& param, const Point &pt1, const Point &pt2, const Point &pt3) in curve()
759 { PATH::moveto (env, param, pt3); } in curve()
761 static void hflex (ENV &env, PARAM& param) in hflex()
763 if (likely (env.argStack.get_count () == 7)) in hflex()
765 Point pt1 = env.get_pt (); in hflex()
766 pt1.move_x (env.eval_arg (0)); in hflex()
768 pt2.move (env.eval_arg (1), env.eval_arg (2)); in hflex()
770 pt3.move_x (env.eval_arg (3)); in hflex()
772 pt4.move_x (env.eval_arg (4)); in hflex()
774 pt5.move_x (env.eval_arg (5)); in hflex()
777 pt6.move_x (env.eval_arg (6)); in hflex()
779 curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); in hflex()
782 env.set_error (); in hflex()
785 static void flex (ENV &env, PARAM& param) in flex()
787 if (likely (env.argStack.get_count () == 13)) in flex()
789 Point pt1 = env.get_pt (); in flex()
790 pt1.move (env.eval_arg (0), env.eval_arg (1)); in flex()
792 pt2.move (env.eval_arg (2), env.eval_arg (3)); in flex()
794 pt3.move (env.eval_arg (4), env.eval_arg (5)); in flex()
796 pt4.move (env.eval_arg (6), env.eval_arg (7)); in flex()
798 pt5.move (env.eval_arg (8), env.eval_arg (9)); in flex()
800 pt6.move (env.eval_arg (10), env.eval_arg (11)); in flex()
802 curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); in flex()
805 env.set_error (); in flex()
808 static void hflex1 (ENV &env, PARAM& param) in hflex1()
810 if (likely (env.argStack.get_count () == 9)) in hflex1()
812 Point pt1 = env.get_pt (); in hflex1()
813 pt1.move (env.eval_arg (0), env.eval_arg (1)); in hflex1()
815 pt2.move (env.eval_arg (2), env.eval_arg (3)); in hflex1()
817 pt3.move_x (env.eval_arg (4)); in hflex1()
819 pt4.move_x (env.eval_arg (5)); in hflex1()
821 pt5.move (env.eval_arg (6), env.eval_arg (7)); in hflex1()
823 pt6.move_x (env.eval_arg (8)); in hflex1()
824 pt6.y = env.get_pt ().y; in hflex1()
826 curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); in hflex1()
829 env.set_error (); in hflex1()
832 static void flex1 (ENV &env, PARAM& param) in flex1()
834 if (likely (env.argStack.get_count () == 11)) in flex1()
839 d.move (env.eval_arg (i), env.eval_arg (i+1)); in flex1()
841 Point pt1 = env.get_pt (); in flex1()
842 pt1.move (env.eval_arg (0), env.eval_arg (1)); in flex1()
844 pt2.move (env.eval_arg (2), env.eval_arg (3)); in flex1()
846 pt3.move (env.eval_arg (4), env.eval_arg (5)); in flex1()
848 pt4.move (env.eval_arg (6), env.eval_arg (7)); in flex1()
850 pt5.move (env.eval_arg (8), env.eval_arg (9)); in flex1()
855 pt6.move_x (env.eval_arg (10)); in flex1()
856 pt6.y = env.get_pt ().y; in flex1()
860 pt6.x = env.get_pt ().x; in flex1()
861 pt6.move_y (env.eval_arg (10)); in flex1()
864 curve2 (env, param, pt1, pt2, pt3, pt4, pt5, pt6); in flex1()
867 env.set_error (); in flex1()
871 static void curve2 (ENV &env, PARAM& param, in curve2()
875 PATH::curve (env, param, pt1, pt2, pt3); in curve2()
876 PATH::curve (env, param, pt4, pt5, pt6); in curve2()
880 template <typename ENV, typename OPSET, typename PARAM>
881 struct CSInterpreter : Interpreter<ENV>
885 SUPER::env.set_endchar (false); in interpret()
888 OPSET::process_op (SUPER::env.fetch_op (), SUPER::env, param); in interpret()
889 if (unlikely (SUPER::env.in_error ())) in interpret()
891 if (SUPER::env.is_endchar ()) in interpret()
899 typedef Interpreter<ENV> SUPER;