-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.tmac
132 lines (118 loc) · 2.01 KB
/
style.tmac
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
\#======================================
\# STYLE MACROS
\#======================================
.blm @nop
.Macro SetStyle
. if \w|\\$2| .ds \\$1Font \\$2
. if \w|\\$3| .nr \\$1Size \\$3
. if \w|\\$4| .nr \\$1Lead \\$4
. if \w|\\$5| .ds \\$1Color \\$5
. if \w|\\$6| .ds \\$1Align \\$6
. if \w|\\$7| .nr \\$1PadLeft \\$7
. if \w|\\$8| .nr \\$1PadRight \\$8
..
.Macro Center
. br
. ad c
..
.Macro /Center
. br
. ad l
..
.Macro Left
. br
. ad l
..
.Macro /Left
. br
. ad l
..
.Macro @Align
. #push %alignment \\*[$current-align]
. ds $current-align \\$1
. if |\\$1|center| .Center
. if |\\$1|left| .Left
..
.Macro /@Align
. ds r \\*[$current-align]
. #pop %alignment
. if |\\*r|center| .Center
. if |\\*r|left| .Left
. ds $current-align \\*r
\#. ce 0
\#. rj 0
..
.Macro @Pad
. #pushN %pad-left (u;\\n[.i])
. #pushN %pad-right (u;\\n[.l])
. in \\$1
. ll -\\$2
..
.Macro /@Pad
. #popN %pad-left
. in -(u;\\nr)
. #popN %pad-right
. ll +(u;\\nr)
..
.Macro @Size
. #pushN %size \\n[.ps]u
. #pushN %lead \\n[.vs]u
. ps \\$1
. vs (\\$1+\\$2)
..
.Macro /@Size
. #popN %size
. ps \\n[r]u
\#(\\nr/1000)
. #popN %lead
. vs (u;\\n[.ps]+\\n[r])
\#(\\n[.ps]+\\nr/1000)
..
.Macro @Font
. #push %font \\*[$current-font]
. ds $current-font \\$1
. ft \\$1
..
.Macro /@Font
. #pop %font
. ds $current-font \\*r
. ft \\*r
..
.Macro @Color
. #push %color \\*[$current-color]
. ds $current-color \\$1
. gcolor \\$1
..
.Macro /@Color
. #pop %color
. ds $current-color \\*r
. gcolor \\*r
..
.Macro @SetStyle
. @Align \\*[\\$1Align]
\#. @Pad \\n[\\$1PadRight] \\n[\\$1PadLeft]
. @Size \\n[\\$1Size] \\n[\\$1Lead]
. @Font \\*[\\$1Font]
. @Color \\*[\\$1Color]
..
.Macro @ResetStyle
. /@Color
. /@Font
. /@Size
\#. /@Pad
. /@Align
..
.Macro NewStyle
. Macro \\$1Style /Macro
. SetStyle \\$*
. /Macro
. Macro @\\$1Style /Macro
. @SetStyle \\$1
. /Macro
. Alias /@\\$1Style @ResetStyle
..
.Macro @st*Init
. NewStyle Body
. SetStyle Body R 10 +2 black left 0i 0i
. @SetStyle Body
..