eh, make ’em volatile, this is not time-critical code anyway
[alioth/magicpoint.git] / sample / sample.mgp
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %%
3 %% You will need the relevant fonts installed.
4 %%
5 %deffont "standard" xfont "helvetica-medium-r", tfont "standard.ttf", tmfont "hoso6.ttf"
6 %deffont "thick" xfont "helvetica-bold-r", tfont "thick.ttf", tmfont "hoso6.ttf"
7 %deffont "typewriter" xfont "courier-medium-r", tfont "typewriter.ttf", tmfont "hoso6.ttf"
8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9 %%
10 %% Default settings per each line numbers.
11 %%
12 %default 1 area 90 90, leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0
13 %default 2 size 7, vgap 10, prefix " ", ccolor "black"
14 %default 3 size 2, bar "gray70", vgap 10
15 %default 4 size 5, fore "gray20", vgap 30, prefix " ", font "standard"
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 %%
18 %% Default settings that are applied to TAB-indented lines.
19 %%
20 %tab 1 size 5, vgap 40, prefix "  ", icon box "green" 50
21 %tab 2 size 4, vgap 40, prefix "      ", icon arc "yellow" 50
22 %tab 3 size 3, vgap 40, prefix "            ", icon delta3 "white" 40
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %page
25 %nodefault
26 %size 6.5, font "standard", back "white", ccolor "black"
27
28
29
30
31
32 %center, fore "Blue", font "standard", hgap 60, size 6.5
33 MAGIC POINT
34 %bar "skyblue" 6 15 70
35 %font "standard", hgap 0
36
37
38
39 %size 5, fore "darkblue"
40 Yoshifumi Nishida
41 %size 4.5
42 nishida@csl.sony.co.jp
43
44
45 %size 3, fore "black", hgap 20
46 TYPE SPC KEY!!
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48 %page
49 %bgrad 0 0 256 0 0 "white" "blue"
50
51 How to Use
52
53
54         forward page -> press mouse1 button
55         backward page -> press mouse3 button
56         quit -> press q key
57
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %page
60 %bgrad 0 0 256 90 0 "red" "white"
61
62 Command Line Option
63
64
65 %prefix "    -h:"
66 display usage.
67 %prefix "    -g:"
68 geometry. Set the size of window, and placement.
69 %prefix "    -o:"
70 Do not override window manager.
71 %prefix "    -b:"
72 bgcolor. Set background color to bgcolor. (default: black)
73 %prefix ""
74
75
76
77 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78 %page
79 %bgrad 0 0 256 0 0 "green" "white"
80
81 Place text whereever you like!
82
83
84 %area 40 80 5 20
85 %fore "red", size 6
86 %center
87 CENTER
88
89
90 %left
91 LEFT
92
93 %right
94 RIGHT
95 %area 40 80 50 20, leftfill, fore "black"
96         You can make a 2 column page by specifying drawing area.
97 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 %PAGE
99 %bgrad 25 25 256 45 1 "gray" "gray" "white" "white" "white" "white" "gray" "gray"
100
101 Use any font size as you like!
102
103
104
105 %CENTER
106 %SIZE 10,FORE "orange"
107 Hello World
108 %SIZE 7,FORE "gray"
109 Hello World
110 %SIZE 5,FORE "blue"
111 Hello World
112 %SIZE 4,FORE "yellow"
113 Hello World
114 %SIZE 3,FORE "green"
115 Hello World
116 %SIZE 2,FORE "red"
117 Hello World
118 %SIZE 1,FORE "pink"
119 Hello World
120 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 %page
122 %bgrad 25 25 256 45 1 "gray" "gray" "white" "white" "white" "white" "gray" "gray"
123
124 Fonts are selectable
125
126
127 %size 5, fore "red", center
128
129 %font "standard", hgap 20
130 This is Times
131
132 %font "thick"
133 This is Thick
134
135 %font "typewriter"
136 This is Courier
137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138 %page
139 %bgrad 25 25 256 45 1 "gray" "gray" "white" "white" "white" "white" "gray" "gray"
140
141 Control can be mixed
142
143
144
145 %center
146 %fore "green", font "standard", size 6
147 This is a
148 %cont, fore "orange", font "thick", size 10
149 Test
150 %cont, fore "red", font "typewriter", size 8
151 message
152
153 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 %page
155
156 Automatic folding of long line!
157
158
159         Hello, this is MagicPoint. I can properly handle the folding opeation of very long line, of course english word-wise.  The source code of this line is made up by a single line.
160                 This is the next line. Even if the indentation changes, I can handle this!  Yey!
161
162         You can also connect the line using backslash.  \
163                                 Yes, UNIX tradition.
164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165 %PAGE
166
167 Visualize inline images!
168
169
170 %CENTER
171 %IMAGE "cloud.jpg"
172 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173 %PAGE
174 %bgrad 0 0 256 0 0 "white" "blue"
175
176 Special effects!
177
178
179 %fore "red", size 6, center
180 %shrink
181 a test message
182
183 %lcutin
184 another test message
185
186 %rcutin
187 yet another test message
188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
189 %PAGE
190 %bgrad 0 0 256 0 0 "white" "blue"
191
192 Pause
193
194
195         Type SPC key (twice) to proceed.
196
197 %center, fore "red", hgap 20
198 Happy hacking!
199 %pause, fore "blue"
200 Happy hacking!
201 %pause, fore "green"
202 Happy hacking!
203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
204 %PAGE
205 %bgrad 0 0 256 0 0 "white" "blue"
206
207 Grab command output into foils
208
209
210         ls -l /kernel /bsd
211
212 %size 3, prefix "     "
213 %filter "ls -l /kernel /bsd"
214 %endfilter
215
216         echo "this is test" | rev
217 %filter "rev"
218
219 this is test
220 %endfilter
221
222 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
223 %PAGE
224 %bgrad 0 0 256 0 0 "white" "blue"
225
226 Subprocess (multimedia!)
227
228
229 %system "xeyes -geometry %50x20+25+60"
230
231         Invoke xanim/mpegplay for multimedia presentation! :-)
232
233         No duplicated subprocess for one declaration.
234         Geometry can be presentation-screen relative.
235         xeyes will vanish if you switch the page.
236
237 If you executed MagicPoint with the "-g" option, click to go to the next page. SPC may not work in this case
238
239 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240 %PAGE
241
242 Embed Subprocess
243
244
245         You can embed X applications in MagicPoint!
246
247         An example
248 %center
249 %xsystem "xclock -geometry %30x30+25+60 -update 1 -bg white -fg blue -hands green"
250
251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
252 %PAGE
253
254 New Features in Recent Versions
255
256         Supersript and subscript
257                 You can use superscript and subscript like
258 %setsup 65 25 65, cont
259 H
260 %cont, sub
261 2
262 %cont
263 O, Ca
264 %cont, sup
265 2+
266
267         %tsystem directive
268                 If %xsystem does not work properly on your system, please try to use %tsystem instead
269 %center
270 %tsystem "xclock -geometry %30x30+25+60 -update 1 -bg white -fg blue -hands green"
271 %left
272
273         Image rotation
274                 You can rotate your image with newimage directive
275 %center, newimage -xscrzoom 15 -rotate 90 "cloud.jpg"
276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
277 %PAGE
278 %bgrad 0 0 256 0 0 "skyblue" "white"
279 %PCACHE 1 1 0 30
280
281 Forward page cache (1)
282
283
284         The next slide is cached inwardly by using
285                 '%pcache' directive
286                 -F option
287
288
289         Next slide will appear quicker than before!
290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 %PAGE
292 %bgrad 0 0 256 0 0 "skyblue" "white"
293 %PCACHE 1 1 1 50
294
295 Forward page cache (2)
296
297
298         You can specify 'special effect' for the forward page cache.
299                 tap space bar to see the 'special effect'.
300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
301 %PAGE
302 %back "white"
303
304 Enlarging Images in Slides
305
306         You can enlarge images by clicking on them
307                 Use -zoomonclk option in %newimage
308                 Click the following image to see this feature
309
310
311
312
313 %center, newimage -xscrzoom 20 -zoomonclk 87 "cloud.jpg"
314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315 %PAGE
316 %bgrad 0 0 256 0 0 "skyblue" "white"
317 %PCACHE 0
318
319 Have a nice day!
320
321
322     Visit
323 %font "typewriter", fore "blue"
324        http://member.wide.ad.jp/wg/mgp/
325 %fore "gray20", font "standard"
326     for upcoming information.