6.4.6. POSTSCRIPT FORMAT (OUTPUT FROM LATTICE/CLUSTER SESSION)

next, previous Section / Table of Contents / Index NOTE that printing BALSAC PostScript files does NOT require a detailed understanding of this file format Files of this format are produced by BALSAC to be printed on PostScript laser printers or typesetting devices yielding high quality graphics prints. With the gray scale PostScript format colors and shading are simulated by gray levels using fixed dithering, see Sec. 5.4. Color PostScript uses appropriate RGB definitions, see Sec. 5.4, to reproduce colors. However, most b/w PostScript printers will convert color definitions to gray scales. The complete (encapsulated) PostScript file consists of a prologue %!PS-Adobe-3.0 %%Creator: BALSAC 2.16 (C) Copyright by K. Hermann %%BoundingBox: 20 20 570 770 %%EndComments containing an internal creator title and a definition of the clipping area on the page which sets the lower left point at (x,y) = (20, 20) and the upper right point at (x,y) = (570, 770) in units of 1/72 of an inch. This is followed by a number of (copyright protected) PostScript macros used to define color tones and to produce elementary drawing objects to be discussed below. Then the plot is built by subsequent calls to the appropriate macros. The file finishes with the PostScript statements /#copies 1 def showpage %%EndDocument: setting the number of copies of the present plot (1). For details concerning the PostScript programming language consult the appropriate literature. It is, however, possible to make simple changes to the plot output by editing the output file with an ASCII text editor. This will be discussed in detail in Sec. 6.4.6.1 The definitions of the (copyright protected) elementary drawing macros used in BALSAC PostScript output files are given in the following in order to improve the readability of respective files and allow quick editing. All drawing macros refer to color PostScript (Level 1) but are accepted by gray scale PostScript devices where RGB colors are converted to gray values s according to (r,g,b) --> (s,s,s) with s = 0.30*r + 0.59*g + 0.11*b . Note that all lengths and coordinates are defined in units of 1/72 of an inch and RGB color definitions (nR, nG, nB) refer to the unit cube [0, 1] x [0, 1] x [0, 1]. In the following we list all PostScript macros available with BALSAC together with a short description of their use and input parameters. Note that all PostScript names in the following are case sensitive. Coldef : defines a set of nosh color tones where (nR, nG, nB) is the basic color, qbot (qtop) denotes the bottom (top) tone, and qgam the gamma factor, see Sec. 5.4. Calling format is nR nG nB qbot qtop qgam Coldef . Lite : defines the incident light direction used for ball shading, see Sec. 5.4. Calling format is ey ez phi Lite where ey = sin(theta), ez = cos(theta), phi define the light direction with respect to the screen normal with phi = 0 pointing upwards. Boxd : defines a rectangular box given by the framing polygon (x1,y1) -> (x2,y1) -> (x2,y2) -> (x1,y2) -> (x1,y1). Calling format is x1 y1 x2 y2 Boxd Adding "0 setgray stroke" after this call draws a black rectangle while adding "r g b setrgbcolor fill" creates an (r,g,b) color filled rectangle. Adding "clip" clips a rectangular area allowing you to draw only inside. Shdbox : defines a rectangular box given by the framing polygon (x1,y1) -> (x2,y1) -> (x2,y2) -> (x1,y2) -> (x1,y1) and fills the box with a given color sequence (ncol colors) defined by the RGB value (nR, nG, nB) and boundaries (qbot, qtop) along given direction defined ny angle ang. Calling format is x1 y1 x2 y2 nR nG nB qbot qtop ang ncol mode Shdbox The color sequence is based on a linear path in the RGB cube (0, 0, 0) -> (nR, nG, nB) -> (1, 1, 1) where for mode = 0 the color range between qbot * (nR, nG, nB) and (nR, nG, nB) + qtop * (1-nR, 1-nG, 1-nB) is covered by an equidistant mesh of ncol colors. mode = 1 the color range between qbot * (nR, nG, nB) and qtop * (nR, nG, nB) is covered by an equidistant mesh of ncol colors. mode = 2 the color range between qbot * (1-nR, 1-nG, 1-nB) and qtop * (1-nR, 1-nG, 1-nB) is covered by an equidistant mesh of ncol colors. The angle ang defines the shading direction where ang = 0 shades from dark to light along the x axis while ang > 0 rotates the shading direction anti-clockwise. This procedure is very useful to create shaded background. CLine : draws a line of width wd and color (nR, nG, nB) between coordinates (x1, y1) and (x2, y2). Calling format is x1 y1 x2 y2 nR nG nB wd CLine . Note that macros CLine, COLine, CArrow, and CArro2 use the same input parameter sequences. Therefore, changing the line type requires only to change the respective macro name. COLine : does the same as CLine except that the color line is outlined in white to emphasize its visibility. Calling format is x1 y1 x2 y2 nR nG nB wd COLine . Note that macros CLine, COLine, CArrow, and CArro2 use the same input parameter sequences. Therefore, changing the line type requires only to change the respective macro name. CHLine : draws a line of width wd and color (nR, nG, nB) between coordinates (x1, y1) and (x2, y2). The line is finished at both ends symmetrically by a perpendicular line of length 2*ls and width wds (forming an "H" altogether and used for distance labels). Calling format is x1 y1 x2 y2 nR nG nB wd ls wds CHLine . Note that macro CHLine is, in its parameter definition different from that of CLine, COLine, CArrow, and CArro2 only by the (additional) two parameters at the end. CDLine : draws a ("V" shaped) pair of lines with common origin of width wd and color (nR, nG, nB). The origin is given by coordinates (x1, y1) and the lines point to (x2, y2) and (x3, y3). Calling format is x1 y1 x2 y2 x3 y3 nR nG nB wd CDLine . For positive values of wd the double line is outlined in white to emphasize its visibility. For negative values of wd a double line of width -wd is drawn without outlining. Note that macros CDLine and CDArrow use the same input parameter sequences. Therefore, changing between lines and arrows requires only to change the respective macro name. CArrow : draws an arrow line of width wd and color (nR, nG, nB) between coordinates (x1, y1) and (x2, y2). The arrow head is at (x2, y2). Calling format x1 y1 x2 y2 nR nG nB wd CArrow . For positive values of wd the arrow is outlined in white to emphasize its visibility. For negative values of wd an arrow of width -wd is drawn without outlining. Note that macros CLine, COLine, CArrow, and CArro2 use the same input parameter sequences. Therefore, changing the line type requires only to change the respective macro name. CArro2 : draws a double-headed arrow line (arrow heads at both ends) of width wd and color (nR, nG, nB) between coordinates (x1, y1) and (x2, y2). The arrow head is at (x2, y2). Calling format x1 y1 x2 y2 nR nG nB wd CArro2 . For positive values of wd the arrow is outlined in white to emphasize its visibility. For negative values of wd an arrow of width -wd is drawn without outlining. Note that macros CLine, COLine, CArrow, and CArro2 use the same input parameter sequences. Therefore, changing the line type requires only to change the respective macro name. CDArrow: draws a ("V" shaped) pair of arrows with common origin of width wd and color (nR, nG, nB). The origin is given by coordinates (x1, y1) and the arrows point to (x2, y2) and (x3, y3). Calling format is x1 y1 x2 y2 x3 y3 nR nG nB wd CDArrow . For positive values of wd the arrow pair is outlined in white to emphasize its visibility. For negative values of wd an arrow pair of width -wd is drawn without outlining. This macro can be used to insert additional basis vectors. Note that macros CDLine and CDArrow use the same input parameter sequences. Therefore, changing between lines and arrows requires only to change the respective macro name. CBond : draws a (perspective) stick of finite thickness between coordinates (x1, y1) and (x2, y2). The stick radii are rad1 at (x1, y1) and rad2 at (x2, y2) and qq is a perspective factor (qq = |cos(beta)| where beta defines the angle between the stick direction and the viewing plane normal vector). The stick will be painted with color (nR, nG, nB) and outlined with black color. Calling format is x1 y1 x2 y2 rad1 rad2 qq nR nG nB CBond . COcir : draws a circle about (x, y) using a radius rad and a line color (nR, nG, nB). Calling format is x y rad nR nG nB COcir . Note that macros COcir, CFcir, CScir, CBall do not use the same input parameter sequence. However, only trivial parameter modifications are required to convert between them. CFcir : draws a color filled circle about (x, y) using a radius rad and a filling color (nR, nG, nB). Calling format is x y rad nR nG nB CFcir . Note that macros COcir, CFcir, CScir, CBall do not use the same input parameter sequence. However, only trivial parameter modifications are required to convert between them. CScir : draws a hard-shaded color ball about (x, y) using a radius rad and two colors, (nR, nG, nB) (darker) and (mR, mG, mB) (lighter). Calling format is x y rad nR nG nB mR mG mB CScir . The incident light direction has to be set by macro Lite before any call to CScir can be made. Note that macros COcir, CFcir, CScir, CBall do not use the same input parameter sequence. However, only trivial parameter modifications are required to convert between them. CBall : draws a continuous shaded color ball about (x, y) using a radius rad and a set of color tones given by basic color index icol. Calling format is x y rad icol CBall . The color index icol ranges between 0 and nc-1 where nc denotes the number of different basic colors for which shading color tones are generated. (For each basic color one macro call Coldef generates color tones and the indices reflect the order of Coldef calls.) The shading and the incident light direction has to be set by macros Coldef and Lite before any call to CBall can be made. Note that macros COcir, CFcir, CScir, CBall do not use the same input parameter sequence. However, only trivial parameter modifications are required to convert between them. CHcir : draws a hatched color ball about (x, y) using a radius rad with colors (nR, nG, nB) for hatching lines (defined by wh, dh, phi, see below) on a gray background (value bgray). The outlining circle is drawn with a line width wout. This allows three formats. Calling format (a) for nh = 0 is x y rad bgray nR nG nB wout nh CHcir . No hatching is included. This version differs from macro CFcir in that the ball background allows gray values bgray only and the outline color (nR, nG, nB) and width wout can be set. Calling format (b) for nh = 1 is x y rad bgray mR mG mB wout wh dh phi1 nh CHcir . In addition to format (a) hatching inside the ball area is performed by a set of parallel lines of width wh and separation dh. The lines are rotated by an angle phi1. Calling format (c) for nh > 1 is x y rad bgray nR nG nB wout wh dh phi1 phi2 nh CHcir . In addition to format (b) hatching inside the ball area includes a second set of parallel lines of width wh and separation dh where the lines are rotated by an angle phi2 ("cross-hatching"). Note that macros COcir, CFcir, CScir, CBall do not use the same input parameter sequenceas CHcir. However, only trivial parameter modifications are required to convert between them. Mark : writes a label "text" starting at (x, y) using black as the text color with the rectangular text background painted white. Calling format is x y (text) Mark . Note that a calling sequence x y Marka (text) show Marke creates the same label without painting the text background white. Marka : moves to (x, y) and resets font and orientation to start writing a label. The background will not be changed. Calling format is x y Marka Marke : resets orientation to finish writing a label. Calling format is Marke Ssym : allows you to use greek and mathematical symbols available with the PostScript Symbol character set in any text or label. Calling format is (symbol text) Ssym where "symbol text" is any combination of characters given explicitly or in octal format (written as "\xxx" for each symbol). For a complete list consult the PostScript references. The following table lists only a few of the most important symbols. ----------------------------------------------------------------- symbol character ----------------------------------------------------------------- "A" - "Z" upper case greek alphabet with exceptions, e. g. "D" = Delta, "F" = Phi, "G" = Gamma, "P" = Pi, "J" = theta1 (curly), "Q" = Theta "Y" = Psi, "L" = Lambda, "S" = Sigma, "W" = Omega. "a" - "z" lower case greek alphabet with exceptions, e. g. "d" = delta, "f" = phi, "j" = phi1 (curly), "g" = gamma, "p" = pi, "l" = lambda, "s" = sigma, "y" = psi, "w" = omega. "\245" infinity symbol "\326" square root symbol "\261" plus/minus symbol "\136" perpendicular symbol "\345" summation symbol "\260" degree symbol ----------------------------------------------------------------- As an example the text "Pd(111)-(sqrt(3) x sqrt(3))R30deg-CO" would read (Pd\(111\)-\() show (\326) Ssym (3 x ) show (\326) Ssym (3\)R30) show (\260) Ssym (-CO) show Yes, it is difficult but it works! Note that single parentheses "(" or ")" have to be preceded by "\" to conserve PostScript integrity (PostScript uses parentheses as syntactic elements). Sub : allows you to use subscripts in any text or label. The subscripted text is shifted down by 30% of the font height and reduced to 83% in size. Calling format is (subscript text) Sub As an example the ethylene molecule formula (C2H4) would read (C) show (2) Sub (H) show (4) Sub Sup : allows you to use superscripts in any text or label. The superscripted text is shifted upwards by 45% of the font height and reduced to 83% in size. Calling format is (superscript text) Sup As an example the CO+ molecule ion formula would read (CO) show (+) Sup Subp : offers multi-level sub- and superscripting in any text or label. The sub/superscripted text is shifted down or up in levels where each level yields a 30% shift and 83% reduction with respect to the previous font definition. Calling format is (subsup text) levl Subp where levl denotes the scripting level: levl = 0 yields normal test, "(text) 0 Subp" is equivalent to "(text) show". levl = n > 0 yields nth level subscripts, "(text) 1 Subp" is equivalent to "(text) Sub". Levels n > 1 result in smaller fonts and further downwards shifts. levl = n < 0 yields nth level superscripts, "(text) -1 Subp" is equivalent to "(text) Sup". Levels n < -1 result in smaller fonts and further upwards shifts. Supsub : allows you to attach both superscript and subscript text to a word in any text or label. The superscripted (subscripted) text is shifted up (down) by 45% (30%) of the font height and reduced to 83% in size. Calling format is (superscript text) (subscript text) Supsub As an example the squared variable x1 would read (x) show (2) (1) Supsub Logo : moves to (x, y) and writes the BALSAC logo "BALSAC plot". Calling format is x y Logo The logo macro is added for copyright purposes and should be removed only if copyright protection of the respective PostScript file is guaranteed. ISOenc : defines an alternative font dictionary with ISOLatin1 encoding which can be used in addition to the existing dictionary. Calling format is /Myfont /Times-Roman ISOenc The alternative font allows the use of special characters available only with the ISOLatin1 encoding. For example \305 denotes the Angstrom character (A with circle on top). next, previous Section / Table of Contents / Index