1 /*
2 Copyright (C) 2017-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5
6 /*
7 WARNING: This file was generated by the dkct program (see
8 http://dktools.sourceforge.net/ for details).
9 Changes you make here will be lost if dkct is run again!
10 You should modify the original source and run dkct on it.
11 Original source: dk4grepp.ctr
12 */
13
14 /** @file dk4grepp.c The dk4grepp module.
15 */
16
17
18 #include "dk4conf.h"
19
20 #include <stdio.h>
21
22 #ifndef DK4GRA_H_INCLUDED
23 #include <libdk4gra/dk4gra.h>
24 #endif
25
26 #ifndef GRA_H_INCLUDED
27 #include <libdk4gra/gra.h>
28 #endif
29
30 #if DK4_HAVE_ASSERT_H
31 #ifndef ASSERT_H_INCLUDED
32 #include <assert.h>
33 #define ASSERT_H_INCLUDED 1
34 #endif
35 #endif
36
37
38 /** Pattern procedure.
39 */
40 static const char * const p00[] = {
41 /* 0 */
42 "/ThirtyLeft\t\t\t\t% xs xe ys ye dy",
43
44 /* 1 */
45 "{",
46
47 /* 2 */
48 " 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
49
50 /* 3 */
51 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
52
53 /* 4 */
54 " {",
55
56 /* 5 */
57 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
58
59 /* 6 */
60 " 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
61
62 /* 7 */
63 " 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
64
65 /* 8 */
66 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
67
68 /* 9 */
69 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
70
71 /* 10 */
72 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
73
74 /* 11 */
75 " }",
76
77 /* 12 */
78 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
79
80 /* 13 */
81 " pop pop pop pop pop pop pop\t\t% --",
82
83 /* 14 */
84 "} bind def",
85
86 NULL
87
88 };
89
90
91
92 /** Pattern procedure.
93 */
94 static const char * const p01[] = {
95 /* 0 */
96 "/ThirtyRight\t\t\t\t% xs xe ys ye dy",
97
98 /* 1 */
99 "{",
100
101 /* 2 */
102 " 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
103
104 /* 3 */
105 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
106
107 /* 4 */
108 " {",
109
110 /* 5 */
111 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
112
113 /* 6 */
114 " 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
115
116 /* 7 */
117 " 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
118
119 /* 8 */
120 " 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
121
122 /* 9 */
123 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
124
125 /* 10 */
126 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
127
128 /* 11 */
129 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
130
131 /* 12 */
132 " }",
133
134 /* 13 */
135 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
136
137 /* 14 */
138 " pop pop pop pop pop pop pop\t\t% --",
139
140 /* 15 */
141 "} bind def",
142
143 NULL
144
145 };
146
147
148
149 /** Pattern procedure.
150 */
151 static const char * const p02[] = {
152 /* 0 */
153 "/ThirtyHatch\t\t\t\t% xs xe ys ye dy",
154
155 /* 1 */
156 "{",
157
158 /* 2 */
159 " 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
160
161 /* 3 */
162 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
163
164 /* 4 */
165 " {",
166
167 /* 5 */
168 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
169
170 /* 6 */
171 " 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
172
173 /* 7 */
174 " 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
175
176 /* 8 */
177 " 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
178
179 /* 9 */
180 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
181
182 /* 10 */
183 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
184
185 /* 11 */
186 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
187
188 /* 12 */
189 " }",
190
191 /* 13 */
192 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
193
194 /* 14 */
195 " pop pop\t\t\t\t% xs xe ys ye dy",
196
197 /* 15 */
198 " 3 index 5 index sub 3.0 sqrt div\t% xs xe ys ye dy ydiff",
199
200 /* 16 */
201 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
202
203 /* 17 */
204 " {",
205
206 /* 18 */
207 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
208
209 /* 19 */
210 " 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
211
212 /* 20 */
213 " 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
214
215 /* 21 */
216 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
217
218 /* 22 */
219 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
220
221 /* 23 */
222 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
223
224 /* 24 */
225 " }",
226
227 /* 25 */
228 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
229
230 /* 26 */
231 " pop pop pop pop pop pop pop\t\t% --",
232
233 /* 27 */
234 "} bind def",
235
236 NULL
237
238 };
239
240
241
242 /** Pattern procedure.
243 */
244 static const char * const p03[] = {
245 /* 0 */
246 "/FourtyFiveLeft\t\t\t\t% xs xe ys ye dy",
247
248 /* 1 */
249 "{",
250
251 /* 2 */
252 " 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
253
254 /* 3 */
255 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
256
257 /* 4 */
258 " {",
259
260 /* 5 */
261 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
262
263 /* 6 */
264 " 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
265
266 /* 7 */
267 " 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
268
269 /* 8 */
270 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
271
272 /* 9 */
273 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
274
275 /* 10 */
276 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
277
278 /* 11 */
279 " }",
280
281 /* 12 */
282 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
283
284 /* 13 */
285 " pop pop pop pop pop pop pop\t\t% --",
286
287 /* 14 */
288 "} bind def",
289
290 NULL
291
292 };
293
294
295
296 /** Pattern procedure.
297 */
298 static const char * const p04[] = {
299 /* 0 */
300 "/FourtyFiveRight\t\t\t% xs xe ys ye dy",
301
302 /* 1 */
303 "{",
304
305 /* 2 */
306 " 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
307
308 /* 3 */
309 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
310
311 /* 4 */
312 " {",
313
314 /* 5 */
315 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
316
317 /* 6 */
318 " 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
319
320 /* 7 */
321 " 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
322
323 /* 8 */
324 " 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
325
326 /* 9 */
327 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
328
329 /* 10 */
330 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
331
332 /* 11 */
333 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
334
335 /* 12 */
336 " }",
337
338 /* 13 */
339 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
340
341 /* 14 */
342 " pop pop pop pop pop pop pop\t\t% --",
343
344 /* 15 */
345 "} bind def",
346
347 NULL
348
349 };
350
351
352
353 /** Pattern procedure.
354 */
355 static const char * const p05[] = {
356 /* 0 */
357 "/FourtyFiveHatch\t\t\t% xs xe ys ye dy",
358
359 /* 1 */
360 "{",
361
362 /* 2 */
363 " 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
364
365 /* 3 */
366 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
367
368 /* 4 */
369 " {",
370
371 /* 5 */
372 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
373
374 /* 6 */
375 " 5 index 1 index\t\t\t% xs xe ys ye dy ydiff y xe y",
376
377 /* 7 */
378 " 8 index 1 index 5 index add\t\t% xs xe ys ye dy ydiff y xe y xs y2",
379
380 /* 8 */
381 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xe y",
382
383 /* 9 */
384 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
385
386 /* 10 */
387 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
388
389 /* 11 */
390 " }",
391
392 /* 12 */
393 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
394
395 /* 13 */
396 " pop pop \t\t\t\t% xs xe ys ye dy",
397
398 /* 14 */
399 " 3 index 5 index sub \t\t\t% xs xe ys ye dy ydiff",
400
401 /* 15 */
402 " 3 index\t\t\t\t% xs xe ys ye dy ydiff y",
403
404 /* 16 */
405 " {",
406
407 /* 17 */
408 " dup 4 index gt {exit} if\t\t% xs xe ys ye dy ydiff y",
409
410 /* 18 */
411 " 6 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y",
412
413 /* 19 */
414 " 7 index 1 index\t\t\t% xs xe ys ye dy ydiff y xs y xe y",
415
416 /* 20 */
417 " 5 index add\t\t\t\t% xs xe ys ye dy ydiff y xs y xe y2",
418
419 /* 21 */
420 " newpath moveto\t\t\t% xs xe ys ye dy ydiff y xs y",
421
422 /* 22 */
423 " lineto stroke\t\t\t% xs xe ys ye dy ydiff y",
424
425 /* 23 */
426 " 2 index add\t\t\t\t% xs xe ys ye dy ydiff y",
427
428 /* 24 */
429 " }",
430
431 /* 25 */
432 " loop\t\t\t\t\t% xs xe ys ye dy ydiff y",
433
434 /* 26 */
435 " pop pop pop pop pop pop pop\t\t% --",
436
437 /* 27 */
438 "} bind def",
439
440 NULL
441
442 };
443
444
445
446 /** Pattern procedure.
447 */
448 static const char * const p06[] = {
449 /* 0 */
450 "/HorizontalBricks\t\t\t% xs xe ys ye dy",
451
452 /* 1 */
453 "{",
454
455 /* 2 */
456 " 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
457
458 /* 3 */
459 " {",
460
461 /* 4 */
462 " 1 index\t\t\t\t% xs xe ys ye dy y nr y",
463
464 /* 5 */
465 " 4 index\t\t\t\t% xs xe ys ye dy y nr y ye",
466
467 /* 6 */
468 " gt {exit} if\t\t\t% xs xe ys ye dy y nr",
469
470 /* 7 */
471 " 6 index\t\t\t\t% xs xe ys ye dy y nr xs",
472
473 /* 8 */
474 " 2 index\t\t\t\t% xs xe ys ye dy y nr xs y",
475
476 /* 9 */
477 " 7 index\t\t\t\t% xs xe ys ye dy y nr xs y xe",
478
479 /* 10 */
480 " 1 index\t\t\t\t% xs xe ys ye dy y nr xs y xe y",
481
482 /* 11 */
483 " newpath moveto lineto stroke\t% xs xe ys ye dy y nr",
484
485 /* 12 */
486 " 6 index\t\t\t\t% xs xe ys ye dy y nr x",
487
488 /* 13 */
489 " 1 index 0\t\t\t\t% xs xe ys ye dy y nr x nr 0",
490
491 /* 14 */
492 " gt {3 index add} if\t\t\t% xs xe ys ye dy y nr x",
493
494 /* 15 */
495 " {",
496
497 /* 16 */
498 " dup 7 index\t\t\t% xs xe ys ye dy y nr x x xe",
499
500 /* 17 */
501 " gt {exit} if\t\t\t% xs xe ys ye dy y nr x",
502
503 /* 18 */
504 " dup 3 index\t\t\t% xs xe ys ye dy y nr x x y",
505
506 /* 19 */
507 " 1 index 1 index\t\t\t% xs xe ys ye dy y nr x x y x y",
508
509 /* 20 */
510 " 7 index add\t\t\t% xs xe ys ye dy y nr x x y x y",
511
512 /* 21 */
513 " newpath moveto lineto stroke\t% xs xe ys ye dy y nr x",
514
515 /* 22 */
516 " 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
517
518 /* 23 */
519 " }",
520
521 /* 24 */
522 " loop\t\t\t\t% xs xe ys ye dy y nr x",
523
524 /* 25 */
525 " pop\t\t\t\t\t% xs xe ys ye dy y nr",
526
527 /* 26 */
528 " 1 add\t\t\t\t% xs xe ys ye dy y nr",
529
530 /* 27 */
531 " dup\t\t\t\t\t% xs xe ys ye dy y nr nr",
532
533 /* 28 */
534 " 1 gt {pop 0} if\t\t\t% xs xe ys ye dy y nr",
535
536 /* 29 */
537 " exch 2 index add exch\t\t% xs xe ys ye dy y nr",
538
539 /* 30 */
540 " }",
541
542 /* 31 */
543 " loop\t\t\t\t\t% xs xe ys ye dy y nr",
544
545 /* 32 */
546 " pop pop pop pop pop pop pop\t\t% --",
547
548 /* 33 */
549 "} bind def",
550
551 NULL
552
553 };
554
555
556
557 /** Pattern procedure.
558 */
559 static const char * const p07[] = {
560 /* 0 */
561 "/VerticalBricks\t\t\t\t% xs xe ys ye dx",
562
563 /* 1 */
564 "{",
565
566 /* 2 */
567 " 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
568
569 /* 3 */
570 " {",
571
572 /* 4 */
573 " 1 index 6 index\t\t\t% xs xe ys ye dx x nr x xe",
574
575 /* 5 */
576 " gt {exit} if\t\t\t% xs xe ys ye dx x nr",
577
578 /* 6 */
579 " 1 index 5 index\t\t\t% xs xe ys ye dx x nr x ys",
580
581 /* 7 */
582 " 1 index 6 index\t\t\t% xs xe ys ye dx x nr x ys x ye",
583
584 /* 8 */
585 " newpath moveto lineto stroke\t% xs xe ys ye dx x nr",
586
587 /* 9 */
588 " 4 index 1 index 0\t\t\t% xs xe ys ye dx x nr y nr 0",
589
590 /* 10 */
591 " gt {3 index add} if\t\t\t% xs xe ys ye dx x nr y",
592
593 /* 11 */
594 " {",
595
596 /* 12 */
597 " dup 5 index\t\t\t% xs xe ys ye dx x nr y y ye",
598
599 /* 13 */
600 " gt {exit} if\t\t\t% xs xe ys ye dx x nr y",
601
602 /* 14 */
603 " 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
604
605 /* 15 */
606 " dup 2 index\t\t\t% xs xe ys ye dx x nr y x y y x",
607
608 /* 16 */
609 " 7 index add exch\t\t\t% xs xe ys ye dx x nr y x y x y",
610
611 /* 17 */
612 " newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
613
614 /* 18 */
615 " 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
616
617 /* 19 */
618 " }",
619
620 /* 20 */
621 " loop\t\t\t\t% xs xe ys ye dx x nr y",
622
623 /* 21 */
624 " pop\t\t\t\t\t% xs xe ys ye dx x nr",
625
626 /* 22 */
627 " exch 2 index add exch\t\t% xs xe ys ye dx x nr",
628
629 /* 23 */
630 " 1 add\t\t\t\t% xs xe ys ye dx x nr",
631
632 /* 24 */
633 " dup 1\t\t\t\t% xs xe ys ye dx x nr nr 1",
634
635 /* 25 */
636 " gt {pop 0} if\t\t\t% xs xe ys ye dx x nr",
637
638 /* 26 */
639 " }",
640
641 /* 27 */
642 " loop\t\t\t\t\t% xs xe ys ye dx x nr",
643
644 /* 28 */
645 " pop pop pop pop pop pop pop\t\t% --",
646
647 /* 29 */
648 "} bind def",
649
650 NULL
651
652 };
653
654
655
656 /** Pattern procedure.
657 */
658 static const char * const p08[] = {
659 /* 0 */
660 "/HorizontalLines\t\t\t% xs xe ys ye dy",
661
662 /* 1 */
663 "{",
664
665 /* 2 */
666 " 2 index\t\t\t\t% xs xe ys ye dy y",
667
668 /* 3 */
669 " {",
670
671 /* 4 */
672 " dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
673
674 /* 5 */
675 " 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
676
677 /* 6 */
678 " 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
679
680 /* 7 */
681 " newpath moveto\t\t\t% xs xe ys ye dy y xe y",
682
683 /* 8 */
684 " lineto stroke\t\t\t% xs xe ys ye dy y",
685
686 /* 9 */
687 " 1 index add\t\t\t\t% xs xe ys ye dy y",
688
689 /* 10 */
690 " }",
691
692 /* 11 */
693 " loop\t\t\t\t\t% xs xe ys ye dy y",
694
695 /* 12 */
696 " pop pop pop pop pop pop\t\t% --",
697
698 /* 13 */
699 "} bind def",
700
701 NULL
702
703 };
704
705
706
707 /** Pattern procedure.
708 */
709 static const char * const p09[] = {
710 /* 0 */
711 "/VerticalLines\t\t\t\t% xs xe ys ye dx",
712
713 /* 1 */
714 "{",
715
716 /* 2 */
717 " 4 index\t\t\t\t% xs xe ys ye dx x",
718
719 /* 3 */
720 " {",
721
722 /* 4 */
723 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
724
725 /* 5 */
726 " dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
727
728 /* 6 */
729 " 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
730
731 /* 7 */
732 " newpath moveto\t\t\t% xs xe ys ye dx x x ye",
733
734 /* 8 */
735 " lineto stroke\t\t\t% xs xe ys ye dx x",
736
737 /* 9 */
738 " 1 index add\t\t\t\t% xs xe ys ye dx x",
739
740 /* 10 */
741 " }",
742
743 /* 11 */
744 " loop\t\t\t\t\t% xs xe ys ye dx x",
745
746 /* 12 */
747 " pop pop pop pop pop pop\t\t% --",
748
749 /* 13 */
750 "} bind def",
751
752 NULL
753
754 };
755
756
757
758 /** Pattern procedure.
759 */
760 static const char * const p10[] = {
761 /* 0 */
762 "/CrossHatch\t\t\t\t% xs xe ys ye dx",
763
764 /* 1 */
765 "{",
766
767 /* 2 */
768 " 4 index\t\t\t\t% xs xe ys ye dx x",
769
770 /* 3 */
771 " {",
772
773 /* 4 */
774 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
775
776 /* 5 */
777 " dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
778
779 /* 6 */
780 " 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
781
782 /* 7 */
783 " newpath moveto\t\t\t% xs xe ys ye dx x x ye",
784
785 /* 8 */
786 " lineto stroke\t\t\t% xs xe ys ye dx x",
787
788 /* 9 */
789 " 1 index add\t\t\t\t% xs xe ys ye dx x",
790
791 /* 10 */
792 " }",
793
794 /* 11 */
795 " loop\t\t\t\t\t% xs xe ys ye dx x",
796
797 /* 12 */
798 " pop\t\t\t\t\t% xs xe ys ye dy",
799
800 /* 13 */
801 " 2 index\t\t\t\t% xs xe ys ye dy y",
802
803 /* 14 */
804 " {",
805
806 /* 15 */
807 " dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
808
809 /* 16 */
810 " 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
811
812 /* 17 */
813 " 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
814
815 /* 18 */
816 " newpath moveto\t\t\t% xs xe ys ye dy y xe y",
817
818 /* 19 */
819 " lineto stroke\t\t\t% xs xe ys ye dy y",
820
821 /* 20 */
822 " 1 index add\t\t\t\t% xs xe ys ye dy y",
823
824 /* 21 */
825 " }",
826
827 /* 22 */
828 " loop\t\t\t\t\t% xs xe ys ye dy y",
829
830 /* 23 */
831 " pop pop pop pop pop pop\t\t% --",
832
833 /* 24 */
834 "} bind def",
835
836 NULL
837
838 };
839
840
841
842 /** Pattern procedure.
843 */
844 static const char * const p11[] = {
845 /* 0 */
846 "/HorizontalShinglesLeft\t\t\t% xs xe ys ye dy",
847
848 /* 1 */
849 "{",
850
851 /* 2 */
852 " 2 index\t\t\t\t% xs xe ys ye dy y",
853
854 /* 3 */
855 " {",
856
857 /* 4 */
858 " dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
859
860 /* 5 */
861 " 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
862
863 /* 6 */
864 " 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
865
866 /* 7 */
867 " newpath moveto\t\t\t% xs xe ys ye dy y xe y",
868
869 /* 8 */
870 " lineto stroke\t\t\t% xs xe ys ye dy y",
871
872 /* 9 */
873 " 1 index add\t\t\t\t% xs xe ys ye dy y",
874
875 /* 10 */
876 " }",
877
878 /* 11 */
879 " loop\t\t\t\t\t% xs xe ys ye dy y",
880
881 /* 12 */
882 " pop\t\t\t\t\t% xs xe ys ye dy",
883
884 /* 13 */
885 " 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
886
887 /* 14 */
888 " {",
889
890 /* 15 */
891 " 1 index 4 index gt {exit} if\t% xs xe ys ye dy y nr",
892
893 /* 16 */
894 " 6 index\t\t\t\t% xs xe ys ye dy y nr x",
895
896 /* 17 */
897 " 1 index 2 gt",
898
899 /* 18 */
900 " { 3 index 0.5 mul add }",
901
902 /* 19 */
903 " {",
904
905 /* 20 */
906 " 1 index 1 gt",
907
908 /* 21 */
909 " { 3 index add }",
910
911 /* 22 */
912 " {",
913
914 /* 23 */
915 " 1 index 0 gt",
916
917 /* 24 */
918 "\t{ 3 index 1.5 mul add }",
919
920 /* 25 */
921 "\tif",
922
923 /* 26 */
924 " }",
925
926 /* 27 */
927 " ifelse",
928
929 /* 28 */
930 " }",
931
932 /* 29 */
933 " ifelse",
934
935 /* 30 */
936 " {",
937
938 /* 31 */
939 " dup 7 index gt {exit} if\t\t% xs xe ys ye dy y nr x",
940
941 /* 32 */
942 " dup 4 index 0.5 mul add\t\t% xs xe ys ye dy y nr x x2",
943
944 /* 33 */
945 " 3 index 5 index add\t\t% xs xe ys ye dy y nr x x2 y2",
946
947 /* 34 */
948 " 2 index 5 index newpath moveto\t% xs xe ys ye dy y nr x x2 y2",
949
950 /* 35 */
951 " lineto stroke\t\t\t% xs xe ys ye dy y nr x",
952
953 /* 36 */
954 " 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
955
956 /* 37 */
957 " }",
958
959 /* 38 */
960 " loop pop\t\t\t\t% xs xe ys ye dy y nr",
961
962 /* 39 */
963 " exch 2 index add exch\t\t% xs xe ys ye dy y nr",
964
965 /* 40 */
966 " 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dy y nr",
967
968 /* 41 */
969 " }",
970
971 /* 42 */
972 " loop\t\t\t\t\t% xs xe ys ye dy y nr",
973
974 /* 43 */
975 " pop pop pop pop pop pop pop",
976
977 /* 44 */
978 "} bind def",
979
980 NULL
981
982 };
983
984
985
986 /** Pattern procedure.
987 */
988 static const char * const p12[] = {
989 /* 0 */
990 "/HorizontalShinglesRight\t\t% xs xe ys ye dy",
991
992 /* 1 */
993 "{",
994
995 /* 2 */
996 " 2 index\t\t\t\t% xs xe ys ye dy y",
997
998 /* 3 */
999 " {",
1000
1001 /* 4 */
1002 " dup 3 index gt {exit} if\t\t% xs xe ys ye dy y",
1003
1004 /* 5 */
1005 " 4 index 1 index\t\t\t% xs xe ys ye dy y xe y",
1006
1007 /* 6 */
1008 " 7 index 1 index\t\t\t% xs xe ys ye dy y xe y xs y",
1009
1010 /* 7 */
1011 " newpath moveto\t\t\t% xs xe ys ye dy y xe y",
1012
1013 /* 8 */
1014 " lineto stroke\t\t\t% xs xe ys ye dy y",
1015
1016 /* 9 */
1017 " 1 index add\t\t\t\t% xs xe ys ye dy y",
1018
1019 /* 10 */
1020 " }",
1021
1022 /* 11 */
1023 " loop\t\t\t\t\t% xs xe ys ye dy y",
1024
1025 /* 12 */
1026 " pop\t\t\t\t\t% xs xe ys ye dy",
1027
1028 /* 13 */
1029 " 2 index 0\t\t\t\t% xs xe ys ye dy y nr",
1030
1031 /* 14 */
1032 " {",
1033
1034 /* 15 */
1035 " 1 index 4 index gt {exit} if\t% xs xe ys ye dy y nr",
1036
1037 /* 16 */
1038 " 6 index\t\t\t\t% xs xe ys ye dy y nr x",
1039
1040 /* 17 */
1041 " 1 index 4 index 0.5 mul mul add\t% xs xe ys ye dy y nr x",
1042
1043 /* 18 */
1044 " {",
1045
1046 /* 19 */
1047 " dup 7 index gt {exit} if\t\t% xs xe ys ye dy y nr x",
1048
1049 /* 20 */
1050 " dup 3 index 5 index add\t\t% xs xe ys ye dy y nr x x y2",
1051
1052 /* 21 */
1053 " 1 index 6 index 0.5 mul add\t% xs xe ys ye dy y nr x x y2 x2",
1054
1055 /* 22 */
1056 " 5 index newpath moveto lineto\t% xs xe ys ye dy y nr x",
1057
1058 /* 23 */
1059 " stroke",
1060
1061 /* 24 */
1062 " 3 index 2.0 mul add\t\t% xs xe ys ye dy y nr x",
1063
1064 /* 25 */
1065 " }",
1066
1067 /* 26 */
1068 " loop pop\t\t\t\t% xs xe ys ye dy y nr",
1069
1070 /* 27 */
1071 " exch 2 index add exch\t\t% xs xe ys ye dy y nr",
1072
1073 /* 28 */
1074 " 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dy y nr",
1075
1076 /* 29 */
1077 " }",
1078
1079 /* 30 */
1080 " loop\t\t\t\t\t% xs xe ys ye dy y nr",
1081
1082 /* 31 */
1083 " pop pop pop pop pop pop pop",
1084
1085 /* 32 */
1086 "} bind def",
1087
1088 NULL
1089
1090 };
1091
1092
1093
1094 /** Pattern procedure.
1095 */
1096 static const char * const p13[] = {
1097 /* 0 */
1098 "/VerticalShinglesLeft\t\t\t% xs xe ys ye dx",
1099
1100 /* 1 */
1101 "{",
1102
1103 /* 2 */
1104 " 4 index\t\t\t\t% xs xe ys ye dx x",
1105
1106 /* 3 */
1107 " {",
1108
1109 /* 4 */
1110 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
1111
1112 /* 5 */
1113 " dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
1114
1115 /* 6 */
1116 " 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
1117
1118 /* 7 */
1119 " newpath moveto\t\t\t% xs xe ys ye dx x x ye",
1120
1121 /* 8 */
1122 " lineto stroke\t\t\t% xs xe ys ye dx x",
1123
1124 /* 9 */
1125 " 1 index add\t\t\t\t% xs xe ys ye dx x",
1126
1127 /* 10 */
1128 " }",
1129
1130 /* 11 */
1131 " loop\t\t\t\t\t% xs xe ys ye dx x",
1132
1133 /* 12 */
1134 " pop\t\t\t\t\t% xs xe ys ye dx",
1135
1136 /* 13 */
1137 " 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
1138
1139 /* 14 */
1140 " {",
1141
1142 /* 15 */
1143 " 1 index 6 index gt {exit} if\t% xs xe ys ye dx x nr",
1144
1145 /* 16 */
1146 " 4 index\t\t\t\t% xs xe ys ye dx x nr y",
1147
1148 /* 17 */
1149 " 3 index 2 index 0.5 mul mul add\t% xs xe ys ye dx x nr y",
1150
1151 /* 18 */
1152 " {",
1153
1154 /* 19 */
1155 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x nr y",
1156
1157 /* 20 */
1158 " 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
1159
1160 /* 21 */
1161 " 5 index 0.5 mul add\t\t% xs xe ys ye dx x nr y x y2",
1162
1163 /* 22 */
1164 " 1 index 6 index add 3 index\t% xs xe ys ye dx x nr y x y2 x2 y",
1165
1166 /* 23 */
1167 " newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
1168
1169 /* 24 */
1170 " 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
1171
1172 /* 25 */
1173 " }",
1174
1175 /* 26 */
1176 " loop pop\t\t\t\t% xs xe ys ye dx x nr",
1177
1178 /* 27 */
1179 " exch 2 index add exch\t\t% xs xe ys ye dx x nr",
1180
1181 /* 28 */
1182 " 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dx x nr",
1183
1184 /* 29 */
1185 " }",
1186
1187 /* 30 */
1188 " loop\t\t\t\t\t% xs xe ys ye dx x nr",
1189
1190 /* 31 */
1191 " pop pop pop pop pop pop pop\t\t% --",
1192
1193 /* 32 */
1194 "} bind def",
1195
1196 NULL
1197
1198 };
1199
1200
1201
1202 /** Pattern procedure.
1203 */
1204 static const char * const p14[] = {
1205 /* 0 */
1206 "/VerticalShinglesRight\t\t\t% xs xe ys ye dx",
1207
1208 /* 1 */
1209 "{",
1210
1211 /* 2 */
1212 " 4 index\t\t\t\t% xs xe ys ye dx x",
1213
1214 /* 3 */
1215 " {",
1216
1217 /* 4 */
1218 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x",
1219
1220 /* 5 */
1221 " dup 3 index\t\t\t\t% xs xe ys ye dx x x ye",
1222
1223 /* 6 */
1224 " 1 index 6 index\t\t\t% xs xe ys ye dx x x ye x ys",
1225
1226 /* 7 */
1227 " newpath moveto\t\t\t% xs xe ys ye dx x x ye",
1228
1229 /* 8 */
1230 " lineto stroke\t\t\t% xs xe ys ye dx x",
1231
1232 /* 9 */
1233 " 1 index add\t\t\t\t% xs xe ys ye dx x",
1234
1235 /* 10 */
1236 " }",
1237
1238 /* 11 */
1239 " loop\t\t\t\t\t% xs xe ys ye dx x",
1240
1241 /* 12 */
1242 " pop\t\t\t\t\t% xs xe ys ye dx",
1243
1244 /* 13 */
1245 " 4 index 0\t\t\t\t% xs xe ys ye dx x nr",
1246
1247 /* 14 */
1248 " {",
1249
1250 /* 15 */
1251 " 1 index 6 index gt {exit} if\t% xs xe ys ye dx x nr",
1252
1253 /* 16 */
1254 " 4 index\t\t\t\t% xs xe ys ye dx x nr y",
1255
1256 /* 17 */
1257 " 1 index 2 gt",
1258
1259 /* 18 */
1260 " { 3 index 0.5 mul add }",
1261
1262 /* 19 */
1263 " {",
1264
1265 /* 20 */
1266 " 1 index 1 gt",
1267
1268 /* 21 */
1269 " { 3 index add }",
1270
1271 /* 22 */
1272 " {",
1273
1274 /* 23 */
1275 " 1 index 0 gt",
1276
1277 /* 24 */
1278 "\t{ 3 index 1.5 mul add }",
1279
1280 /* 25 */
1281 "\tif",
1282
1283 /* 26 */
1284 " }",
1285
1286 /* 27 */
1287 " ifelse",
1288
1289 /* 28 */
1290 " }",
1291
1292 /* 29 */
1293 " ifelse",
1294
1295 /* 30 */
1296 " {",
1297
1298 /* 31 */
1299 " dup 5 index gt {exit} if\t\t% xs xe ys ye dx x nr y",
1300
1301 /* 32 */
1302 " 2 index 1 index\t\t\t% xs xe ys ye dx x nr y x y",
1303
1304 /* 33 */
1305 " 1 index 6 index add\t\t% xs xe ys ye dx x nr y x y x2",
1306
1307 /* 34 */
1308 " 1 index 7 index 0.5 mul add\t% xs xe ys ye dx x nr y x y x2 y2",
1309
1310 /* 35 */
1311 " newpath moveto lineto stroke\t% xs xe ys ye dx x nr y",
1312
1313 /* 36 */
1314 " 3 index 2.0 mul add\t\t% xs xe ys ye dx x nr y",
1315
1316 /* 37 */
1317 " }",
1318
1319 /* 38 */
1320 " loop pop\t\t\t\t% xs xe ys ye dx x nr",
1321
1322 /* 39 */
1323 " exch 2 index add exch\t\t% xs xe ys ye dx x nr",
1324
1325 /* 40 */
1326 " 1 add dup 3 gt {pop 0} if\t\t% xs xe ys ye dx x nr",
1327
1328 /* 41 */
1329 " }",
1330
1331 /* 42 */
1332 " loop\t\t\t\t\t% xs xe ys ye dx x nr",
1333
1334 /* 43 */
1335 " pop pop pop pop pop pop pop\t\t% --",
1336
1337 /* 44 */
1338 "} bind def",
1339
1340 NULL
1341
1342 };
1343
1344
1345
1346 /** Pattern procedure.
1347 */
1348 static const char * const p15[] = {
1349 /* 0 */
1350 "/FishScales\t\t\t\t% xs xe ys ye dx dy r a1 a2",
1351
1352 /* 1 */
1353 "{",
1354
1355 /* 2 */
1356 " 6 index 0\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1357
1358 /* 3 */
1359 " {",
1360
1361 /* 4 */
1362 " 1 index 8 index gt {exit} if\t% xs xe ys ye dx dy r a1 a2 y nr",
1363
1364 /* 5 */
1365 " 10 index\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1366
1367 /* 6 */
1368 " 1 index 0 gt",
1369
1370 /* 7 */
1371 " { 7 index 0.5 mul add }",
1372
1373 /* 8 */
1374 " if",
1375
1376 /* 9 */
1377 " {",
1378
1379 /* 10 */
1380 " dup 11 index gt {exit} if\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1381
1382 /* 11 */
1383 " dup 3 index 8 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x x y+dy",
1384
1385 /* 12 */
1386 " newpath moveto\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1387
1388 /* 13 */
1389 " dup 8 index 0.5 mul add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm",
1390
1391 /* 14 */
1392 " 3 index 7 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym",
1393
1394 /* 15 */
1395 " 7 index 7 index 7 index\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2",
1396
1397 /* 16 */
1398 " arc stroke\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1399
1400 /* 17 */
1401 " 7 index add\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1402
1403 /* 18 */
1404 " }",
1405
1406 /* 19 */
1407 " loop pop\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1408
1409 /* 20 */
1410 " exch 5 index add exch\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1411
1412 /* 21 */
1413 " 1 add dup 1 gt {pop 0} if\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1414
1415 /* 22 */
1416 " }",
1417
1418 /* 23 */
1419 " loop\t\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1420
1421 /* 24 */
1422 " pop pop pop pop pop pop pop pop pop pop pop",
1423
1424 /* 25 */
1425 "} bind def",
1426
1427 NULL
1428
1429 };
1430
1431
1432
1433 /** Pattern procedure.
1434 */
1435 static const char * const p16[] = {
1436 /* 0 */
1437 "/SmallFishScales\t\t\t% xs xe ys ye dx dy r a1 a2",
1438
1439 /* 1 */
1440 "{",
1441
1442 /* 2 */
1443 " 6 index 0\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1444
1445 /* 3 */
1446 " {",
1447
1448 /* 4 */
1449 " 1 index 8 index gt {exit} if\t% xs xe ys ye dx dy r a1 a2 y nr",
1450
1451 /* 5 */
1452 " 10 index\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1453
1454 /* 6 */
1455 " 1 index 0 gt",
1456
1457 /* 7 */
1458 " { 7 index 0.5 mul add }",
1459
1460 /* 8 */
1461 " if",
1462
1463 /* 9 */
1464 " {",
1465
1466 /* 10 */
1467 " dup 11 index gt {exit} if\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1468
1469 /* 11 */
1470 " dup 3 index 8 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x x y+dy",
1471
1472 /* 12 */
1473 " newpath moveto\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1474
1475 /* 13 */
1476 " dup 8 index 0.5 mul add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm",
1477
1478 /* 14 */
1479 " 3 index 7 index add\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym",
1480
1481 /* 15 */
1482 " 7 index 7 index 7 index\t\t% xs xe ys ye dx dy r a1 a2 y nr x xm ym r a1 a2",
1483
1484 /* 16 */
1485 " arc stroke\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1486
1487 /* 17 */
1488 " 7 index add\t\t\t% xs xe ys ye dx dy r a1 a2 y nr x",
1489
1490 /* 18 */
1491 " }",
1492
1493 /* 19 */
1494 " loop pop\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1495
1496 /* 20 */
1497 " exch 5 index add exch\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1498
1499 /* 21 */
1500 " 1 add dup 1 gt {pop 0} if\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1501
1502 /* 22 */
1503 " }",
1504
1505 /* 23 */
1506 " loop\t\t\t\t\t% xs xe ys ye dx dy r a1 a2 y nr",
1507
1508 /* 24 */
1509 " pop pop pop pop pop pop pop pop pop pop pop",
1510
1511 /* 25 */
1512 "} bind def",
1513
1514 NULL
1515
1516 };
1517
1518
1519
1520 /** Pattern procedure.
1521 */
1522 static const char * const p17[] = {
1523 /* 0 */
1524 "/Circles\t\t\t% xs xe ys ye r",
1525
1526 /* 1 */
1527 "{",
1528
1529 /* 2 */
1530 " 2 index\t\t\t% xs xe ys ye r y",
1531
1532 /* 3 */
1533 " {",
1534
1535 /* 4 */
1536 " dup 3 index gt {exit} if",
1537
1538 /* 5 */
1539 " 5 index\t\t\t% xs xe ys ye r y x",
1540
1541 /* 6 */
1542 " {",
1543
1544 /* 7 */
1545 " dup 6 index gt {exit} if",
1546
1547 /* 8 */
1548 " dup 3 index add\t\t% xs xe ys ye r y x xm",
1549
1550 /* 9 */
1551 " 2 index 4 index add\t% xs xe ys ye r y x xm ym",
1552
1553 /* 10 */
1554 " 4 index 0 360\t\t% xs xe ys ye r y x xm ym r a1 a2",
1555
1556 /* 11 */
1557 " 4 index 3 index add\t% xs xe ys ye r y x xm ym r a1 a2 xr",
1558
1559 /* 12 */
1560 " 4 index\t\t\t% xs xe ys ye r y x xm ym r a1 a2 xr yr",
1561
1562 /* 13 */
1563 " newpath moveto arc",
1564
1565 /* 14 */
1566 " closepath stroke\t\t% xs xe ys ye r y x",
1567
1568 /* 15 */
1569 " 2 index dup add add",
1570
1571 /* 16 */
1572 " }",
1573
1574 /* 17 */
1575 " loop pop",
1576
1577 /* 18 */
1578 " 1 index dup add add\t\t% xs xe ys ye r y",
1579
1580 /* 19 */
1581 " }",
1582
1583 /* 20 */
1584 " loop\t\t\t\t% xs xe ys ye r y",
1585
1586 /* 21 */
1587 " pop pop pop pop pop pop\t% --",
1588
1589 /* 22 */
1590 "} bind def",
1591
1592 NULL
1593
1594 };
1595
1596
1597
1598 /** Pattern procedure.
1599 */
1600 static const char * const p18[] = {
1601 /* 0 */
1602 "/Hexagons\t\t\t\t% xs xe ys ye dx dy",
1603
1604 /* 1 */
1605 "{",
1606
1607 /* 2 */
1608 " 1 index 3.0 div\t\t\t% xs xe ys ye dx dy r",
1609
1610 /* 3 */
1611 " 4 index\t\t\t\t% xs xe ys ye dx dy r y",
1612
1613 /* 4 */
1614 " {",
1615
1616 /* 5 */
1617 " dup 5 index gt {exit} if",
1618
1619 /* 6 */
1620 " 7 index\t\t\t\t% xs xe ys ye dx dy r y x",
1621
1622 /* 7 */
1623 " {",
1624
1625 /* 8 */
1626 " dup 8 index gt {exit} if",
1627
1628 /* 9 */
1629 " newpath",
1630
1631 /* 10 */
1632 " dup 3 index 3.0 mul add\t\t% xs xe ys ye dx dy r y x x0",
1633
1634 /* 11 */
1635 " 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x0 y0",
1636
1637 /* 12 */
1638 " moveto\t\t\t\t% xs xe ys ye dx dy r y x",
1639
1640 /* 13 */
1641 " dup 3 index 2.0 mul add\t\t% xs xe ys ye dx dy r y x x1",
1642
1643 /* 14 */
1644 " 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x1 y1",
1645
1646 /* 15 */
1647 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1648
1649 /* 16 */
1650 " dup 3 index 1.5 mul add\t\t% xs xe ys ye dx dy r y x x2",
1651
1652 /* 17 */
1653 " 2 index 5 index add\t\t% xs xe ys ye dx dy r y x x2 y2",
1654
1655 /* 18 */
1656 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1657
1658 /* 19 */
1659 " dup 3 index 0.5 mul add\t\t% xs xe ys ye dx dy r y x x3",
1660
1661 /* 20 */
1662 " 2 index 5 index add\t\t% xs xe ys ye dx dy r y x x3 y3",
1663
1664 /* 21 */
1665 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1666
1667 /* 22 */
1668 " dup 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x4 y4",
1669
1670 /* 23 */
1671 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1672
1673 /* 24 */
1674 " dup 3 index 0.5 mul add 2 index\t% xs xe ys ye dx dy r y x x5 y5",
1675
1676 /* 25 */
1677 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1678
1679 /* 26 */
1680 " dup 3 index 1.5 mul add 2 index\t% xs xe ys ye dx dy r y x x6 y6",
1681
1682 /* 27 */
1683 " lineto\t\t\t\t% xs xe ys ye dx dy r y x",
1684
1685 /* 28 */
1686 " dup 3 index 2.0 mul add\t\t% xs xe ys ye dx dy r y x x7",
1687
1688 /* 29 */
1689 " 2 index 5 index 0.5 mul add\t% xs xe ys ye dx dy r y x x7 y7",
1690
1691 /* 30 */
1692 " lineto stroke\t\t\t% xs xe ys ye dx dy r y x",
1693
1694 /* 31 */
1695 " 4 index add",
1696
1697 /* 32 */
1698 " }",
1699
1700 /* 33 */
1701 " loop pop",
1702
1703 /* 34 */
1704 " 2 index add",
1705
1706 /* 35 */
1707 " }",
1708
1709 /* 36 */
1710 " loop pop pop pop pop pop pop pop pop",
1711
1712 /* 37 */
1713 "} bind def",
1714
1715 NULL
1716
1717 };
1718
1719
1720
1721 /** Pattern procedure.
1722 */
1723 static const char * const p19[] = {
1724 /* 0 */
1725 "/Octagons\t\t\t\t% xs xe ys ye dx co",
1726
1727 /* 1 */
1728 "{",
1729
1730 /* 2 */
1731 " 3 index\t\t\t\t% xs xe ys ye dx co y",
1732
1733 /* 3 */
1734 " {",
1735
1736 /* 4 */
1737 " dup 4 index gt {exit} if",
1738
1739 /* 5 */
1740 " 6 index\t\t\t\t% xs xe ys ye dx co y x",
1741
1742 /* 6 */
1743 " {",
1744
1745 /* 7 */
1746 " dup 7 index gt {exit} if\t\t% xs xe ys ye dx co y x",
1747
1748 /* 8 */
1749 " newpath",
1750
1751 /* 9 */
1752 " dup 3 index add\t\t\t% xs xe ys ye dx co y x x0",
1753
1754 /* 10 */
1755 " 2 index\t\t\t\t% xs xe ys ye dx co y x x0 y0",
1756
1757 /* 11 */
1758 " moveto\t\t\t\t% xs xe ys ye dx co y x",
1759
1760 /* 12 */
1761 " dup 4 index add 3 index sub\t% xs xe ys ye dx co y x x1",
1762
1763 /* 13 */
1764 " 2 index\t\t\t\t% xs xe ys ye dx co y x x1 y1",
1765
1766 /* 14 */
1767 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1768
1769 /* 15 */
1770 " dup 4 index add\t\t\t% xs xe ys ye dx co y x x2",
1771
1772 /* 16 */
1773 " 2 index 4 index add\t\t% xs xe ys ye dx co y x x2 y2",
1774
1775 /* 17 */
1776 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1777
1778 /* 18 */
1779 " dup 4 index add\t\t\t% xs xe ys ye dx co y x x3",
1780
1781 /* 19 */
1782 " 2 index 5 index add 4 index sub\t% xs xe ys ye dx co y x x3 y3",
1783
1784 /* 20 */
1785 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1786
1787 /* 21 */
1788 " dup 4 index add 3 index sub\t% xs xe ys ye dx co y x x4",
1789
1790 /* 22 */
1791 " 2 index 5 index add\t\t% xs xe ys ye dx co y x x4 y4",
1792
1793 /* 23 */
1794 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1795
1796 /* 24 */
1797 " dup 3 index add\t\t\t% xs xe ys ye dx co y x x5",
1798
1799 /* 25 */
1800 " 2 index 5 index add\t\t% xs xe ys ye dx co y x x5 y5",
1801
1802 /* 26 */
1803 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1804
1805 /* 27 */
1806 " dup\t\t\t\t% xs xe ys ye dx co y x x6",
1807
1808 /* 28 */
1809 " 2 index 5 index add 4 index sub\t% xs xe ys ye dx co y x x6 y6",
1810
1811 /* 29 */
1812 " lineto\t\t\t\t% xs xe ys ye dx co y x",
1813
1814 /* 30 */
1815 " dup\t\t\t\t% xs xe ys ye dx co y x x7",
1816
1817 /* 31 */
1818 " 2 index 4 index add\t\t% xs xe ys ye dx co y x x7 y7",
1819
1820 /* 32 */
1821 " lineto closepath stroke\t\t% xs xe ys ye dx co y x",
1822
1823 /* 33 */
1824 " 3 index add",
1825
1826 /* 34 */
1827 " }",
1828
1829 /* 35 */
1830 " loop pop",
1831
1832 /* 36 */
1833 " 2 index add",
1834
1835 /* 37 */
1836 " }",
1837
1838 /* 38 */
1839 " loop pop pop pop pop pop pop pop",
1840
1841 /* 39 */
1842 "} bind def",
1843
1844 NULL
1845
1846 };
1847
1848
1849
1850 /** Pattern procedure.
1851 */
1852 static const char * const p20[] = {
1853 /* 0 */
1854 "/HorizontalTireTreads\t\t% xs xe ys ye dx",
1855
1856 /* 1 */
1857 "{",
1858
1859 /* 2 */
1860 " dup 0.5 mul\t\t\t% xs xe ys ye dx r",
1861
1862 /* 3 */
1863 " 3 index\t\t\t% xs xe ys ye dx r y",
1864
1865 /* 4 */
1866 " {",
1867
1868 /* 5 */
1869 " dup 4 index gt {exit} if",
1870
1871 /* 6 */
1872 " 6 index\t\t\t% xs xe ys ye dx r y x",
1873
1874 /* 7 */
1875 " {",
1876
1877 /* 8 */
1878 " dup 7 index gt {exit} if\t\t% xs xe ys ye dx r y x",
1879
1880 /* 9 */
1881 " dup 4 index add 2 index\t\t% xs xe ys ye dx r y x x2 y2",
1882
1883 /* 10 */
1884 " 2 index 5 index add\t\t% xs xe ys ye dx r y x x2 y2 x1",
1885
1886 /* 11 */
1887 " 4 index 6 index add\t\t% xs xe ys ye dx r y x x2 y2 x1 y1",
1888
1889 /* 12 */
1890 " 4 index 6 index\t\t\t% xs xe ys ye dx r y x x2 y2 x1 y1 x0 y0",
1891
1892 /* 13 */
1893 " newpath moveto lineto lineto\t% xs xe ys ye dx r y x",
1894
1895 /* 14 */
1896 " stroke",
1897
1898 /* 15 */
1899 " 3 index add",
1900
1901 /* 16 */
1902 " }",
1903
1904 /* 17 */
1905 " loop pop\t\t\t% xs xe ys ye dx r y",
1906
1907 /* 18 */
1908 " 2 index add",
1909
1910 /* 19 */
1911 " }",
1912
1913 /* 20 */
1914 " loop\t\t\t\t\t% xs xe ys ye dx r y",
1915
1916 /* 21 */
1917 " pop pop pop pop pop pop pop",
1918
1919 /* 22 */
1920 "} bind def",
1921
1922 NULL
1923
1924 };
1925
1926
1927
1928 /** Pattern procedure.
1929 */
1930 static const char * const p21[] = {
1931 /* 0 */
1932 "/VerticalTireTreads\t\t% xs xe ys ye dx",
1933
1934 /* 1 */
1935 "{",
1936
1937 /* 2 */
1938 " dup 0.5 mul\t\t\t% xs xe ys ye dx r",
1939
1940 /* 3 */
1941 " 5 index\t\t\t% xs xe ys ye dx r x",
1942
1943 /* 4 */
1944 " {",
1945
1946 /* 5 */
1947 " dup 6 index gt {exit} if",
1948
1949 /* 6 */
1950 " 4 index\t\t\t% xs xe ys ye dx r x y",
1951
1952 /* 7 */
1953 " {",
1954
1955 /* 8 */
1956 " dup 5 index gt {exit} if",
1957
1958 /* 9 */
1959 " 1 index 1 index 5 index add\t% xs xe ys ye dx r x y x2 y2",
1960
1961 /* 10 */
1962 " 3 index 5 index add\t\t% xs xe ys ye dx r x y x2 y2 x1",
1963
1964 /* 11 */
1965 " 3 index 6 index add\t\t% xs xe ys ye dx r x y x2 y2 x1 y1",
1966
1967 /* 12 */
1968 " 5 index 5 index\t\t\t% xs xe ys ye dx r x y x2 y2 x1 y1 x0 y0",
1969
1970 /* 13 */
1971 " newpath moveto lineto lineto\t% xs xe ys ye dx r x y",
1972
1973 /* 14 */
1974 " stroke",
1975
1976 /* 15 */
1977 " 3 index add",
1978
1979 /* 16 */
1980 " }",
1981
1982 /* 17 */
1983 " loop pop",
1984
1985 /* 18 */
1986 " 2 index add",
1987
1988 /* 19 */
1989 " }",
1990
1991 /* 20 */
1992 " loop\t\t\t\t% xs xe ys ye dx r x",
1993
1994 /* 21 */
1995 " pop pop pop pop pop pop pop",
1996
1997 /* 22 */
1998 "} bind def",
1999
2000 NULL
2001
2002 };
2003
2004
2005
2006 /** Pattern names.
2007 */
2008 static const char * const pnames[] = {
2009 /* 0 */
2010 "ThirtyLeft",
2011
2012 /* 1 */
2013 "ThirtyRight",
2014
2015 /* 2 */
2016 "ThirtyHatch",
2017
2018 /* 3 */
2019 "FourtyFiveLeft",
2020
2021 /* 4 */
2022 "FourtyFiveRight",
2023
2024 /* 5 */
2025 "FourtyFiveHatch",
2026
2027 /* 6 */
2028 "HorizontalBricks",
2029
2030 /* 7 */
2031 "VerticalBricks",
2032
2033 /* 8 */
2034 "HorizontalLines",
2035
2036 /* 9 */
2037 "VerticalLines",
2038
2039 /* 10 */
2040 "CrossHatch",
2041
2042 /* 11 */
2043 "HorizontalShinglesLeft",
2044
2045 /* 12 */
2046 "HorizontalShinglesRight",
2047
2048 /* 13 */
2049 "VerticalShinglesLeft",
2050
2051 /* 14 */
2052 "VerticalShinglesRight",
2053
2054 /* 15 */
2055 "FishScales",
2056
2057 /* 16 */
2058 "SmallFishScales",
2059
2060 /* 17 */
2061 "Circles",
2062
2063 /* 18 */
2064 "Hexagons",
2065
2066 /* 19 */
2067 "Octagons",
2068
2069 /* 20 */
2070 "HorizontalTireTreads",
2071
2072 /* 21 */
2073 "VerticalTireTreads",
2074
2075 NULL
2076
2077 };
2078
2079
2080
2081 /** Pattern procedures.
2082 */
2083 static const char * const * pproc[] = {
2084 p00, p01, p02, p03, p04, p05, p06, p07, p08, p09,
2085 p10, p11, p12, p13, p14, p15, p16, p17, p18, p19,
2086 p20, p21
2087 };
2088
2089
2090
2091 const char * const *
dk4gra_eps_pattern_procedure(size_t i)2092 dk4gra_eps_pattern_procedure(size_t i)
2093 {
2094 const char * const *back = NULL;
2095 #if DK4_USE_ASSERT
2096 assert(DK4_GRA_PATTERN_MAX >= i);
2097 #endif
2098 if (DK4_GRA_PATTERN_MAX >= i) {
2099 back = pproc[i];
2100 }
2101 return back;
2102 }
2103
2104
2105
2106 const char *
dk4gra_eps_pattern_name(size_t i)2107 dk4gra_eps_pattern_name(size_t i)
2108 {
2109 const char *back = NULL;
2110 #if DK4_USE_ASSERT
2111 assert(DK4_GRA_PATTERN_MAX >= i);
2112 #endif
2113 if (DK4_GRA_PATTERN_MAX >= i) {
2114 back = pnames[i];
2115 }
2116 return back;
2117 }
2118
2119
2120 /* vim: set ai sw=4 ts=4 : */
2121