forked from swissmicros/SDKdemo
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDrawingText.48s
154 lines (144 loc) · 2.66 KB
/
DrawingText.48s
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
«
@ Restore foreground and background in case we interrupted another program
0 Gray Foreground
64 STWS
1 Gray Background
0 300
for i
"Text line i=" i + " " + i 9 mod Disp
0.01 Wait
next
0 300
for i
"Fractional line i=" i + " " + i 16 / 9 mod Disp
0.01 Wait
next
«
Dup2
Disp
0.01 Wait
'Foreground' RCL
→ fg
«
1 gray Foreground
Disp
fg Foreground
»
»
→ DispThenErase
«
ClearLCD
0 300
for i
" Pixel positioning "
{ 10#200 10#120 2 true true 0 0 } Disp
"Pos " { } #0 i + 223 mod + #0 i 45 mod + 25 + +
dup Rot Swap ToText + " " +
Swap
DispThenErase
next
ClearLCD
Degrees
1 360
for i
" Complex positioning "
{ 10#200 10#120 2 true true 0 0 } Disp
" Angle " i +
4.5 i R->P 2.9 -
DispThenErase
next
ClearLCD
1 360
for i
" Scaled positioning "
{ 10#200 10#120 2 true true 0 0 } Disp
" Angle " i +
{ } i cos 7 * 2.9 - + i 3 * sin 3 * +
DispThenErase
next
»
ClearLCD
" Fonts " { 10#200 10#180 2 true true 0 1 } Disp
0 11 for f
"Font " f +
{
{ 10#10 10#0 }
{ 10#10 10#48 }
{ 10#10 10#80 }
{ 10#10 10#98 }
{ 10#10 10#130 }
{ 10#240 10#0 }
{ 10#240 10#25 }
{ 10#240 10#45 }
{ 10#240 10#64 }
{ 10#240 10#84 }
{ 10#240 10#120 }
{ 10#240 10#150 }
}
f 1 + Get
f +
Disp
next
1.5 Wait
ClearLCD
" Patterns " { 10#200 10#180 2 true true 0 1 } Disp
0 15 for p
16#1111111111111111 p * Foreground
0 11 for f
"Font " f +
{
{ 10#10 10#0 }
{ 10#10 10#48 }
{ 10#10 10#80 }
{ 10#10 10#98 }
{ 10#10 10#130 }
{ 10#240 10#0 }
{ 10#240 10#25 }
{ 10#240 10#45 }
{ 10#240 10#64 }
{ 10#240 10#84 }
{ 10#240 10#120 }
{ 10#240 10#150 }
}
f 1 + Get
f +
Disp
next
0.2 Wait
next
ClearLCD
#0 Foreground
" Background " { 10#200 10#180 2 true true 0 1 } Disp
16#FFFFFFFFFFFFFFFF Foreground
0 15 for p
16#1111111111111111 p * Background
0 11 for f
"Font " f +
{
{ 10#10 10#0 }
{ 10#10 10#48 }
{ 10#10 10#80 }
{ 10#10 10#98 }
{ 10#10 10#130 }
{ 10#240 10#0 }
{ 10#240 10#25 }
{ 10#240 10#45 }
{ 10#240 10#64 }
{ 10#240 10#84 }
{ 10#240 10#120 }
{ 10#240 10#150 }
}
f 1 + Get
f +
Disp
next
0.2 Wait
next
ClearLCD
0 GRAY Foreground 1 GRAY Background
" Align left " { 10#000 10#120 2 true true 1 0 } Disp
" Align Right " { 10#400 10#120 2 true true -1 0 } Disp
" Center " { 10#200 10#120 2 true true 0 0 } Disp
" Align Top " { 10#200 10#000 2 true true 0 1 } Disp
" Align Bottom " { 10#200 10#240 2 true true 0 -1 } Disp
»