$Id: SYNTAX,v 1.36 2003/04/11 22:05:41 nishida Exp $ placement restriction for directives: .mgprc preamble main pages --- --- --- %vfcap okay x okay %tfdir okay x okay %tfont0 okay x okay %default x okay x %tab x okay x %deffont x okay x %include x okay x others x x okay # Comment lines. \ (at the end of line) Line continuation. Spaces/tabs at the beginning of next line will be ignored. %size :: size of fonts %fore "color" "color" :: color of foreground %back "color" "color" :: color of background %ccolor "color" "color" :: color of page guide and balloon help in bottom line %bgrad :: width of generated image(0-100%) 0 means physical display size :: height of generated image(0-100%) 0 means physical display size :: number of colors, 0 means no reduction. default 256 colors(8bit) :: gradation direction (0-360 degree) 0 :Top to Bottom 90 :Left to Right 180:Bottom to Top 270 :Right to Left default 0 negative value means "non-liner gradation" :: zoom to max size 0 nozoom, 1 zoom default 0 :: colors in the gradation image %left Left justify. %leftfill Left justify, with folding long line. %center Centering. %right Right justify. %shrink (not supported at this moment) %lcutin Text will be animated (flying from the leftmost edge of the page). %rcutin Text will be animated (flying from the leftmost edge of the page). %cont Draw without line break. %nodefault Disable effect of default directive. %xfont "font" %xfont "font" "registry" :: use X11's to draw characters. "font" is for specifying X11 XLFD, font alias name, or "family-weight-slant". "registry" is for specifying "registry-encoding". interpretation of "registry": - If none specified, "iso8859-1" is assumed. - If no dash inside, encoding of "*" is assumed. Therefore, you'll get "REGISTRY-*". - If there's a single dash inside, use specified value. Therefore, you'll get "REGISTRY-SPECIFIED". interpretation of "font": - If it has no dash inside, Try font alias, such as "8x5" or "a14". If there's no font alias matched, it should be "times" or something like that. In this case, try "-*-FONT-*-*-*-*-SIZE-*-*-*-*-*-REGISTERY-SPECIFIED". - If it has single dash inside, such as "times-medium": Try "-*-FONT-NAME-*-*-*-SIZE-*-*-*-*-*-REGISTRY-SPECIFIED". - If it has two dash inside, such as "times-medium-r": Try "-*-FONT-NAME-SPECIFIED-*-*-SIZE-*-*-*-*-*-REGISTRY-SPECIFIED". - Otherwise, try the specified string itself as XLFD. Some exercises: %xfont "times" You'll get "-*-times-*-*-*-*-SIZE-*-*-*-*-*-iso8859-1". %xfont "mincho" "jisx0208.1983" You'll get "-*-mincho-*-*-*-*-SIZE-*-*-*-*-*-jisx0208.1983-*". %xfont "mincho-medium-r" "jisx0208.1983" You'll get "-*-mincho-medium-r-*-*-SIZE-*-*-*-*-*-jisx0208.1983-*". NOTE: Only the following items are meaningful as "registry". jisx0208.1983-* gb2312.1980-* ksc5601.1987-* iso8859-1 iso8859-2 iso8859-3 iso8859-4 It would be nice if we can support "adobe-specific" for symbols, however, we have no escape sequence to designate the it... %vfont "font" :: use VFlib's to draw Kanji characters. %tfont "font" :: use TrueType font to draw ASCII characters. can be full pathname, or just filename. Use %tfdir for setting default font directory. %tmfont "font" :: use TrueType font to draw Kanji characters. can be full pathname, or just filename. %tfont0 "font" :: use TrueType font , if none of the font specified by %tfont directive is found. This is the last-resort for the TrueType font finding code. (allowed in ~/.mgprc, without "%" sign) %bar :: color of bar, foreground color will be used as default. :: permill of display height. default 10. :: start position percent of display width. default 0. :: length percent of display width. default 100. %valign "top|center|bottom" vertical alignment of images with current text line %image "imagefile" %image "imagefile" [ [] ] "imagefile" :: name of image file :: number of colors, 0 means no reduction. :: height percentage against physical display or original size, 0 means the original height. :: width percentage against physical display or original size, 0 means the original width. :: 0 means zoomrate is against physial display others mean zoomrate is against original size :: auto resizing. specify the original screen size by WIDTHxHEIGHT. unless screensize is the same size of the physical display, zoomrate is calculated automagically. Note that if the image is a binary image, current foreground and background colors are applied to the drawn image. %newimage [options] "imagefile" Same as %image, but it is much easier to understand. options include: -colors numcolors -xysize piel pixel -zoom percentage -xyzoom x-percentage y-percentage Percentage is against the original image. "100" means the original image size, "50" means half the original image size. -scrzoom percentage -xscrzoom percentage -yscrzoom percentage -xyscrzoom x-percentage y-percentage Percentage is against the screen. "100" means screen width/height, "50" means half the screen width/height. -xscrzoom and -yscrzoom scales image with aspect ratio unchanged. TODO: supersede %image by %newimage? TODO: option for auto resize mode (fit image into the room left on the screen) %prefix "string" Place "string" at the beginning of line. "string" should be a set of blank characters (\040). The effect of %prefix command in %tab command is local to tab-indented line. %prefix specify prefix spacing by of the drawing area width. The effect of %prefix command in %tab command is local to tab-indented line. %icon %icon add an icon for itemizing lines. for example, %tab 1 size 5, icon box green 50 gives you an green box on the leftmost column of line. size is the percentage against the current character size. %bimage "imagefile" [ ] Specify the name of background image file :: auto resizing. specify the original screen size by WIDTHxHEIGHT. unless screensize is the same size of the physical display, zoomrate is calculated automagically. %default Unless nodefault directive is specified, the directives in the argument is prepended to the directives of the linenum'th line in every page. The syntax of is a comma separated directives. This directive has to be placed in the preamble. %tab Apply list of directives, if any of the lines start with tabnum tabs. This directive has to be placed in the preamble. %tab Apply list of directives, if any of the lines start with "&id". This directive has to be placed in the preamble. %page A new page starts %vgap Specify vertical gap size of each line :: percentage against current character size vertical gap = vertical font size * gapsize / 100 %hgap Specify horizontal gap size of each line :: percentage against current character size horizontal gap = vertical font size * gapsize / 100 NOTE: horizontal gap is calculated based on vertical size, because fonts are proportional (horizontal size varies by code point). %pause Stop drawing until forward key or button is pressed %mark Mark the current position on the screen, so that we can come back later by %again. NOTE: mark is local to a page. mark will be cleared at the page boundary. %again Move current position to the location marked by %mark. %system "command" Fork&exec the specified program. NOTE: the program will be invoked every time the page is redrawn. It sometimes annoy you. it needs some rework. Special translation for presentation-window-relative geometry: Argument that starts with "%" will be translated as if it was interpreted relative to presentation window. "xeyes -geometry %50x50+25+25" will be translated so that eyes appear on the center of the presentation window. The command has to be placed on a line alone. Do not use commas. Process will be killed when you leave the page. %system "command" Almost same as above. Process will be killed when you leave the specified . If you set to -1, the process will be killed when MagicPoint is terminated. (of course, you can terminate the child process alone by yourself) %filter "command" TEXT %endfilter Fork&exec the specified program, feed TEXT into that process from standard input. use the standard output from the process as presentation input. Do not forget to place %endfilter. The command has to be placed on a line alone. Do not use commas. %vfcap "filename" Specifies VFlib configuration filename. (allowed in ~/.mgprc, without "%" sign) %tfdir "dir" Specifies where to find TrueType font by default. (allowed in ~/.mgprc, without "%" sign) %deffont "fontname" Define a symbolic fontname, by using list-of-directives. The directive must appear in the preamble. For example, you may want to define a typewriter-like font as: %deffont "typewriter" xfont "courier", tfont "cour.ttf" By using the above definition, you can make your presentation file less dependent to the configuration of magicpoint binary. If the configuration allows the use of TrueType "cour.ttf" font, "tfont" directive will be effective. If there's no TrueType font available, or FreeType library is not compiled into the magicpoint binary you are currently using, "xfont" will be effective. "%font" cannot be used in "%deffont". this is for avoiding infinite loops. %font "fontname" Invoke the symbolic fontname defined by %deffont directive. %embed "filename" %endembed Embedded image support. uuencoded data fragment can be put between the directives. NOTE: this directive is not for human beings. use "mgpembed" command. %noop No operation %pcache :: enable or disable forward page cache 0 means disable forward page cache 1 means enable forward page cache :: cache mode 0 means caching is executed after 2seconds idle. 1 means caching is executed immediately. :: type of 'special effect' for the forward page cache (0-2) :: speed of 'special effect'. value 1 means the highest speed. %anim "filename" display animation file. (currently, only mng format is supported.) %charset "registry" Specify the encoding of the document. At this moment, the following charset are supported. iso8859-1 iso8859-2 iso8859-3 iso8859-4 %area [ ] Specify the drawing area within the window. All parameters are translated as relative value of the window. If offset is not specified, the drawing area will be put center. Note that all relative size specified in other directive after "%area" will be affected, i.e. it will be relative to the width/height of the drawing area instead of the window. %opaque :: transparency of the font. (0-100) Value 0 means that the font will be drawn with full tranparency. NOTE: To use this directive, you need to build mgp with Xft2.