Skip to content

Commit f33ef5a

Browse files
committed
renlinear: Hoist runtime-defined options dicts into predefined objects
1 parent 6f9493e commit f33ef5a

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

src/renlinear.ps.src

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
3939
dup /processoptions dup /uk.co.terryburton.bwipp findresource put
4040
dup /rendertext dup /uk.co.terryburton.bwipp findresource put
4141
begin
42+
43+
/renlinear.xalignopts <<
44+
/offleft dup /left dup /center dup /right dup /offright dup
45+
>> readonly def
46+
47+
/renlinear.yalignopts <<
48+
/above dup /top dup /center dup /bottom dup /below dup
49+
>> readonly def
50+
51+
/renlinear.directionoptions <<
52+
/forward dup /backward dup /upward dup /downward dup
53+
>> readonly def
54+
4255
/renlinear {
4356

4457
20 dict begin % Confine variables to local scope
@@ -110,34 +123,34 @@ begin
110123
% Input validation
111124

112125
textxalign (unset) ne {
113-
<< /offleft dup /left dup /center dup /right dup /offright dup >> textxalign known not {
126+
//renlinear.xalignopts textxalign known not {
114127
/bwipp.renlinearBadTextxalign (textxalign must be offleft, left, center, right or offright) //raiseerror exec
115128
} if
116129
} if
117130

118131
textyalign (unset) ne {
119-
<< /above dup /top dup /center dup /bottom dup /below dup >> textyalign known not {
132+
//renlinear.yalignopts textyalign known not {
120133
/bwipp.renlinearBadTextyalign (textyalign must be above, top, center, bottom or below) //raiseerror exec
121134
} if
122135
} if
123136

124-
<< /forward dup /backward dup /upward dup /downward dup >> textdirection known not {
137+
//renlinear.directionoptions textdirection known not {
125138
/bwipp.renlinearBadTextdirection (textdirection must be forward, backward, upward or downward) //raiseerror exec
126139
} if
127140

128141
textsize 0 le textsize 25 ge or {
129142
/bwipp.renlinearBadTextsize (textsize must be greater than zero and less that 25) //raiseerror exec
130143
} if
131144

132-
<< /offleft dup /left dup /center dup /right dup /offright dup >> extratextxalign known not {
145+
//renlinear.xalignopts extratextxalign known not {
133146
/bwipp.renlinearBadExtratextxalign (extratextxalign must be offleft, left, center, right or offright) //raiseerror exec
134147
} if
135148

136-
<< /above dup /top dup /center dup /bottom dup /below dup >> extratextyalign known not {
149+
//renlinear.yalignopts extratextyalign known not {
137150
/bwipp.renlinearBadExtratextyalign (extratextyalign must be above, top, center, bottom or below) //raiseerror exec
138151
} if
139152

140-
<< /forward dup /backward dup /upward dup /downward dup >> extratextdirection known not {
153+
//renlinear.directionoptions extratextdirection known not {
141154
/bwipp.renlinearBadExtratextdirection (extratextdirection must be forward, backward, upward or downward) //raiseerror exec
142155
} if
143156

0 commit comments

Comments
 (0)