| 1 |
$Id: SYNTAX,v 1.46 2008/01/18 17:43:20 nishida Exp $ |
| 2 |
|
| 3 |
placement restriction for directives: |
| 4 |
.mgprc preamble main pages |
| 5 |
--- --- --- |
| 6 |
%vfcap okay x okay |
| 7 |
%tfdir okay x okay |
| 8 |
%tfont0 okay x okay |
| 9 |
%default x okay x |
| 10 |
%tab x okay x |
| 11 |
%deffont x okay x |
| 12 |
%include x okay x |
| 13 |
others x x okay |
| 14 |
|
| 15 |
|
| 16 |
%% |
| 17 |
Comment lines. |
| 18 |
|
| 19 |
# |
| 20 |
Comment lines. |
| 21 |
|
| 22 |
\# (at the beginning of a line) |
| 23 |
Shows the character #. |
| 24 |
|
| 25 |
\% (at the beginning of a line) |
| 26 |
Shows the character %. |
| 27 |
|
| 28 |
\ |
| 29 |
Followed by an escape sequence. Currently supported: |
| 30 |
|
| 31 |
- \\ converts to the character \. |
| 32 |
- \xHH (case insensitiv), where HH are hexadecimal digits. |
| 33 |
Converts to the ASCII-character number HH. |
| 34 |
|
| 35 |
Escaping is switched off in Unicode. |
| 36 |
|
| 37 |
\ (at the end of line) |
| 38 |
Line continuation. Spaces/tabs at the beginning of next line |
| 39 |
will be ignored. |
| 40 |
|
| 41 |
%size <size> |
| 42 |
<size> :: size of fonts |
| 43 |
|
| 44 |
%fore "color" |
| 45 |
"color" :: color of foreground |
| 46 |
|
| 47 |
%back "color" |
| 48 |
"color" :: color of background |
| 49 |
|
| 50 |
%ccolor "color" |
| 51 |
"color" :: color of page guide and balloon help in bottom line |
| 52 |
|
| 53 |
%bgrad <xsize> <ysize> <nuncolor> <dir> <zoomflag> <colorlist...> |
| 54 |
<xsize> :: width of generated image(0-100%) |
| 55 |
0 means physical display size |
| 56 |
<ysize> :: height of generated image(0-100%) |
| 57 |
0 means physical display size |
| 58 |
<numcolor> :: number of colors, 0 means no reduction. |
| 59 |
default 256 colors(8bit) |
| 60 |
<dir> :: gradation direction (0-360 degree) |
| 61 |
0 :Top to Bottom 90 :Left to Right |
| 62 |
180:Bottom to Top 270 :Right to Left |
| 63 |
default 0 |
| 64 |
negative value means "non-liner gradation" |
| 65 |
<zoomflag> :: zoom to max size |
| 66 |
0 nozoom, 1 zoom |
| 67 |
default 0 |
| 68 |
<colorlist> :: colors in the gradation image |
| 69 |
|
| 70 |
%left |
| 71 |
Left justify. |
| 72 |
|
| 73 |
%leftfill |
| 74 |
Left justify, with folding long line. |
| 75 |
|
| 76 |
%center |
| 77 |
Centering. |
| 78 |
|
| 79 |
%right |
| 80 |
Right justify. |
| 81 |
|
| 82 |
%shrink |
| 83 |
(not supported at this moment) |
| 84 |
|
| 85 |
%lcutin |
| 86 |
Text will be animated (flying from the leftmost edge of the page). |
| 87 |
|
| 88 |
%rcutin |
| 89 |
Text will be animated (flying from the leftmost edge of the page). |
| 90 |
|
| 91 |
%cont |
| 92 |
Draw without line break. |
| 93 |
|
| 94 |
%nodefault |
| 95 |
Disable effect of default directive. |
| 96 |
|
| 97 |
%xfont "font" |
| 98 |
%xfont "font" "registry" |
| 99 |
<font> :: use X11's <font> to draw characters. |
| 100 |
"font" is for specifying X11 XLFD, font alias name, or |
| 101 |
"family-weight-slant". |
| 102 |
"registry" is for specifying "registry-encoding". |
| 103 |
|
| 104 |
interpretation of "registry": |
| 105 |
- If none specified, "iso8859-1" is assumed. |
| 106 |
- If no dash inside, encoding of "*" is assumed. |
| 107 |
Therefore, you'll get "REGISTRY-*". |
| 108 |
- If there's a single dash inside, use specified value. |
| 109 |
Therefore, you'll get "REGISTRY-SPECIFIED". |
| 110 |
|
| 111 |
interpretation of "font": |
| 112 |
- If it has no dash inside, |
| 113 |
Try font alias, such as "8x5" or "a14". |
| 114 |
If there's no font alias matched, it should be "times" or |
| 115 |
something like that. In this case, try |
| 116 |
"-*-FONT-*-*-*-*-SIZE-*-*-*-*-*-REGISTERY-SPECIFIED". |
| 117 |
- If it has single dash inside, such as "times-medium": |
| 118 |
Try "-*-FONT-NAME-*-*-*-SIZE-*-*-*-*-*-REGISTRY-SPECIFIED". |
| 119 |
- If it has two dash inside, such as "times-medium-r": |
| 120 |
Try "-*-FONT-NAME-SPECIFIED-*-*-SIZE-*-*-*-*-*-REGISTRY-SPECIFIED". |
| 121 |
- Otherwise, try the specified string itself as XLFD. |
| 122 |
|
| 123 |
Some exercises: |
| 124 |
%xfont "times" |
| 125 |
You'll get "-*-times-*-*-*-*-SIZE-*-*-*-*-*-iso8859-1". |
| 126 |
%xfont "mincho" "jisx0208.1983" |
| 127 |
You'll get "-*-mincho-*-*-*-*-SIZE-*-*-*-*-*-jisx0208.1983-*". |
| 128 |
%xfont "mincho-medium-r" "jisx0208.1983" |
| 129 |
You'll get "-*-mincho-medium-r-*-*-SIZE-*-*-*-*-*-jisx0208.1983-*". |
| 130 |
|
| 131 |
NOTE: Only the following items are meaningful as "registry". |
| 132 |
jisx0208.1983-* |
| 133 |
gb2312.1980-* |
| 134 |
ksc5601.1987-* |
| 135 |
iso8859-1 |
| 136 |
iso8859-2 |
| 137 |
iso8859-3 |
| 138 |
iso8859-4 |
| 139 |
It would be nice if we can support "adobe-specific" for symbols, |
| 140 |
however, we have no escape sequence to designate the it... |
| 141 |
|
| 142 |
|
| 143 |
If you have installed magicpoint with Xft2 enabled, %xfont will accept |
| 144 |
"FONTNAME", "FONTNAME:STYLE", and "FONTNAME:style=STYLE". |
| 145 |
Note that if you specify "FONTNAME" and it contains '-', it will be |
| 146 |
interpreted as XLFD. In such a case, you should use "FONTNAME:STYLE" |
| 147 |
or "FONTNAME:style=STYLE". |
| 148 |
|
| 149 |
%vfont "font" |
| 150 |
<font> :: use VFlib's <font> to draw Kanji characters. |
| 151 |
|
| 152 |
%tfont "font" |
| 153 |
<font> :: use TrueType font <font> to draw ASCII characters. |
| 154 |
<font> can be full pathname, or just filename. Use %tfdir |
| 155 |
for setting default font directory. |
| 156 |
|
| 157 |
%tmfont "font" |
| 158 |
<font> :: use TrueType font <font> to draw Kanji characters. |
| 159 |
<font> can be full pathname, or just filename. |
| 160 |
|
| 161 |
you do not need it with Xft2 enabled installation. |
| 162 |
|
| 163 |
%tfont0 "font" |
| 164 |
<font> :: use TrueType font <font>, if none of the font specified by |
| 165 |
%tfont directive is found. This is the last-resort for the |
| 166 |
TrueType font finding code. |
| 167 |
(allowed in ~/.mgprc, without "%" sign) |
| 168 |
|
| 169 |
you do not need it with Xft2 enabled installation. |
| 170 |
%psfont "font" |
| 171 |
<font>:: use PostScript fonts to create PostScript file |
| 172 |
Suported fonts are: |
| 173 |
Times-[Roman|Italic|Bold|BoldItalic] |
| 174 |
Helvetica |
| 175 |
Helvetica-[BoldOblique|Bold|Oblique] |
| 176 |
Helvetica-Narrow |
| 177 |
Helvetica-Narrow[Oblique|Bold|Oblique] |
| 178 |
NewCenturySchlbk-[Roman|Bold|Italic|BoldItalic] |
| 179 |
Courier |
| 180 |
Courier-[Oblique|Bold|BoldOblique] |
| 181 |
AvantGarde-[Book|BookOblique|Demi|DemiOblique] |
| 182 |
Bookman-[Demi|DemiItalic|Light|LigtItalic] |
| 183 |
Palatino-[Roman|Bold|Italic|BoldItalic] |
| 184 |
ZapfChanery-MediumItalic |
| 185 |
Symbol |
| 186 |
ZapfDingbats |
| 187 |
if none of this fonts is specified it uses the default font Helvetica. |
| 188 |
|
| 189 |
%bar <color> <width> <start> <length> |
| 190 |
<color> :: color of bar, foreground color will be used as default. |
| 191 |
<width> :: permill of display height. default 10. |
| 192 |
<start> :: start position percent of display width. default 0. |
| 193 |
<length> :: length percent of display width. default 100. |
| 194 |
|
| 195 |
%valign "top|center|bottom" |
| 196 |
vertical alignment of images with current text line |
| 197 |
|
| 198 |
%image "imagefile" <numcolor> <xzoomrate> <yzoomrate> <zoomflag> |
| 199 |
%image "imagefile" [ [<numcolor>] <screensize> ] |
| 200 |
"imagefile" :: name of image file |
| 201 |
<numcolor> :: number of colors, 0 means no reduction. |
| 202 |
<xzoomrate> :: height percentage against physical display or original |
| 203 |
size, 0 means the original height. |
| 204 |
<yzoomrate> :: width percentage against physical display or original |
| 205 |
size, 0 means the original width. |
| 206 |
<zoomflag> :: 0 means zoomrate is against physial display |
| 207 |
others mean zoomrate is against original size |
| 208 |
|
| 209 |
<screensize> :: auto resizing. |
| 210 |
specify the original screen size by WIDTHxHEIGHT. |
| 211 |
unless screensize is the same size of the physical |
| 212 |
display, zoomrate is calculated automagically. |
| 213 |
|
| 214 |
Note that if the image is a binary image, current foreground |
| 215 |
and background colors are applied to the drawn image. |
| 216 |
|
| 217 |
%newimage [options] "imagefile" |
| 218 |
|
| 219 |
Same as %image, but it is much easier to understand. |
| 220 |
options include: |
| 221 |
-colors numcolors |
| 222 |
-xysize pixel pixel |
| 223 |
-zoom percentage |
| 224 |
-xyzoom x-percentage y-percentage |
| 225 |
Percentage is against the original image. |
| 226 |
"100" means the original image size, "50" means |
| 227 |
half the original image size. |
| 228 |
-scrzoom percentage |
| 229 |
-xscrzoom percentage |
| 230 |
-yscrzoom percentage |
| 231 |
-xyscrzoom x-percentage y-percentage |
| 232 |
Percentage is against the screen. "100" means screen |
| 233 |
width/height, "50" means half the screen width/height. |
| 234 |
-xscrzoom and -yscrzoom scales image with aspect |
| 235 |
ratio unchanged. |
| 236 |
-raise percentage |
| 237 |
raise the baseline of the image in the line. |
| 238 |
Percentage is against the height of the image. |
| 239 |
"100" means the height of the image. |
| 240 |
-rotate degrees |
| 241 |
degrees is angle measure counter clockwise, supported values are |
| 242 |
0, -90, 90, -180, 180, 270 |
| 243 |
-zoomonclk percentage |
| 244 |
enlarge image when it is clicked. Percentage is against the screen. |
| 245 |
"100" means screen width. |
| 246 |
|
| 247 |
|
| 248 |
TODO: supersede %image by %newimage? |
| 249 |
TODO: option for auto resize mode (fit image into the room left on |
| 250 |
the screen) |
| 251 |
|
| 252 |
%prefix "string" |
| 253 |
Place "string" at the beginning of line. |
| 254 |
"string" should be a set of blank characters (\040). |
| 255 |
|
| 256 |
The effect of %prefix command in %tab command is local to |
| 257 |
tab-indented line. |
| 258 |
|
| 259 |
%prefix <percentage> |
| 260 |
specify prefix spacing by <percentage> of the drawing area width. |
| 261 |
|
| 262 |
The effect of %prefix command in %tab command is local to |
| 263 |
tab-indented line. |
| 264 |
|
| 265 |
%icon <arc|box|delta1|delta2|delta3|delta4|dia> <color> <size> |
| 266 |
%icon <imagefile> <color> <size> |
| 267 |
add an icon for itemizing lines. |
| 268 |
for example, |
| 269 |
%tab 1 size 5, icon box green 50 |
| 270 |
gives you an green box on the leftmost column of line. |
| 271 |
size is the percentage against the current character size. |
| 272 |
|
| 273 |
%bimage "imagefile" [ <screensize> ] |
| 274 |
Specify the name of background image file |
| 275 |
<screensize> :: auto resizing. |
| 276 |
specify the original screen size by WIDTHxHEIGHT. |
| 277 |
unless screensize is the same size of the physical |
| 278 |
display, zoomrate is calculated automagically. |
| 279 |
|
| 280 |
%default <linenum> <list-of-directives> |
| 281 |
Unless nodefault directive is specified, the directives in the |
| 282 |
argument is prepended to the directives of the linenum'th line |
| 283 |
in every page. The syntax of <list-of-directives> is a comma |
| 284 |
separated directives. |
| 285 |
This directive has to be placed in the preamble. |
| 286 |
|
| 287 |
%tab <tabnum> <list-of-directives> |
| 288 |
Apply list of directives, if any of the lines start with tabnum |
| 289 |
tabs. |
| 290 |
This directive has to be placed in the preamble. |
| 291 |
|
| 292 |
%tab <id> <list-of-directives> |
| 293 |
Apply list of directives, if any of the lines start with "&id". |
| 294 |
This directive has to be placed in the preamble. |
| 295 |
|
| 296 |
%page |
| 297 |
A new page starts |
| 298 |
|
| 299 |
%vgap <gapsize> |
| 300 |
Specify vertical gap size of each line |
| 301 |
<gapsize>:: percentage against current character size |
| 302 |
vertical gap = vertical font size * gapsize / 100 |
| 303 |
|
| 304 |
%hgap <gapsize> |
| 305 |
Specify horizontal gap size of each line |
| 306 |
<gapsize>:: percentage against current character size |
| 307 |
horizontal gap = vertical font size * gapsize / 100 |
| 308 |
NOTE: horizontal gap is calculated based on vertical size, |
| 309 |
because fonts are proportional (horizontal size varies by code point). |
| 310 |
|
| 311 |
%pause |
| 312 |
Stop drawing until forward key or button is pressed |
| 313 |
|
| 314 |
%mark |
| 315 |
Mark the current position on the screen, so that we can come back |
| 316 |
later by %again. |
| 317 |
NOTE: mark is local to a page. mark will be cleared at the page |
| 318 |
boundary. |
| 319 |
|
| 320 |
%again |
| 321 |
Move current position to the location marked by %mark. |
| 322 |
|
| 323 |
%system "command" |
| 324 |
Fork&exec the specified program. |
| 325 |
NOTE: the program will be invoked every time the page is redrawn. |
| 326 |
It sometimes annoy you. it needs some rework. |
| 327 |
|
| 328 |
Special translation for presentation-window-relative geometry: |
| 329 |
Argument that starts with "%" will be translated as if |
| 330 |
it was interpreted relative to presentation window. |
| 331 |
|
| 332 |
"xeyes -geometry %50x50+25+25" will be translated |
| 333 |
so that eyes appear on the center of the presentation window. |
| 334 |
|
| 335 |
The command has to be placed on a line alone. |
| 336 |
Do not use commas. |
| 337 |
|
| 338 |
Process will be killed when you leave the page. |
| 339 |
|
| 340 |
%system "command" <page> |
| 341 |
Almost same as above. |
| 342 |
Process will be killed when you leave the specified <page>. |
| 343 |
If you set <page> to -1, the process will be killed when MagicPoint |
| 344 |
is terminated. (of course, you can terminate the child process alone |
| 345 |
by yourself) |
| 346 |
|
| 347 |
%filter "command" |
| 348 |
TEXT |
| 349 |
%endfilter |
| 350 |
Fork&exec the specified program, feed TEXT into that process |
| 351 |
from standard input. use the standard output from the process |
| 352 |
as presentation input. |
| 353 |
Do not forget to place %endfilter. |
| 354 |
|
| 355 |
The command has to be placed on a line alone. |
| 356 |
Do not use commas. |
| 357 |
|
| 358 |
%vfcap "filename" |
| 359 |
Specifies VFlib configuration filename. |
| 360 |
(allowed in ~/.mgprc, without "%" sign) |
| 361 |
|
| 362 |
%tfdir "dir" |
| 363 |
Specifies where to find TrueType font by default. |
| 364 |
(allowed in ~/.mgprc, without "%" sign) |
| 365 |
|
| 366 |
%deffont "fontname" <list-of-directives> |
| 367 |
Define a symbolic fontname, by using list-of-directives. |
| 368 |
The directive must appear in the preamble. |
| 369 |
|
| 370 |
For example, you may want to define a typewriter-like font as: |
| 371 |
%deffont "typewriter" xfont "courier", tfont "cour.ttf" |
| 372 |
By using the above definition, you can make your presentation file |
| 373 |
less dependent to the configuration of magicpoint binary. |
| 374 |
If the configuration allows the use of TrueType "cour.ttf" font, |
| 375 |
"tfont" directive will be effective. If there's no TrueType font |
| 376 |
available, or FreeType library is not compiled into the magicpoint |
| 377 |
binary you are currently using, "xfont" will be effective. |
| 378 |
|
| 379 |
"%font" cannot be used in "%deffont". this is for avoiding infinite |
| 380 |
loops. |
| 381 |
|
| 382 |
%font "fontname" |
| 383 |
Invoke the symbolic fontname defined by %deffont directive. |
| 384 |
|
| 385 |
%embed "filename" |
| 386 |
%endembed |
| 387 |
Embedded image support. uuencoded data fragment can be put between |
| 388 |
the directives. |
| 389 |
NOTE: this directive is not for human beings. use "mgpembed" command. |
| 390 |
|
| 391 |
%noop |
| 392 |
No operation |
| 393 |
|
| 394 |
%pcache <flag> <mode> <effect> <value> |
| 395 |
<flag> :: enable or disable forward page cache |
| 396 |
0 means disable forward page cache |
| 397 |
1 means enable forward page cache |
| 398 |
<mode> :: cache mode |
| 399 |
0 means caching is executed after 2seconds idle. |
| 400 |
1 means caching is executed immediately. |
| 401 |
<effect> :: type of 'special effect' for the forward page cache (0-2) |
| 402 |
<value> :: speed of 'special effect'. value 1 means the highest speed. |
| 403 |
|
| 404 |
%anim "filename" |
| 405 |
display animation file. (currently, only mng format is supported.) |
| 406 |
|
| 407 |
%charset "registry" |
| 408 |
Specify the encoding of the document. |
| 409 |
At this moment, the following charset are supported. |
| 410 |
iso8859-1 |
| 411 |
iso8859-2 |
| 412 |
iso8859-3 |
| 413 |
iso8859-4 |
| 414 |
|
| 415 |
%area <width> <height> [<xoffset> <yoffset>] |
| 416 |
Specify the drawing area within the window. All parameters are |
| 417 |
translated as relative value of the window. If offset is not |
| 418 |
specified, the drawing area will be put center. |
| 419 |
Note that all relative size specified in other directive after |
| 420 |
"%area" will be affected, i.e. it will be relative to the |
| 421 |
width/height of the drawing area instead of the window. |
| 422 |
|
| 423 |
%opaque <value> |
| 424 |
<value> :: transparency of the font. (0-100) |
| 425 |
Value 0 means that the font will be drawn with full tranparency. |
| 426 |
NOTE: To use this directive, you need to build mgp with Xft2. |
| 427 |
|
| 428 |
%setsup <sup offset> <sub offset> <scale> |
| 429 |
Initialize values for subsequent %sup (superscript) and |
| 430 |
%sub (subscript) commands. |
| 431 |
<sup offset> :: set superscript offset (percentage of font size) |
| 432 |
<sub offset> :: set superscript offset (percentage of font size) |
| 433 |
<scale> :: scale factor for super-/subscript font size |
| 434 |
The range of all three integer values goes from 10 to 100. |
| 435 |
When unset, the default value %setsup 40 15 60 is used. |
| 436 |
|
| 437 |
%sup |
| 438 |
Writes the immediately following line as superscript. |
| 439 |
Only works in connection with %cont. |
| 440 |
|
| 441 |
%sub |
| 442 |
Writes the immediately following line as subscript. |
| 443 |
Only works in connection with %cont. |