Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

quotedstraight.ps 40 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
  1. %!PS-Adobe-3.0
  2. %%BoundingBox: 0 0 612 792
  3. %%HiResBoundingBox: 0 0 612 792
  4. %%Title: GMT v5.1.2_r13297 [64-bit] Document from psxy
  5. %%Creator: GMT5
  6. %%For: pwessel
  7. %%DocumentNeededResources: font Helvetica
  8. %%CreationDate: Wed Jul 2 16:52:53 2014
  9. %%LanguageLevel: 2
  10. %%DocumentData: Clean7Bit
  11. %%Orientation: Portrait
  12. %%Pages: 1
  13. %%EndComments
  14. %%BeginProlog
  15. % Begin pslib header
  16. 250 dict begin
  17. /! {bind def} bind def
  18. /# {load def}!
  19. /A /setgray #
  20. /B /setdash #
  21. /C /setrgbcolor #
  22. /D /rlineto #
  23. /E {dup stringwidth pop}!
  24. /F /fill #
  25. /G /rmoveto #
  26. /H /sethsbcolor #
  27. /I /setpattern #
  28. /K /setcmykcolor #
  29. /L /lineto #
  30. /M /moveto #
  31. /N /newpath #
  32. /P /closepath #
  33. /R /rotate #
  34. /S /stroke #
  35. /T /translate #
  36. /U /grestore #
  37. /V /gsave #
  38. /W /setlinewidth #
  39. /Y {findfont exch scalefont setfont}!
  40. /Z /show #
  41. /FP {true charpath flattenpath}!
  42. /MU {matrix setmatrix}!
  43. /MS {/SMat matrix currentmatrix def}!
  44. /MR {SMat setmatrix}!
  45. /edef {exch def}!
  46. % Path fill
  47. /FS {/fc edef /fs {V fc F U} def}!
  48. /FQ {/fs {} def}!
  49. % Outline off or on
  50. /O0 {/os {N} def}!
  51. /O1 {/os {P S} def}!
  52. % Set both fill and outline
  53. /FO {fs os}!
  54. % Star: radius xc yc
  55. /Sa {M MS dup 0 exch G 0.726542528 mul -72 R dup 0 D 4 {72 R dup 0 D -144 R dup 0 D} repeat pop MR FO}!
  56. % Box: height width xll yll
  57. /Sb {M dup 0 D exch 0 exch D neg 0 D FO}!
  58. % Rounded box: height width radius xll yll
  59. /SB {MS T /BoxR edef /BoxW edef /BoxH edef BoxR 0 M
  60. BoxW 0 BoxW BoxH BoxR arct BoxW BoxH 0 BoxH BoxR arct 0 BoxH 0 0 BoxR arct 0 0 BoxW 0 BoxR arct MR FO}!
  61. % Circle: radius xc yc
  62. /Sc {N 3 -1 roll 0 360 arc FO}!
  63. % Diamond: radius xc yc
  64. /Sd {M 4 {dup} repeat 0 G neg dup dup D exch D D FO}!
  65. % Ellipse: major minor angle xc yc
  66. /Se {N MS T R scale 0 0 1 0 360 arc MR FO}!
  67. % Octagon: radius xc yc
  68. /Sg {M MS 22.5 R dup 0 exch G -22.5 R 0.765366865 mul dup 0 D 6 {-45 R dup 0 D} repeat pop MR FO}!
  69. % Hexagon: radius xc yc
  70. /Sh {M MS dup 0 G -120 R dup 0 D 4 {-60 R dup 0 D} repeat pop MR FO}!
  71. % Inverted triangle: radius xc yc
  72. /Si {M MS dup neg 0 exch G 60 R 1.732050808 mul dup 0 D 120 R 0 D MR FO}!
  73. % Rotated rectangle: height width angle xc yc
  74. /Sj {M MS R dup -2 div 2 index -2 div G dup 0 D exch 0 exch D neg 0 D MR FO}!
  75. % Pentagon: radius xc yc
  76. /Sn {M MS dup 0 exch G -36 R 1.175570505 mul dup 0 D 3 {-72 R dup 0 D} repeat pop MR FO}!
  77. % Dot: radius xc yc [hardwired as circle with no outline]
  78. /Sp {N 3 -1 roll 0 360 arc fs N}!
  79. % Patch fill: x1 y1 ... xn yn n
  80. /SP {M {D} repeat FO}!
  81. % Rectangle: height width xc yc
  82. /Sr {M dup -2 div 2 index -2 div G dup 0 D exch 0 exch D neg 0 D FO}!
  83. % Rounded rectangle: height width radius xc yc
  84. /SR {MS T /BoxR edef /BoxW edef /BoxH edef BoxR BoxW -2 div BoxH -2 div T BoxR 0 M
  85. BoxW 0 BoxW BoxH BoxR arct BoxW BoxH 0 BoxH BoxR arct 0 BoxH 0 0 BoxR arct 0 0 BoxW 0 BoxR arct MR FO}!
  86. % Square: radius xc yc
  87. /Ss {M 1.414213562 mul dup dup dup -2 div dup G 0 D 0 exch D neg 0 D FO}!
  88. % Triangle: radius xc yc
  89. /St {M MS dup 0 exch G -60 R 1.732050808 mul dup 0 D -120 R 0 D MR FO}!
  90. % Single-headed vector
  91. /SV {0 exch M 0 D D D D D 0 D FO}!
  92. % Double-headed vector
  93. /Sv {0 0 M D D 0 D D D D D 0 D D FO}!
  94. % Pie Wedge: radius angle1 angle2 xc yc
  95. /Sw {2 copy M 5 2 roll arc FO}!
  96. % Cross: radius xc yc
  97. /Sx {M 1.414213562 mul 5 {dup} repeat -2 div dup G D neg 0 G neg D S}!
  98. % Y-dash: radius xc yc
  99. /Sy {M dup 0 exch G dup -2 mul dup 0 exch D S}!
  100. % Plus: radius xc yc
  101. /S+ {M dup 0 G dup -2 mul dup 0 D exch dup G 0 exch D S}!
  102. % X-dash: radius xc yc
  103. /S- {M dup 0 G dup -2 mul dup 0 D S}!
  104. % String width, height, depth and total height (height-depth)
  105. /sw {stringwidth pop}!
  106. /sh {V MU 0 0 M FP pathbbox N 4 1 roll pop pop pop U}!
  107. /sd {V MU 0 0 M FP pathbbox N pop pop exch pop U}!
  108. /sH {V MU 0 0 M FP pathbbox N exch pop exch sub exch pop U}!
  109. /sb {E exch sh}!
  110. % To align text {bottom,middle,top}{left,center,right}
  111. /bl {}!
  112. /bc {E -2 div 0 G}!
  113. /br {E neg 0 G}!
  114. /ml {dup 0 exch sh -2 div G}!
  115. /mc {dup E -2 div exch sh -2 div G}!
  116. /mr {dup E neg exch sh -2 div G}!
  117. /tl {dup 0 exch sh neg G}!
  118. /tc {dup E -2 div exch sh neg G}!
  119. /tr {dup E neg exch sh neg G}!
  120. % Maximum of two numbers
  121. /mx {2 copy lt {exch} if pop}!
  122. % Translate and memorize advance
  123. /PSL_xorig 0 def /PSL_yorig 0 def
  124. /TM {2 copy T PSL_yorig add /PSL_yorig edef PSL_xorig add /PSL_xorig edef}!
  125. % To reencode one font with the provided encoding vector
  126. /PSL_reencode {findfont dup length dict begin
  127. {1 index /FID ne {def}{pop pop} ifelse} forall
  128. exch /Encoding edef currentdict end definefont pop
  129. }!
  130. /PSL_eps_begin { % Marks begin of EPSF inclusion
  131. /PSL_eps_state save def % Save state for cleanup
  132. /PSL_dict_count countdictstack def % Count objects on dict stack
  133. /PSL_op_count count 1 sub def % Count objects on operand stack
  134. userdict begin % Push userdict stack
  135. /showpage {} def % Deactivate showpage command
  136. 0 setgray 0 setlinecap 1 setlinewidth % Prepare clean graphics state
  137. 0 setlinejoin 10 setmiterlimit [] 0 setdash newpath
  138. /languagelevel where % If level != 1, set strokeadjust and overprint to their defaults
  139. {pop languagelevel 1 ne {false setstrokeadjust false setoverprint} if} if
  140. }!
  141. /PSL_eps_end { % Marks end of EPSF inclusion
  142. count PSL_op_count sub {pop} repeat % Clean up operand stack
  143. countdictstack PSL_dict_count sub {end} repeat % Clean up dict stack
  144. PSL_eps_state restore % Restore saved state
  145. }!
  146. /PSL_transp { % Set transparency
  147. /.setopacityalpha where {pop .setblendmode .setopacityalpha}{ % Using ghostscript
  148. /pdfmark where {pop [ /BM exch /CA exch dup /ca exch /SetTransparency pdfmark} % Or Adobe
  149. {pop pop} ifelse} ifelse % Or skip if neither are supported
  150. }!
  151. /Standard+_Encoding [
  152. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
  153. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
  154. /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
  155. /.notdef /threequarters /threesuperior /trademark /twosuperior /yacute /ydieresis /zcaron
  156. /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright
  157. /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
  158. /zero /one /two /three /four /five /six /seven
  159. /eight /nine /colon /semicolon /less /equal /greater /question
  160. /at /A /B /C /D /E /F /G
  161. /H /I /J /K /L /M /N /O
  162. /P /Q /R /S /T /U /V /W
  163. /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore
  164. /quoteleft /a /b /c /d /e /f /g
  165. /h /i /j /k /l /m /n /o
  166. /p /q /r /s /t /u /v /w
  167. /x /y /z /braceleft /bar /braceright /asciitilde /florin
  168. /Atilde /Ccedilla /Eth /Lslash /Ntilde /Otilde /Scaron /Thorn
  169. /Yacute /Ydieresis /Zcaron /atilde /brokenbar /ccedilla /copyright /degree
  170. /divide /eth /logicalnot /lslash /minus /mu /multiply /ntilde
  171. /onehalf /onequarter /onesuperior /otilde /plusminus /registered /scaron /thorn
  172. /.notdef /exclamdown /cent /sterling /fraction /yen /florin /section
  173. /currency /quotesingle /quotedblleft /guillemotleft /guilsinglleft /guilsinglright /fi /fl
  174. /Aacute /endash /dagger /daggerdbl /periodcentered /Acircumflex /paragraph /bullet
  175. /quotesinglbase /quotedblbase /quotedblright /guillemotright /ellipsis /perthousand /Adieresis /questiondown
  176. /Agrave /grave /acute /circumflex /tilde /macron /breve /dotaccent
  177. /dieresis /Eacute /ring /cedilla /Ecircumflex /hungarumlaut /ogonek /caron
  178. /emdash /Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute
  179. /Ocircumflex /Odieresis /Ograve /Uacute /Ucircumflex /Udieresis /Ugrave /aacute
  180. /acircumflex /AE /adieresis /ordfeminine /agrave /eacute /ecircumflex /edieresis
  181. /egrave /Oslash /OE /ordmasculine /iacute /icircumflex /idieresis /igrave
  182. /oacute /ae /ocircumflex /odieresis /ograve /dotlessi /uacute /ucircumflex
  183. /udieresis /oslash /oe /germandbls /ugrave /Aring /aring /ydieresis
  184. ] def
  185. /PSL_font_encode 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 39 array astore def % Initially zero
  186. /F0 {/Helvetica Y}!
  187. /F1 {/Helvetica-Bold Y}!
  188. /F2 {/Helvetica-Oblique Y}!
  189. /F3 {/Helvetica-BoldOblique Y}!
  190. /F4 {/Times-Roman Y}!
  191. /F5 {/Times-Bold Y}!
  192. /F6 {/Times-Italic Y}!
  193. /F7 {/Times-BoldItalic Y}!
  194. /F8 {/Courier Y}!
  195. /F9 {/Courier-Bold Y}!
  196. /F10 {/Courier-Oblique Y}!
  197. /F11 {/Courier-BoldOblique Y}!
  198. /F12 {/Symbol Y}!
  199. /F13 {/AvantGarde-Book Y}!
  200. /F14 {/AvantGarde-BookOblique Y}!
  201. /F15 {/AvantGarde-Demi Y}!
  202. /F16 {/AvantGarde-DemiOblique Y}!
  203. /F17 {/Bookman-Demi Y}!
  204. /F18 {/Bookman-DemiItalic Y}!
  205. /F19 {/Bookman-Light Y}!
  206. /F20 {/Bookman-LightItalic Y}!
  207. /F21 {/Helvetica-Narrow Y}!
  208. /F22 {/Helvetica-Narrow-Bold Y}!
  209. /F23 {/Helvetica-Narrow-Oblique Y}!
  210. /F24 {/Helvetica-Narrow-BoldOblique Y}!
  211. /F25 {/NewCenturySchlbk-Roman Y}!
  212. /F26 {/NewCenturySchlbk-Italic Y}!
  213. /F27 {/NewCenturySchlbk-Bold Y}!
  214. /F28 {/NewCenturySchlbk-BoldItalic Y}!
  215. /F29 {/Palatino-Roman Y}!
  216. /F30 {/Palatino-Italic Y}!
  217. /F31 {/Palatino-Bold Y}!
  218. /F32 {/Palatino-BoldItalic Y}!
  219. /F33 {/ZapfChancery-MediumItalic Y}!
  220. /F34 {/ZapfDingbats Y}!
  221. /F35 {/Ryumin-Light-EUC-H Y}!
  222. /F36 {/Ryumin-Light-EUC-V Y}!
  223. /F37 {/GothicBBB-Medium-EUC-H Y}!
  224. /F38 {/GothicBBB-Medium-EUC-V Y}!
  225. /PSL_pathtextdict 26 dict def % Local storage for the procedure PSL_pathtext.
  226. /PSL_pathtext % PSL_pathtext'' will place a string
  227. {PSL_pathtextdict begin % of text along any path. It takes
  228. /ydepth exch def % a string and starting offset
  229. /textheight exch def % distance from the beginning of
  230. /just exch def % the path as its arguments. Note
  231. /offset exch def % that PSL_pathtext assumes that a
  232. /str exch def % path has already been defined
  233. % and after it places the text
  234. % along the path, it clears the
  235. % current path like the ``stroke''
  236. % and ``fill'' operators; it also
  237. % assumes that a font has been
  238. % set. ``pathtext'' begins placing
  239. % the characters along the current
  240. % path, starting at the offset
  241. % distance and continuing until
  242. % either the path length is
  243. % exhausted or the entire string
  244. % has been printed, whichever
  245. % occurs first. The results will
  246. % be more effective when a small
  247. % point size font is used with
  248. % sharp curves in the path.
  249. /pathdist 0 def % Initialize the distance we have
  250. % travelled along the path.
  251. /setdist offset def % Initialize the distance we have
  252. % covered by setting characters.
  253. /charcount 0 def % Initialize the character count.
  254. /justy just 4 idiv textheight mul 2 div neg ydepth sub def % Compute the y-shift
  255. V flattenpath % Reduce the path to a series of
  256. % straight line segments. The
  257. % characters will be placed along
  258. % the line segments in the
  259. % ``linetoproc.''
  260. {movetoproc} {linetoproc} % The basic strategy is to process
  261. {curvetoproc} {closepathproc} % the segments of the path,
  262. pathforall % keeping a running total of the
  263. % distance we have travelled so
  264. % far (pathdist). We also keep
  265. % track of the distance taken up
  266. % by the characters that have been
  267. % set so far (setdist). When the
  268. % distance we have travelled along
  269. % the path is greater than the
  270. % distance taken up by the set
  271. % characters, we are ready to set
  272. % the next character (if there are
  273. % any left to be set). This
  274. % process continues until we have
  275. % exhausted the full length of the
  276. % path.
  277. U N % Clear the current path.
  278. end
  279. } def
  280. PSL_pathtextdict begin
  281. /movetoproc % ``movetoproc'' is executed when
  282. { /newy exch def /newx exch def % a moveto component has been
  283. % encountered in the pathforall
  284. % operation.
  285. /firstx newx def /firsty newy def % Remember the ``first point'' in
  286. % the path so that when we get a
  287. % ``closepath'' component we can
  288. % properly handle the text.
  289. /ovr 0 def
  290. newx newy transform
  291. /cpy exch def /cpx exch def % Explicitly keep track of the
  292. % current position in device
  293. % space.
  294. } def
  295. /linetoproc % ``linetoproc'' is executed when
  296. % a lineto component has been
  297. % encountered in the pathforall
  298. % operation.
  299. { /oldx newx def /oldy newy def % Update the old point.
  300. /newy exch def /newx exch def % Get the new point.
  301. /dx newx oldx sub def
  302. /dy newy oldy sub def
  303. /dist dx dup mul dy dup mul add sqrt def % Calculate the distance between
  304. % the old and the new point.
  305. dist 0 ne
  306. { /dsx dx dist div ovr mul def % dsx and dsy are used to update
  307. /dsy dy dist div ovr mul def % the current position to be just
  308. % beyond the width of the previous
  309. % character.
  310. oldx dsx add oldy dsy add transform
  311. /cpy exch def /cpx exch def % Update the current position.
  312. /pathdist pathdist dist add def % Increment the distance we have
  313. % travelled along the path.
  314. {setdist pathdist le % Keep setting characters along
  315. % this path segment until we have
  316. % exhausted its length.
  317. {charcount str length lt % As long as there are still
  318. {setchar} {exit} ifelse} % characters left in the string,
  319. % set them.
  320. { /ovr setdist pathdist sub def % Keep track of how much we have
  321. exit} % overshot the path segment by
  322. ifelse % setting the previous character.
  323. % This enables us to position the
  324. % origin of the following
  325. % characters properly on the path.
  326. } loop
  327. } if
  328. } def
  329. /curvetoproc % ``curvetoproc'' is executed when
  330. { (ERROR: No curveto's after flattenpath!) % a curveto component has been
  331. print % encountered in the pathforall
  332. } def % operation. It prints an error
  333. % message since there shouldn't be
  334. % any curveto's in a path after
  335. % the flattenpath operator has
  336. % been executed.
  337. /closepathproc % ``closepathproc'' is executed
  338. {firstx firsty linetoproc % when a closepath component has
  339. firstx firsty movetoproc % been encountered in the
  340. } def % pathforall operation. It
  341. % simulates the action of the
  342. % operator ``closepath'' by
  343. % executing ``linetoproc'' with
  344. % the coordinates of the most
  345. % recent ``moveto'' and then
  346. % executing ``movetoproc'' to the
  347. % same point.
  348. /setchar % ``setchar'' sets the next
  349. { /char str charcount 1 getinterval def % character in the string along
  350. % the path and then updates the
  351. % amount of path we have
  352. % exhausted.
  353. /charcount charcount 1 add def % Increment the character count.
  354. /charwidth char stringwidth pop def % Find the width of the character.
  355. V cpx cpy itransform T % Translate to the current
  356. % position in user space.
  357. dy dx atan R % Rotate the x-axis to coincide
  358. % with the current segment.
  359. 0 justy M
  360. char show
  361. 0 justy neg G
  362. currentpoint transform
  363. /cpy exch def /cpx exch def % Update the current position
  364. % before we restore ourselves to
  365. % the untransformed state.
  366. U /setdist setdist charwidth add def % Increment the distance we have
  367. } def % covered by setting characters.
  368. end
  369. % PSL LABEL CLIP FUNCTIONS
  370. % Two main functions deals with label placement and clipping:
  371. % PSL_curved_path_labels: handles texts that must follow curved baselines
  372. % PSL_straight_path_labels: handles texts that have straight baselines
  373. %
  374. % Both functions assume that several variables have been predefined:
  375. %
  376. % First we have these two constant settings for all text boxes:
  377. %
  378. % PSL_setboxpen Function that sets the text box pen attributes (width, texture, color)
  379. % PSL_setboxrgb Function that sets the opaque text box color
  380. %
  381. % Then several arrays are placed. Since a set of several lines segments may each
  382. % have many labels along them, we end up with these variables:
  383. %
  384. % PSL_n_paths Total number of segments
  385. % PSL_path_x x coordinates of the paths (all concatenated one after another)
  386. % PSL_path_y y coordinates of the paths (all concatenated one after another)
  387. % PSL_path_n Array with number of points per segment
  388. % PSL_label_str Array with all the labels for all segments
  389. % PSL_label_n Array with number of labels per segment
  390. % PSL_angle The annotation angle for each label
  391. %
  392. % PSL_curved_path_labels expects those labels to be placed along several
  393. % lines and it needs the node numbers where to place text:
  394. %
  395. % PSL_node Array with (x,y) node number of label position
  396. %
  397. % PSL_straight_path_labels are simpler and instead expects
  398. %
  399. % PSL_txt_x (x,y) coordinates of the location of the m labels
  400. % PSL_txt_y
  401. /PSL_set_label_heights
  402. { % Create array PSL_heights with full label heights
  403. /PSL_n_labels_minus_1 PSL_n_labels 1 sub def % Upper limit in loop over labels
  404. /PSL_heights PSL_n_labels array def % Create array with text heights
  405. 0 1 PSL_n_labels_minus_1 % Loop psl_k = 0 < PSL_n_labels
  406. { /psl_k exch def % Current label index psl_k
  407. /psl_label PSL_label_str psl_k get def % Current text label
  408. PSL_label_font psl_k get cvx exec % Get and set this label's font attributes
  409. psl_label sH /PSL_height edef % Compute the height of this string
  410. PSL_heights psl_k PSL_height put % Store it in the array
  411. } for
  412. } def
  413. %%%%%%%%%%%%%%%%%%% CURVED BASELINE TEXT PLACEMENT FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  414. /PSL_curved_path_labels
  415. { /psl_bits exch def % 4 on/of bit settings as indicated below
  416. /PSL_placetext psl_bits 2 and 2 eq def % true to place text, false to just make space
  417. /PSL_clippath psl_bits 4 and 4 eq def % false inactive, true creates clippath for labels
  418. /PSL_strokeline false def % true draws line, false skips
  419. /PSL_fillbox psl_bits 128 and 128 eq def % true to paint box opaque before placing text, false gives transparent box
  420. /PSL_drawbox psl_bits 256 and 256 eq def % true to draw box outline before placing text, false gives no outline
  421. /PSL_n_paths1 PSL_n_paths 1 sub def % one less is the upper limit in for loop over the paths
  422. /PSL_usebox PSL_fillbox PSL_drawbox or def % true if we need box outline for fill or stroke or both
  423. PSL_clippath {clipsave N clippath} if % Bracket with clipsave/cliprestore and start clip path
  424. /psl_k 0 def
  425. /psl_p 0 def
  426. 0 1 PSL_n_paths1
  427. { /psl_kk exch def % Index into the PSL_n PSL_m arrays
  428. /PSL_n PSL_path_n psl_kk get def % Get the number of points in this line segment
  429. /PSL_m PSL_label_n psl_kk get def % Get the number of labels for this line segment
  430. /PSL_x PSL_path_x psl_k PSL_n getinterval def % Get the subset that is the current line segment x-coordinates
  431. /PSL_y PSL_path_y psl_k PSL_n getinterval def % Get the subset that is the current line segment y-coordinates
  432. /PSL_node PSL_label_node psl_p PSL_m getinterval def % Get the subset of note values for current line segment
  433. /PSL_angle PSL_label_angle psl_p PSL_m getinterval def % Get the subset of angle values for current line segment
  434. /PSL_str PSL_label_str psl_p PSL_m getinterval def % Get the subset of string values for current line segment
  435. /PSL_fnt PSL_label_font psl_p PSL_m getinterval def % Get the subset of font settings for current line segment
  436. PSL_curved_path_label % Operate on this segment only
  437. /psl_k psl_k PSL_n add def % Go to next segment start index for path
  438. /psl_p psl_p PSL_m add def % Go to next segment start index for nodes
  439. } for % The loop over segments
  440. PSL_clippath {PSL_clip} if N % Activate clip path and return
  441. } def
  442. /PSL_curved_path_label
  443. { % Deals with a single line segment and its labels
  444. /PSL_n1 PSL_n 1 sub def % one less is the upper limit in for loops
  445. /PSL_m1 PSL_m 1 sub def % same
  446. PSL_CT_calcstringwidth % Calculate the width of each label string
  447. PSL_CT_calclinedist % Calculate along-track distances
  448. PSL_CT_addcutpoints % Expand path to include the cut points
  449. % Now we have the final xx/yy array and we are ready to simply lay down the lines
  450. % and place the text along the line where there are labels. We will use the
  451. % new array PSL_xp/yp to store the final points prior to use
  452. /PSL_nn1 PSL_nn 1 sub def % End index in for loop
  453. /n 0 def % Toggle: 0 means line, 1 means text
  454. /k 0 def % Index of the current text string
  455. /j 0 def % Output point number counter
  456. /PSL_seg 0 def % Line segment number
  457. /PSL_xp PSL_nn array def
  458. /PSL_yp PSL_nn array def
  459. PSL_xp 0 PSL_xx 0 get put % Place first point in array
  460. PSL_yp 0 PSL_yy 0 get put
  461. 1 1 PSL_nn1 % Loop over rest of points
  462. { /i exch def % Index into PSL_xx/yy arrays
  463. /node_type PSL_kind i get def % Check what kind of point the current point is
  464. /j j 1 add def % Update point count
  465. PSL_xp j PSL_xx i get put % Add this point to the path
  466. PSL_yp j PSL_yy i get put
  467. node_type 1 eq % If this is a cut point we either stroke or place text
  468. {n 0 eq % n is 0 so this is the strokable segment
  469. {PSL_CT_drawline}
  470. { PSL_CT_reversepath % here, n = 1 so this is the segment along which text should be placed
  471. PSL_CT_textline} ifelse % Reverse path if needed to place text correctly
  472. /j 0 def
  473. PSL_xp j PSL_xx i get put % Place new first point in array
  474. PSL_yp j PSL_yy i get put
  475. } if
  476. } for
  477. n 0 eq {PSL_CT_drawline} if % Finish off the last line segment
  478. } def
  479. /PSL_CT_textline
  480. { PSL_fnt k get cvx exec % Get and set this label's font attributes
  481. /PSL_height PSL_heights k get def % Recall the height of this text
  482. PSL_placetext {PSL_CT_placelabel} if % If we want to place the text
  483. PSL_clippath {PSL_CT_clippath} if
  484. /n 0 def /k k 1 add def % Set n back to 0, goto next label
  485. } def
  486. /PSL_CT_calcstringwidth % Calculate the width of each label string
  487. { /PSL_width PSL_m array def % Assign space for distance
  488. 0 1 PSL_m1
  489. { /i exch def
  490. PSL_fnt i get cvx exec % Get and set this label's font attributes
  491. PSL_width i PSL_str i get stringwidth pop put % Compute width and store in the array
  492. } for
  493. } def
  494. /PSL_CT_calclinedist % Calculate the distance along the line
  495. { /PSL_newx PSL_x 0 get def
  496. /PSL_newy PSL_y 0 get def
  497. /dist 0.0 def % Cumulative distance at first point is 0
  498. /PSL_dist PSL_n array def % Assign array space for distance
  499. PSL_dist 0 0.0 put % Distances start at 0 and the 'th point
  500. 1 1 PSL_n1 % Loop over the remaining points
  501. { /i exch def
  502. /PSL_oldx PSL_newx def
  503. /PSL_oldy PSL_newy def
  504. /PSL_newx PSL_x i get def
  505. /PSL_newy PSL_y i get def
  506. /dx PSL_newx PSL_oldx sub def
  507. /dy PSL_newy PSL_oldy sub def
  508. /dist dist dx dx mul dy dy mul add sqrt add def
  509. PSL_dist i dist put
  510. } for
  511. } def
  512. % Initialize an array with all the original line points plus the set of 2*m
  513. % points at the transition from line to labelspace at each label
  514. % At the end of this section, the PSL_xx/yy array will be the array to use.
  515. /PSL_CT_addcutpoints
  516. { /k 0 def % Current cut point
  517. /PSL_nc PSL_m 2 mul 1 add def % 2*m points + one last acting as infinity
  518. /PSL_cuts PSL_nc array def % The array of distances to each cut
  519. /PSL_nc1 PSL_nc 1 sub def % One less to use in for loop limits
  520. 0 1 PSL_m1 % For each of the m labels
  521. { /i exch def % Index for label distance
  522. /dist PSL_dist PSL_node i get get def % Recall the distance to this label center
  523. /halfwidth PSL_width i get 2 div PSL_gap_x add def % Set the halfwidth + gap distance
  524. PSL_cuts k dist halfwidth sub put % Distance at beginning of label gap
  525. /k k 1 add def % Was at start, now go to end distance node
  526. PSL_cuts k dist halfwidth add put % Distance at the end of label gap
  527. /k k 1 add def % Was at end, move to next
  528. } for
  529. PSL_cuts k 100000.0 put % Last cut has "infinite" distance
  530. /PSL_nn PSL_n PSL_m 2 mul add def % The total path will be 2*m points longer
  531. /PSL_xx PSL_nn array def % Assign new space for x and y
  532. /PSL_yy PSL_nn array def
  533. /PSL_kind PSL_nn array def % 0 = ordinary point, 1 = added point for label gap
  534. /j 0 def % Index for new track array
  535. /k 0 def % Index for current cut distance
  536. /dist 0.0 def % Current distance along track, starting at zero
  537. 0 1 PSL_n1 % Loop over every original line point
  538. { /i exch def % Index into current point on original line xy array
  539. /last_dist dist def % Update distance to last point (initially zero)
  540. /dist PSL_dist i get def % Distance to current point
  541. k 1 PSL_nc1 % Loop over remaining cuts (starting with all)
  542. { /kk exch def % Index into current cut distance
  543. /this_cut PSL_cuts kk get def % Distance to start of this label gap
  544. dist this_cut gt % Oh, oh, we just stepped over a cut point
  545. { /ds dist last_dist sub def % Change in distance
  546. /f ds 0.0 eq {0.0} {dist this_cut sub ds div} ifelse def % Get fractional change in distance
  547. /i1 i 0 eq {0} {i 1 sub} ifelse def
  548. PSL_xx j PSL_x i get dup PSL_x i1 get sub f mul sub put % Calc (x,y) at label start (or stop) point
  549. PSL_yy j PSL_y i get dup PSL_y i1 get sub f mul sub put
  550. PSL_kind j 1 put % Set PSL_kind to 1 since it is an added cut point
  551. /j j 1 add def % Go to next output point
  552. /k k 1 add def % Done with this cut point
  553. } if
  554. } for
  555. dist PSL_cuts k get le % Having dealt with the cut, we may add the regular point
  556. {PSL_xx j PSL_x i get put PSL_yy j PSL_y i get put
  557. PSL_kind j 0 put % Ordinary (original) coordinates
  558. /j j 1 add def % Go to next output point
  559. } if
  560. } for
  561. } def
  562. /PSL_CT_reversepath
  563. {PSL_xp j get PSL_xp 0 get lt % Path must first be reversed to avoid upside-down text
  564. {0 1 j 2 idiv % Loop over half the path and swap left/right points
  565. { /left exch def % Current left point
  566. /right j left sub def % Matching right point
  567. /tmp PSL_xp left get def % Swap left and right values for x then y
  568. PSL_xp left PSL_xp right get put
  569. PSL_xp right tmp put
  570. /tmp PSL_yp left get def
  571. PSL_yp left PSL_yp right get put
  572. PSL_yp right tmp put
  573. } for
  574. } if
  575. % Now PSL_xp/yp has the correct order to give proper text angles
  576. } def
  577. /PSL_CT_placelabel
  578. { % Places the curved text label on current segment
  579. /PSL_just PSL_label_justify k get def % Get this labels justification
  580. /PSL_height PSL_heights k get def % Recall the height of this string
  581. /psl_label PSL_str k get def % Get the current label
  582. /psl_depth psl_label sd def % Determine depth beneath baseline
  583. PSL_usebox % Want to lay down box outline or fill
  584. {PSL_CT_clippath % Box path now current path
  585. PSL_fillbox % Want to paint box
  586. {V PSL_setboxrgb fill U} if
  587. PSL_drawbox % Want to draw outline of box
  588. {V PSL_setboxpen S U} if N
  589. } if
  590. PSL_CT_placeline psl_label PSL_gap_x PSL_just PSL_height psl_depth PSL_pathtext
  591. } def
  592. /PSL_CT_clippath
  593. { % Lays down a curved clipbox for one label
  594. /H PSL_height 2 div PSL_gap_y add def
  595. /xoff j 1 add array def
  596. /yoff j 1 add array def
  597. /angle 0 def % So it is at least a defined variable
  598. 0 1 j { % Loop over points along line to calculate angle and offsets
  599. /ii exch def % Index
  600. /x PSL_xp ii get def
  601. /y PSL_yp ii get def
  602. ii 0 eq { % Are we at the first point and hence must calculate angle using 0 and 1?
  603. /x1 PSL_xp 1 get def
  604. /y1 PSL_yp 1 get def
  605. /dx x1 x sub def
  606. /dy y1 y sub def
  607. }
  608. { /i1 ii 1 sub def % Previous point
  609. /x1 PSL_xp i1 get def
  610. /y1 PSL_yp i1 get def
  611. /dx x x1 sub def
  612. /dy y y1 sub def
  613. } ifelse
  614. dx 0.0 ne dy 0.0 ne and
  615. { /angle dy dx atan 90 add def} if % Only calculate new angle if not duplicates
  616. /sina angle sin def
  617. /cosa angle cos def
  618. xoff ii H cosa mul put
  619. yoff ii H sina mul put
  620. } for
  621. % Lay down next clip segment
  622. PSL_xp 0 get xoff 0 get add PSL_yp 0 get yoff 0 get add M
  623. 1 1 j { % Loop over the rest of the upper line
  624. /ii exch def
  625. PSL_xp ii get xoff ii get add PSL_yp ii get yoff ii get add L
  626. } for
  627. j -1 0 { % Loop backwards over the rest of the lower line
  628. /ii exch def
  629. PSL_xp ii get xoff ii get sub PSL_yp ii get yoff ii get sub L
  630. } for P
  631. } def
  632. /PSL_CT_drawline
  633. {
  634. /str 20 string def
  635. % PSL_strokeline PSL_seg 0 eq and % If we asked to draw lines...
  636. PSL_strokeline % If we asked to draw lines...
  637. {PSL_CT_placeline S} if % Lay down the rest of the path and stroke it
  638. /PSL_seg PSL_seg 1 add def % Goto next segment number
  639. /n 1 def % Set n to 1
  640. } def
  641. /PSL_CT_placeline
  642. {PSL_xp 0 get PSL_yp 0 get M % Set the anchor point of the path
  643. 1 1 j { /ii exch def PSL_xp ii get PSL_yp ii get L} for % Lay down the rest of the path
  644. } def
  645. %%%%%%%%%%%%%%%%%%% DRAW BASELINE TEXT SEGMENT LINES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  646. % PSL_draw_path_lines will draw the lines that have been stored in the concatenated
  647. % PSL_path_x and PSL_path_y arrays using the pen attributes in the PSL_path_pen array
  648. /PSL_draw_path_lines
  649. { % Draws the lines already stored in the PSL_path_x|y arrays
  650. /PSL_n_paths1 PSL_n_paths 1 sub def % One less is the upper limit in for loop over the paths
  651. V
  652. /psl_start 0 def % Start index of segment in concatenated path array
  653. 0 1 PSL_n_paths1 % Loop over all segments
  654. { /psl_k exch def % Index into the PSL arrays
  655. /PSL_n PSL_path_n psl_k get def % Get the number of points in this line segment
  656. /PSL_n1 PSL_n 1 sub def % One less is the upper limit in for loop over points
  657. PSL_path_pen psl_k get cvx exec % Get and set this line's pen
  658. N % Clean path
  659. PSL_path_x psl_start get PSL_path_y psl_start get M % Place anchor point of this segment
  660. 1 1 PSL_n1 % Loop over points in this segment
  661. { /psl_i exch def % Local index of next point in segment
  662. /psl_kk psl_i psl_start add def % Equivalent index in concatenated array of all segments
  663. PSL_path_x psl_kk get PSL_path_y psl_kk get L % Draw to next point
  664. } for
  665. S % Stroke this path
  666. /psl_start psl_start PSL_n add def % Go to next segment and update start index for path
  667. } for
  668. U
  669. } def
  670. %%%%%%%%%%%%%%%%%%% STRAIGHT BASELINE TEXT PLACEMENT FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  671. % PSL_straight_path_labels deals with straight text labels w/wo textboxes (rect or rounded).
  672. % Only the (x,y) location of each label is needed.
  673. % Use <flags> PSL_straight_path_labels to paint|draw textboxes and place text
  674. % Use <flags> PSL_straight_path_clip to use textboxes to define and activate clipping
  675. % Subroutines of these functions are called PSL_ST_*
  676. % Local variables are called psl_*, "global" are called PSL_*
  677. /PSL_straight_path_labels
  678. { % This function will lay down (a) text box paint, (b) text box outline, and (c) text labels
  679. % All of these are optionals specified by the bit flag.
  680. /psl_bits exch def % Single bitflag argument passed
  681. /PSL_placetext psl_bits 2 and 2 eq def % true to place text, false to just make space
  682. /PSL_rounded psl_bits 32 and 32 eq def % true for rounded box shape, false gives rectangular box
  683. /PSL_fillbox psl_bits 128 and 128 eq def % true to paint box opaque before placing text
  684. /PSL_drawbox psl_bits 256 and 256 eq def % true to draw box outline before placing text
  685. /PSL_n_labels_minus_1 PSL_n_labels 1 sub def % Upper limit in loop over labels
  686. /PSL_usebox PSL_fillbox PSL_drawbox or def % true if we need box outline for fill or stroke or both
  687. 0 1 PSL_n_labels_minus_1 % Loop psl_k = 0 < PSL_n_labels
  688. { /psl_k exch def % Current label index psl_k
  689. PSL_ST_prepare_text % Get all dimensions, coordinates, etc. for this label
  690. PSL_usebox % If a text box is requested we go in here:
  691. { PSL_rounded % Place text box path, either straight or rounded, on stack
  692. {PSL_ST_textbox_round}
  693. {PSL_ST_textbox_rect}
  694. ifelse
  695. PSL_fillbox {V PSL_setboxrgb fill U} if % Paint it, if requested
  696. PSL_drawbox {V PSL_setboxpen S U} if % Outline it, if requested
  697. N % Done, so remove path
  698. } if
  699. PSL_placetext {PSL_ST_place_label} if % Show text, if requested
  700. } for
  701. } def
  702. /PSL_straight_path_clip
  703. { % This function will create a total clip path for all the labels in PSL_txt
  704. /psl_bits exch def % Single bit flag argument passed
  705. /PSL_rounded psl_bits 32 and 32 eq def % true for rounded box shape, false gives rectangular box
  706. /PSL_n_labels_minus_1 PSL_n_labels 1 sub def % Upper limit in loop over labels
  707. N clipsave clippath % Start clip path by selecting the entire mappable area
  708. 0 1 PSL_n_labels_minus_1 % Loop over all labels
  709. { /psl_k exch def % Current label index psl_k
  710. PSL_ST_prepare_text % Get all dimensions, coordinates, etc. for this label
  711. PSL_rounded % Get either straight or rounded text box path
  712. {PSL_ST_textbox_round}
  713. {PSL_ST_textbox_rect}
  714. ifelse
  715. } for
  716. PSL_clip N % Set the new clip path, increment clip counter and clear path
  717. } def
  718. /PSL_ST_prepare_text % Compute various dimensions and coordinates for one label
  719. { % The current label has index psl_k
  720. /psl_xp PSL_txt_x psl_k get def % Get text placement x coordinate
  721. /psl_yp PSL_txt_y psl_k get def % Get text placement y coordinate
  722. /psl_label PSL_label_str psl_k get def % Current text label
  723. PSL_label_font psl_k get cvx exec % Get and set this label's font attributes
  724. /PSL_height PSL_heights psl_k get def % Recall the height of this string
  725. /psl_boxH PSL_height PSL_gap_y 2 mul add def % Set height of current label including clearance
  726. /PSL_just PSL_label_justify psl_k get def % Get text justification (1-11)
  727. /PSL_justx PSL_just 4 mod 1 sub 2 div neg def % This is 0, -0.5, or -1 for relative x-shift
  728. /PSL_justy PSL_just 4 idiv 2 div neg def % This is 0, -0.5, or -1 for relative y-shift
  729. /psl_SW psl_label stringwidth pop def % Width of current label space
  730. /psl_boxW psl_SW PSL_gap_x 2 mul add def % Width of current label space including clearance
  731. /psl_x0 psl_SW PSL_justx mul def % (psl_x0,psl_y0) is rotated/adjusted text LL point on inside rectangle relative to psl_xp,psl_yp
  732. /psl_y0 PSL_justy PSL_height mul def %
  733. /psl_angle PSL_label_angle psl_k get def % The angle of text w.r.t. baseline
  734. } def
  735. /PSL_ST_textbox_rect % Compute and place rectangular path for current label
  736. {
  737. psl_xp psl_yp T psl_angle R psl_x0 psl_y0 T % Rotate the coordinate system to follow baseline text and make (psl_x0,psl_y0) the new origin
  738. PSL_gap_x neg PSL_gap_y neg M % Set LL anchor point for rectangular box
  739. 0 psl_boxH D psl_boxW 0 D 0 psl_boxH neg D P % Draw text box going CW
  740. psl_x0 neg psl_y0 neg T psl_angle neg R psl_xp neg psl_yp neg T % Unto trans/rot above
  741. } def
  742. /PSL_ST_textbox_round % Compute and place rounded rectangular path for current label
  743. {
  744. /psl_BoxR PSL_gap_x PSL_gap_y lt {PSL_gap_x} {PSL_gap_y} ifelse def % Smallest gap distance is our corner radius
  745. /psl_xd PSL_gap_x psl_BoxR sub def % When x_gap exceeds y_gap there will be an adjustment in x, else 0
  746. /psl_yd PSL_gap_y psl_BoxR sub def % When y_gap exceeds x_gap there will be an adjustment in y, else 0
  747. /psl_xL PSL_gap_x neg def % Left-most x coordinate of text box
  748. /psl_yB PSL_gap_y neg def % Bottom y coordinate of text box
  749. /psl_yT psl_boxH psl_yB add def % Top y coordinate of text box
  750. /psl_H2 PSL_height psl_yd 2 mul add def % Inner height when adjusting for any psl_yd offset
  751. /psl_W2 psl_SW psl_xd 2 mul add def % Inner width when adjusting for any psl_xd offset
  752. /psl_xR psl_xL psl_boxW add def % Right-most x coordinate of text box
  753. /psl_x0 psl_SW PSL_justx mul def % (psl_x0,psl_y0) is rotated/adjusted text LL point on inside rectangle relative to psl_xp,psl_yp
  754. psl_xp psl_yp T psl_angle R psl_x0 psl_y0 T % Rotate the coordinate system to follow baseline text and make (psl_x0,psl_y0) the new origin
  755. psl_xL psl_yd M % LL anchor point for rounded box is on lower left side just before rounded corner
  756. psl_xL psl_yT psl_xR psl_yT psl_BoxR arct psl_W2 0 D % Draw UL rounded corner and line to start of UR rounded corner
  757. psl_xR psl_yT psl_xR psl_yB psl_BoxR arct 0 psl_H2 neg D % Draw UR rounded corner and line to LR rounded corner
  758. psl_xR psl_yB psl_xL psl_yB psl_BoxR arct psl_W2 neg 0 D % Draw LR rounded corner and line to LL rounded corner
  759. psl_xL psl_yB psl_xL psl_yd psl_BoxR arct P % Draw LL rounded corner and close the clippath segment
  760. psl_x0 neg psl_y0 neg T psl_angle neg R psl_xp neg psl_yp neg T % Unto trans/rot above
  761. } def
  762. /PSL_ST_place_label % Just place the current label
  763. {
  764. V psl_xp psl_yp T psl_angle R % Set origin at text point and rotate the coordinate system to follow baseline text
  765. psl_SW PSL_justx mul psl_y0 M % Goto LL point on label
  766. psl_label dup sd neg 0 exch G show % Place the text, adjust vertically for any depth below baseline
  767. U % Undo damage to coordinate system
  768. } def
  769. /PSL_nclip 0 def % The depth of clipping in effect
  770. /PSL_clip {clip /PSL_nclip PSL_nclip 1 add def} def % Clip and update PSL_nclip
  771. /PSL_eoclip {eoclip /PSL_nclip PSL_nclip 1 add def} def % Even-odd clip and update PSL_nclip
  772. /PSL_cliprestore {cliprestore /PSL_nclip PSL_nclip 1 sub def} def % Cliprestore and update PSL_nclip
  773. %%EndProlog
  774. %%BeginSetup
  775. /PSLevel /languagelevel where {pop languagelevel} {1} ifelse def
  776. PSLevel 1 gt { << /PageSize [612 792] /ImagingBBox null >> setpagedevice } if
  777. %%EndSetup
  778. %%Page: 1 1
  779. %%BeginPageSetup
  780. %
  781. % Init coordinate system and scales
  782. %
  783. %
  784. % Scale initialized to 0.06, so 1 inch equals 1200 Postscript units
  785. %
  786. V 0.06 0.06 scale
  787. %%EndPageSetup
  788. %
  789. % End of PSL header
  790. %
  791. /PSL_page_xsize 10200 def
  792. /PSL_page_ysize 13200 def
  793. 0 A
  794. FQ
  795. O0
  796. 1200 1200 TM
  797. % PostScript produced by:
  798. %%GMT: psxy -R-5/185/-1/6 -JX6i/9i -P -K -W1p,red -Sqn2:+f12p+Lh+o+e data.txt --PS_COMMENTS=true
  799. %%PROJ: xy -5.00000000 185.00000000 -1.00000000 6.00000000 -5.000 185.000 -1.000 6.000 +xy +a=6378137.000 +b=6356752.314245
  800. %%BeginObject PSL_Layer_1
  801. 0 setlinecap
  802. 0 setlinejoin
  803. 3.32551 setmiterlimit
  804. %
  805. % Segment header: -L"The first curve"
  806. %
  807. %
  808. % Segment header: -L"The second curve"
  809. %
  810. %
  811. % Segment header: -L"The third curve"
  812. %
  813. %
  814. % Store path and label attributes:
  815. %
  816. PSL_font_encode 0 get 0 eq {Standard+_Encoding /Helvetica /Helvetica PSL_reencode PSL_font_encode 0 1 put} if % Set this font
  817. %
  818. % Pen and fill for text boxes (if enabled):
  819. %
  820. /PSL_setboxpen {4 W 0 A [] 0 B} def
  821. /PSL_setboxrgb {1 A} def
  822. %
  823. % Store pens used for each line segment:
  824. %
  825. /PSL_path_pen [
  826. (17 W 1 0 0 C [] 0 B)
  827. (17 W 1 0 0 C [] 0 B)
  828. (17 W 1 0 0 C [] 0 B)
  829. ] def
  830. %
  831. % Store text justification for each text label:
  832. %
  833. /PSL_label_justify [ 6 6 6 6 6 6 ] def
  834. %
  835. % Store font setting for each text label:
  836. %
  837. /PSL_label_font [
  838. (0 A 200 F0)
  839. (0 A 200 F0)
  840. (0 A 200 F0)
  841. (0 A 200 F0)
  842. (0 A 200 F0)
  843. (0 A 200 F0)
  844. ] def
  845. %
  846. % Set constants for textbox clearance:
  847. %
  848. /PSL_gap_x 30 def
  849. /PSL_gap_y 30 def
  850. %
  851. % Set array with baseline angle for each text label:
  852. %
  853. /PSL_label_angle [ 12.75 12.75 12.75 12.75 12.75 12.75 ] def
  854. %
  855. % Set array with the text labels:
  856. %
  857. /PSL_label_str [
  858. (The first curve)
  859. (The first curve)
  860. (The second curve)
  861. (The second curve)
  862. (The third curve)
  863. (The third curve)
  864. ] def
  865. /PSL_label_n [ 2 2 2 ] def
  866. /PSL_n_paths 3 def
  867. /PSL_n_labels 6 def
  868. %
  869. % Set coordinate arrays for text label placements:
  870. %
  871. /PSL_txt_x [ 2463 4737 2463 4737 2463 4737 ] def
  872. /PSL_txt_y [ 2057 2571 5143 5657 8229 8743 ] def
  873. /PSL_txt_n [ 6 ] def
  874. %
  875. % Estimate text heights:
  876. %
  877. PSL_set_label_heights
  878. %
  879. % Display the texts:
  880. %
  881. 34 PSL_straight_path_labels
  882. %
  883. % Set up text clippath and turn clipping ON:
  884. %
  885. 36 PSL_straight_path_clip
  886. %
  887. % Draw the text line segments:
  888. %
  889. PSL_path_pen 0 get cvx exec
  890. 189 1543 M
  891. 6822 1543 D
  892. S
  893. PSL_path_pen 1 get cvx exec
  894. 189 4629 M
  895. 6822 1542 D
  896. S
  897. PSL_path_pen 2 get cvx exec
  898. 189 7714 M
  899. 6822 1543 D
  900. S
  901. %%EndObject
  902. 0 A
  903. FQ
  904. O0
  905. 0 0 TM
  906. % PostScript produced by:
  907. %%GMT: psbasemap -R-5/185/-1/6 -JX6i/9i -O -K -B0 -B+gyellow --PS_COMMENTS=true
  908. %%PROJ: xy -5.00000000 185.00000000 -1.00000000 6.00000000 -5.000 185.000 -1.000 6.000 +xy +a=6378137.000 +b=6356752.314245
  909. %%BeginObject PSL_Layer_2
  910. 0 setlinecap
  911. 0 setlinejoin
  912. 3.32551 setmiterlimit
  913. {1 1 0 C} FS
  914. -7200 0 0 10800 7200 0 3 0 0 SP
  915. 25 W
  916. %
  917. % Start of basemap
  918. %
  919. %
  920. % Map boundaries
  921. %
  922. 2 setlinecap
  923. %
  924. % Start of left y-axis
  925. %
  926. %
  927. % Axis tick marks and annotations
  928. %
  929. N 0 10800 M 0 -10800 D S
  930. /PSL_A0_y 0 def
  931. /PSL_A1_y 0 def
  932. /PSL_LH 0 def /PSL_L_y PSL_A0_y PSL_A1_y mx def
  933. %
  934. % End of left y-axis
  935. %
  936. %
  937. % Start of right y-axis
  938. %
  939. 7200 0 T
  940. %
  941. % Axis tick marks and annotations
  942. %
  943. N 0 10800 M 0 -10800 D S
  944. /PSL_A0_y 0 def
  945. /PSL_A1_y 0 def
  946. /PSL_LH 0 def /PSL_L_y PSL_A0_y PSL_A1_y mx def
  947. %
  948. % End of right y-axis
  949. %
  950. -7200 0 T
  951. %
  952. % Start of lower x-axis
  953. %
  954. %
  955. % Axis tick marks and annotations
  956. %
  957. N 0 0 M 7200 0 D S
  958. /PSL_A0_y 0 def
  959. /PSL_A1_y 0 def
  960. /PSL_LH 0 def /PSL_L_y PSL_A0_y PSL_A1_y mx def
  961. %
  962. % End of lower x-axis
  963. %
  964. %
  965. % Start of upper x-axis
  966. %
  967. 0 10800 T
  968. %
  969. % Axis tick marks and annotations
  970. %
  971. N 0 0 M 7200 0 D S
  972. /PSL_A0_y 0 def
  973. /PSL_A1_y 0 def
  974. /PSL_LH 0 def /PSL_L_y PSL_A0_y PSL_A1_y mx def
  975. %
  976. % End of upper x-axis
  977. %
  978. 0 -10800 T
  979. 0 setlinecap
  980. %
  981. % End of basemap
  982. %
  983. %%EndObject
  984. 0 A
  985. FQ
  986. O0
  987. 0 0 TM
  988. % PostScript produced by:
  989. %%GMT: psclip -R-5/185/-1/6 -JX6i/9i -O -C '-B+tClipped text with yellow on top'
  990. %%PROJ: xy -5.00000000 185.00000000 -1.00000000 6.00000000 -5.000 185.000 -1.000 6.000 +xy +a=6378137.000 +b=6356752.314245
  991. %%BeginObject PSL_Layer_3
  992. 0 setlinecap
  993. 0 setlinejoin
  994. 3.32551 setmiterlimit
  995. PSL_nclip {PSL_cliprestore} repeat
  996. 25 W
  997. /PSL_H_y 233 def
  998. 3600 10800 PSL_H_y add M
  999. PSL_font_encode 0 get 0 eq {Standard+_Encoding /Helvetica /Helvetica PSL_reencode PSL_font_encode 0 1 put} if
  1000. 400 F0
  1001. (Clipped text with yellow on top) bc Z
  1002. %%EndObject
  1003. %%PageTrailer
  1004. U
  1005. showpage
  1006. %%Trailer
  1007. end
  1008. %%EOF
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...