Changes by Gunnar Ritter, Freiburg i. Br., Germany, August 2005.

Derived from Plan 9 v4 /sys/src/cmd/postscript/mpictures/pictures.sr

Copyright (C) 2003, Lucent Technologies Inc. and others.
All Rights Reserved.

Distributed under the terms of the Lucent Public License Version 1.02.

Sccsid @(#)pictures 1.3 (gritter) 1/2/06
. \" $1=file(page) $2=height,width,yoff,xoff $3=flags . \" Height, width, xoff, and yoff are for the frame, flags is for the . \" picture. Default dimensions are inches. \\X'PI:\\n(.o:\\n(.i:\\n(.l:\\n(.t:\\$1:\\$2:\\$3:'\\c .. .nr FT 0 . \" . \" $1=file(page) $2=height $3=width $4=position $5=offset $6=flags $7=label . \" . \" Height, width, position, and offset are for the frame, flags is for . \" the picture. The postion flag should be l, c, r, or "". Omitting the . \" position argument is also allowed for compatibility with the original . \" version of the macro. In that case offset is taken relative to your . \" left margin. . \" Need these when we switch environments. .nr Ov \\n(.v .nr Oi \\n(.i .nr Ol \\n(.l . \" Remember the arguments - sometimes as both a string and number register. . \" Accept a few unadvertised position flags. . \" A null with more than three arguments means l. . \" Default frame dimensions if missing, zero, or null. . \" Figure out the offset that will be used the rest of the way. . \" If we haven't recognized the position flag assume it wasn't given and . \" treat argument four as an offset from the left. . \" Set increments for line length and indent. .nr Ii \\n($3u+\\n($4u+.1i .nr Il \\n(.lu-\\n(.iu-\\n($4u+.1i . \" Set the frame type to one of: . \" 0 - frame is as wide as a line of text - skip over it. . \" 1 - fits in left or right margins . \" 2 - fill with text on the right . \" 3 - on the left . \" 4 - or on both sides of the frame . \" 5 - only set in EP if FT was 4 and now filling on the right. . \" Assume the frame is as wide as a line of text, then check dimensions . \" to see what's really true. The order of these tests is important! .nr FT 0 . \" Ask for some vertical space - labeled pictures need a little extra, . \" margin pictures a little less. . \" Save our place, draw the picture, label it, and return. Need precise . \" control of when \X'...' is put out - thus the new environment.

Oh .ev 1 .vs \\n(Ovu .vs .ev .lt \\n($3u .tl \(ts\(ts\\h'\\n($4u+\\n(.iu'\\v'\\n($2u+1.5v'\\*($6\\v'-\\n($2u-1.5v'\\h'-\\n($4u-\\n(.iu'\(ts\(ts .lt 'sp |\\n(Ohu . \" Figure out what to do with the text that follows. . \" Clean things up. .rr $2 .rr $3 .rr $4 .rr $5 .rr Oh .rr Oi .rr Ol .rr Ov .. . \" on its own to mark the end of a picture. .nr Ot 0 . ev 1 . eo . br . di . nf . in 0 . BB . in . fi . ec . ev . rm BB\} . nr FT 2 ' sp |\\n(Nhu+1v\} . mk Nh . nr Nh -1v . nr FT 5 ' sp -\\n(dnu+1v ' in +\\n(Iiu . ll +\\n(Ilu . di BB . dt \\n(dnu-2v+1u EP\} .rr Ot . rr Nh . rr Ii . rr Il\} ..