Lessons

Lessons Chapter

    Lesson 1: Creating a Letterhead
    Lesson 2: Designing a Menu

 

Lessons  Chapter  url:PGSuser/Clessons
  created:0000-00-00 00:00:00   last updated:2006-06-12 16:54:27
  Copyright © 1985-2017 GrasshopperLLC. All Rights Reserved.

User Contributed Comments For Lessons
Tim Doty wrote...2006-05-17 05:34:16

Designing Borders
Page Stream allows the user to design custom borders which scale smoothly to whatever size is necessary. Although this process is not automated it is less difficult to make a border than it is to design and draw on.

SectionIntroduction

Currently the most convenient platform for designing borders is the Amiga. This is due to the command line interface available on that platform which allows the user to issue commands directly to PageStream. On other platforms the commands must be embedded in scripts.
Command Quick Reference

  • ADDBORDER border_name
  • ADDBORDERPATH border_name id width height
  • DELETEBORDER border_name
  • DELETEBORDERPATH border_name id
  • DUPLICATEBORDER border_name copy_border_name
  • SAVEBORDERS
  • SETBORDER border_name [CORNER <0–3|ALL> <UNUSED|<[id] [FLIP|DONTFLIP] [SCALE|DONTSCALE]>> MIDDLE <0–3|ALL> <UNUSED|<[id] [FLIP|DONTFLIP] [DONTSCALE]>> DASH <0–7|ALL> <UNUSED|<[id] [FLIP|DONTFLIP] [MANY|JUSTONE] [SCALE|DONTSCALE]>> CORNER2 <0–3|ALL> <UNUSED|<[id] [FLIP|DONTFLIP]>> MIDDLE2 <0–3|ALL> <UNUSED|<[id] [FLIP|DONTFLIP]>> DASH2 <0–7|ALL> <UNUSED|<[id] [FLIP|DONTFLIP]>> DESIGNSIZE size DEFAULTSIZE size NAME new_name]
  • SETBORDERPATH border_name id [WIDTH width] [HEIGHT height] [PATHWIDTH width] PATHHEIGHTheight]


SectionQuick & Dirty

The minimal steps to creating a border are as follows. Note that doing these minimal steps will most likely produce undesired resultsthey are only provided as a reference to the structure of making a border.
1. ADDBORDER “My Border”creates a new border with the name My Border.
2. Select the corner drawing and place it in the uppermost left corner of the page.
3. ADDBORDERPATH “My Border” 0 width heightadds the selected drawing as a path for the border as id 0.
4. Select the middle of a line drawing and place it in the uppermost left corner of the page, centered on the left edge of the page.
5. ADDBORDERPATH “My Border” 1 width heightadds the selected drawing as a path for the border as id 1.
6. Select the line drawing and place it in the uppermost left corner of the page, centered on the left edge of the page.
7. ADDBORDERPATH “My Border” 2 width heightadds the selected drawing as a path for the border with id 2.
8. SETBORDER “My Border” CORNER ALL 0 FLIP SCALEsets the path with id 0 as the corners of the border.
9. SETBORDER “My Border” MIDDLE ALL 1 FLIP SCALEsets the path with id 1 as the middle segment of the border on all sides.
10. SETBORDER “My Border” DASH ALL 2 FLIP MANY SCALEsets the path with id 2 as the line segment of the border on all sides, it will be replicated as many times as necessary to form the line.
11. SETBORDER “My Border” DESIGNSIZE sizeall paths will be scaled relative to this size.
12. SETBORDER “My Border” DEFAULTSIZE sizethe default size (frame width) of the border when drawn by a user.


SectionManual

The manual is divided into three sections. The first explains how borders are made, the second is a tutorial and the third details the commands.

Instructions
When PageStream saves out a border it really saves every loaded border into a single library file. To allow separation and management of borders all borders not intended to be part of the current package should be removed from the SoftLogik/Engines/Borders directory before PageStream is run. This will prevent their being loaded. (If a border is to be removed from a package leave that package in the directory and once PageStream has started issue the DELETEBORDER command.)

NoteWarning: do not attempt to use the border tool if all the borders have been removed and one has not been defined yet. Doing so will cause PageStream to crash.

There are three components to a border, the corner drawings, middle-of-line drawings and dash drawings. There are four corners, four middle drawings and eight dash drawings. Potentially each of these can be different, though that is not necessary.

The drawings which make up these components can be created before hand; doing so is strongly encouraged. The exact method is up to the user, but having a document in which the drawings are saved makes a convenient method of development. Design is beyond the scope of this document.

Once all drawings are complete issue the ADDBORDER command. Then select the drawings in turn and place them in the upper left corner of the page. Corner drawings should have their top and left sides aligned with the top and left edges of the page. Other drawings should have their top side aligned with the top edge of the page and be centered about the left edge of the page.

With the desired drawing properly aligned and only it selected issue the ADDBORDERPATH command. The id is arbitrary and just needs to be unique to that border. The width and height should be read off of the Edit Palette to ensure accuracy.

Different effects can be achieved by deviating from these directions. The drawing should be aligned according to these instructions relative to how the drawing is to be aligned in the final border. Likewise the height and width can be altered. However, designing the border such that alignment is achieved exactly as described above makes it easier to get the desired result.

Once a path has been added to the drawing its position can be defined. To do so issue the SETBORDER command. Here you specify the drawing, its placement in the border and options determining how it will be laid out. Positions are referenced by name and number (the keyword ALL can be substituted for a number to set the drawing for all positions having that name).

If FLIP is specified the drawing will be rotated to preserve its orientation relative to the side. For position number 0 this means no action is taken, drawings in position 1 are rotated clockwise 90 degrees, those in position 2 are rotated 180 degrees and those in position 3 are rotated counterclockwise 90 degrees. To prevent this behavior specify DONTFLIP.

If SCALE is specified the drawing will be scaled when the border is resized. To prevent this behavior specify DONTSCALE.

Dash positions have one additional option. If MANY is specified then as many of the drawings as necessary are used. The exact number will depend on the size of the border relative to the other components. To force only one drawing to be used for the dash position specify JUSTONE instead.

The Dash positions 4 through 7 are used to specify alternative drawings for the (relative) right of the Middle position. If no Middle drawing is specified then the (relative) left Dash will be used for the entire side.
There is a second set of positions for two-tone designs; Corner2, Middle2 and Dash2. Each of these has the FLIP | DONTFLIP option.

If a mistake is made in adding a path to the border the path in question can be removed by issuing the DELETEBORDERPATH command.

Once all drawings have been added and positions that need to be defined have been there are two commands to issue, DESIGNSIZE and DEFAULTSIZE.

DESIGNSIZE simply specifies how wide the border frame should be, relative to the drawings used. This can be used to add padding around the border.

DEFAULTSIZE specifies what width the border frame will be at when the user draws it.

It is a good idea to use the border to make sure it looks like expected. Once satisfied with its appearance issue the SAVEBORDERS command.


SectionTutorials

The first two tutorials were written by Deron Kazmaier originally published in DTPWorld, issues 4 and 6.
SectionCreating Your First Border

The first thing to do is to remove all border packages. If PageStream is running close it. Create the directory /SoftLogik/Engines/Borders/Uninstalled and move all files in /SoftLogik/Engines/Borders into it. Once that is done start PageStream and show the Script Palette if it is hidden.

Create a new script called “ Border Command”the leading space will make it be sorted to the top of the list. For the script type EXTENSION ADDBORDER “Simple Boxes”. Save it and run it by double-clicking on its name in the Script Palette.
Now create a new document. In the document window draw a 1" square with the box tool. Switch to the Object Tool and in the Edit Palette set the X and Y coordinates to 0. Then shift-click on the “ Border Command” script in the Script Palette and change the command to EXTENSION ADDBORDERPATH “Simple Boxes” 0 1.5in 1.5in. Double-click on the script to run it. The first number is the identifier for the path by which you will reference it later. It is specific to the border we just added it to. The second two numbers are the height and width for the path: in this case we are instructing it to give an extra half-inch of space on the sides adjoining dash elements.

Edit the script again, this time changing the command to EXTENSION SETBORDER “Simple Boxes” CORNER ALL 0 DONTFLIP DONTSCALE, and run it. This command instructs PageStream to use the path 0 we just defined for all corner elements of the border. The DONTFLIP and DONTSCALE prevent the path from being rotated to match the orientation of the side (which in this case would simply be a waste of effort) or from being scaled if the user resizes the border.

Use the Edit Palette again to re-align the box. This time set the X,Y coordinates to -0.5,0. Then edit the script, changing the command to EXTENSION ADDBORDERPATH “Simple Boxes” 1 2.0in 1.0in, and run it. This adds the box again, but this time with an alignment for use as a middle or dash border element. By setting the width to double the actual width of the box we are specifying an extra half-inch of space on either side of the dash. Thus dashes next to each other will have the width of one box between each of the boxes.

Edit the script, this time changing the command to EXTENSION SETBORDER “Simple Boxes” DASH ALL 1 DONTFLIP MANY DONTSCALE, and run it. This sets the path we just added as the line segment “dash” for all sides. The MANY keyword instructs PageStream to use as many of these dashes as necessary to fill the side. The DONTSCALE keyword prevents the dash element from being stretched if the user resizes the border. Any extra space is simply divided between the dashes as padding.

There are two more border parameters to set. Edit the script, change the command to EXTENSION SETBORDER “Simple Boxes” DESIGNSIZE 1in, and run it. This tells PageStream that elements were all designed with a border frame-width of one inch. Edit the script, change the command to EXTENSION SETBORDER “Simple Boxes” DEFAULTSIZE 0.2in, and run it. This tells PageStream that when a user draws with this border the default frame-width is 0.2 inches.

Finally, edit the script and change the command to EXTENSION SAVEBORDERS. Running the script again causes the PageStream to create a file named SoftLogik/Engines/borders.library which has this border in it. Close PageStream, rename the file to SimpleBoxes and move it to the Borders folder. You may want to restore the old borders from the Uninstalled directory as well. Run PageStream again and the Simple Boxes border is available.

Adding a Middle Element
Remove all borders except Simple Boxes and start PageStream. Unhide the Script Palette if necessary and edit the “ Border Command” script (you did save it from the first tutorial, right? If not just create it again), changing the command to EXTENSION SETBORDER “Simple Boxes” MIDDLE ALL 1 DONTFLIP DONTSCALE. This sets the path we aligned for the dash for use as a middle element as well. With the middle element set there will always be a box centered on the middle of each side.

To keep this change edit the script changing the command to EXENSION SAVEBORDERS and run it. Make sure to rename the SoftLogik/Engines/borders.library file and move to the Borders directory.


SectionYour Second Border

You should have the mechanics of editing the script and running it down pat by now so they won’t be mentioned again, just the commands that need to be used.

Create a new document and execute EXTENSION ADDBORDER “Corners”. Draw a 1" square with the box tool. Use the Edit Palette to set its X,Y coordinates to 0,0. Draw another square, this time one-quarter omcj, and set its X,Y coordinates to 0.5,0.5. Select both objects with the Object Tool and use Merge Paths from the menu. Then execute EXTENSION ADDBORDERPATH “Corners” 0 1in 1in. Draw a rectangle one inch wide and one-quarter inch tall. Set its X,Y coordinates to -0.5,0.5. Then execute EXTENSION ADDBORDERPATH “Corners” 1 1in 1in.

To set the first double-box as the corner element execute the command EXTENSION SETBORDER “Corners” CORNER ALL 0 FLIP DONTSCALE. The FLIP keyword tells PageStream to rotate the element for each corner. Specifying DONTSCALE prevents the dimensions from being stretched if the user resizes the border.

To set the second path as the dash element execute the command EXTENSION SETBORDER “Corners” DASH ALL 1 FLIP JUSTONE SCALE. The FLIP keyword tells pagestream to rotate the element for each side. Specifying JUSTONE means that there will only ever be one dash element on a side. The SCALE keyword means that it will be resized as necessary to reach from corner to corner.

Finally, execute the following commands:


  • EXTENSION SETBORDER “Corners” DESIGNSIZE 1in
  • EXTENSION SETBORDER “Corners” DEFAULTSIZE 0.2in
  • EXTENSION SAVEBORDERS

Duplicating Borders
Remove all border packages except for the one containing Corners, start PageStream and execute the following commands:


  • EXTENSION DUPLICATEBORDER “Corners” “Crosspaths”
  • EXTENSION SETBORDER “Crosspaths” CORNER ALL UNUSED
  • EXTENSION SAVEBORDERS

This would create a single package that contains both Corners and Crosspaths. Executing EXTENSION DELETEBORDER “Corners” before saving the borders keeps Crosspaths in its own package. The Corners border will still be available in its original package.

SectionCreating Nigg

Remove all borders and start PageStream. Load the file Nigg.pgs. Ignore the font substitution requestor, the only font in the document is the specified default font. There is no text. Add the border, ADDBORDER "Nigg".

The three pieces, top, middle and bottom, of the pattern are in the middle of the page with some colored guides that were used to determine the proper cut lines between them.

Select the top piece, move it to coordinates 0,0 and add it as path 0. Select the middle piece, move it to coordinates -.33,0 and add it as path 1. Select the bottom piece, move it to coordinates 0,0 and add it as path 2.

Because Nigg only offers borders on the left and right the top and botttom pieces are the top and bottom corners. There are only two dashes defined, one each for the left and right sides. Add the paths to the border with the following commands.


  • SETBORDER "Nigg" CORNER 0 0 DONTFLIP DONTSCALE
  • SETBORDER "Nigg" CORNER 1 0 DONTFLIP DONTSCALE
  • SETBORDER "Nigg" CORNER 2 2 DONTFLIP DONTSCALE
  • SETBORDER "Nigg" CORNER 3 2 DONTFLIP DONTSCALE
  • SETBORDER "Nigg" DASH 1 1 DONTFLIP MANY SCALE
  • SETBORDER "Nigg" DASH 3 1 DONTFLIP MANY SCALE

Now specify the designsize and defaultsize for the border. Test the border out and see how there are gaps between each piece. To get rid of them use the following command:
Code:
SETBORDERPATH "Nigg" 1 WIDTH .59

Try the border again and see how it is seamless.


SectionCommand Reference

The commands are all part of the EXTENSION set. This means that they must be preceded with that keyword. For example, EXTENSION SAVEBORDERS.
AddBorder
ADDBORDER border_name
AddBorderPath
ADDBORDERPATH border_name id width height
DeleteBorder
DELETEBORDER border_name
This command deletes the border with the specified name.
DeleteBorderPath
DELETEBORDERPATH border_name id
This command deletes the specified path from the specfied border.
DuplicateBorder
DUPLICATEBORDER border_name copy_border_name
This command copies the specified border and names the copy as indicated.
SaveBorders
SAVEBORDERS
This command saves the current border set to SoftLogik/Engines/border.library
SetBorder
SETBORDER border_name
[CORNER <0–3|ALL> <UNUSED | <[id] [FLIP|DONTFLIP] [SCALE|DONTSCALE]>>
MIDDLE <0–3|ALL> <UNUSED | <[id] [FLIP|DONTFLIP] [DONTSCALE]>>
DASH <0–7|ALL> <UNUSED | <[id] [FLIP|DONTFLIP] [MANY|JUSTONE] [SCALE|DONTSCALE]>>
CORNER2 <0–3|ALL> <UNUSED | <[id] [FLIP|DONTFLIP]>>
MIDDLE2 <0–3|ALL> <UNUSED | <[id] [FLIP|DONTFLIP]>>
DASH2 <0–7|ALL> <UNUSED | <[id] [FLIP|DONTFLIP]>>
DESIGNSIZE coord DEFAULTSIZE coord NAME name]
This command is the ginsu knife of border commands and has more options than can be counted. Well, nine anyway.
Corner: specifies a path already added to the border to use as a corner for the indicated positions. Valid positions are from 0 to 3 or the keyword ALL. If there is to be no path for this position specify the keyword UNUSED instead of a path identifier.
Middle: specifies a path already added to the border to use as a middle-of-line for the indicated positions. Valid positions are from 0 to 3 or the keyword ALL. If there is to be no path for this position specify the keyword UNUSED instead of a path identifier.
Dash: specifies a path already added to the border to use for the indicated line segment. Valid positions are from 0 to 7 or the keyword ALL.
Corner2: specifies a path already added to the border to use as a second-tone corner for the indicated positions.
Dash2: specifies a path already added to the border to use as a second-tone dash for the indicated positions.
Middle2: specifies a path already added to the border to use as a second-tone middle for the inidicated positions.
DefaultSize: specifies the border size (width of the border’s frame) to be used when this border is initially selected. The user alters this in the Edit Palette.
DesignSize: specifies the border size that the drawings were designed with. This is used to scale the drawings.
Name: sets the name of the border to that specified.
SetBorderPath
SETBORDERPATH border_name id [WIDTH width] [HEIGHT height] [PATHWIDTH width] [PATHHEIGHT height]
This command is used to alter a drawing that has already been added to the specified border. The width and height parameters define the size of the drawing with respect to the border. The path_width andpath_height parameters redefine the size of the drawing.
For example, to make a non-square dash work with a vertical border created with DONTFLIP the WIDTH parameter must be specified as the drawing’s height.

User Contributed Comments For Lessons