Chapter 12

DESKTOP PUBLISHING

One of the latest personal computer crazes is desktop publishing, a process of using your computer to publish books, newsletters, magazines, and other documents printed for distribution to others. While WordPerfect is not a true desktop publishing program, version 5.1 (as well as 5.0) has features that help you create sophisticated. production-quality documents.

Macros find a comfortable home in desktop publishing, particularly if you are preparing a periodical or a regularly-issued newsletter. This chapter contains numerous examples of using WordPerfect as a desktop publishing tool:

 

HARDWARE REQUIREMENTS

Desktop publishing is a visual art that relies heavily on the computer's ability to reproduce on screen as nearly as nearly as possible how the finished page will look when printed. This visual fidelity is often referred to by its funny-sounding acronym: WYSIWYG -- short for "what-you-see-is-what-you-get." Unless your desktop publishing requirements are simple and straightforward, requiring nothing more than formatting same-size text into columns, you can use WordPerfect with just about any IBM PC hardware configuration.

But if you want to add graphics, or change font, sizes, and styles, you need a graphics display adapter and suitable monitor. WordPerfect and desktop publishing get along well when using one the following graphics adapters:

Because desktop publishing is graphics oriented, character printers, such as the time-honored daisywheel, are unsuitable for anything more than printing columns of standard text. Most dot matrix printers are capable of graphics, but their resolution is sufficiently poor that the results are unsatisfactory. Though they are costly, the printer of choice in the desktop publishing arena is the laser.

Laser printers produce very high resolution -- approaching typeset quality -- and they are able to freely mix text and graphics on the same page. WordPerfect works with most laser printers now out, including the Apple LaserWriter and the Hewlett-Packard LaserJet II (as well as all laser printers that are compatible with these two popular models). Laser printers sport either built-in (cartridge or permanent) or downloadable fonts. This allows you to freely experiment with the font, size, and style for your document. You can make each character smaller than an ant or as large as the entire page!

Many of the examples and macros in this chapter assume you are using a laser printer, specifically a PostScript-compatible laser such as the Apple LaserWriter, for your desktop publishing applications. Even if you don't own a laser printer, you can still view the results of your efforts using the Print View command (you must have a graphics-compatible display adapter and monitor). You will see, "more or less" exactly as it will appear when printed, the finished page complete with text and graphics. Prior to laying out the page, select the Apple LaserWriter printer driver using the Select option found in the Print key. Of course, if you haven't done so already, you'll need to install the LaserWriter (or other PostScript printer) driver on your WordPerfect disk.

 

COLUMN FORMATS

Desktop published documents are generally formatted into columns. WordPerfect allows you to set up to 24 columns per page, although the practical maximum for standard 8 1/2 by 11 inch paper is four columns. Any more and the page looks crowded and awkward. By using the Newspaper column format, text you enter into one column automatically flows to the next when you reach the bottom margin. And, when a page is full, WordPerfect creates a new page and begins filling it with columns.

If you plan on getting serious about desktop publishing, you'll want to record your favorite column settings as styles. Here are eight multiple column styles you can use for your own work. All are provided on the Applications Disk under the one file name of COLUMNS.STY. Each style differs in the number of columns, column width, and column spacing, and tab settings. All assume a standard 8 1/2 by 11 inch page. Feel free to adapt these styles any way you like.

 

DESKTOP PUBLISHING TEMPLATES

Magazines, newspaper, and newsletters that are published regularly throughout the year typically use the same format from issue to issue. One of the toughest jobs of desktop publishing is coming up with a clean, workable format. Once you have that format completed, it's a waste of effort to reconstruct it or redesign it for each issue. Templates allow you to store a "blank" of your publication so that you can use it for every new issue. You may also create "standing elements," pieces of text or artwork that are reused for each issue. A typical standing element is the banner or logo of a newsletter.

If your documents use different formats for some of the pages, you'll need to create several template documents for each format. Or, in the case of a newsletter or other publication where articles may span several pages, you'll want to define formats for specific pages in the document. In a four-page newsletter, for example, the format for the first page will be completely different than the format for the second page. Pages 2, 3, and 4 may share a commonalty, depending on your design.

The easiest way to prepare a template is to complete an issue of your newsletter or other publication, then strip out all the text. Leave only those elements that will stay from issue to issue, as well as any formats and styles. If necessary, add a short one or two line description of the type of text that goes into each empty slot. When you are ready to assemble the next issue, delete the remaining lines of text and write or paste in the new material.

The typical newsletter page consists of a graphic banner, with logo, at the top, and is divided into three newspaper style columns. The material above the two article headlines, with the exception of the lines and issue date, are actually contained in the header. The header is turned on for the first page only. The header as well as the footer) is one place to stuff standing elements that assemble into one unit. Another approach to quickly entering an assemblage of standing elements is to store them in a style. If necessary, update the style for each issue.

The page consists of two graphics boxes: one is defined as a text box and contains the "Contents" information. A 10 percent gray background is added to set the box off from the rest of the next (WordPerfect does this by default). The other box is an empty blank that can contain a graphic or a continuous-tone, screened photograph (added prior to printing the issue at the press). The contents box is a standing element, but rather than leave it on the page in the template document, it is included as a style. After the basic text for the page has been entered, the text box style is inserted at the appropriate spot in the bottom of the first column. The graphics box is handled the same way.

You have a choice of four types of graphics boxes -- figure, table text, and user-defined. WordPerfect allows you to modify the size and format of the box as you see fit. Each box type includes an Options menu where you can, among other things, set the border type and width, background shading, and horizontal spacing.

When defining text in a text box, WordPerfect allows you to rotate it in even 90 degree increments. You can use this feature to write a sideways logo.

Use the vertical and horizontal position options in the box definition window to set the placement on the page. If the box is smaller than the width of the column, you can instruct WordPerfect to wrap text around it.

 

DESKTOP PUBLISHING MACROS

The nature of desktop publishing, where every application is different and much of the work is original from issue to issue, reduces some of the effectiveness of macros. After all, macros are best used for repetitive work. But that doesn't mean you won't develop macros to help automate some of your desktop publishing tasks. Here are some examples.


Locking Graphics

WordPerfect allows you to lock down graphic elements (figures, tables, boxes, and lines) so that they are attached to the page. When you enter new text, it flows around these locked graphics. Refer to the WordPerfect manual on how to created locked graphics. If you're just starting out designing your newsletter, you may want to created locked graphics right before entering any text.

The LOCKGRAF.WPM macro, described below, lets you create any of the four types of graphics boxes (figure, text, user, and table). The macro asks the size of the graphic, and its absolute position on the page -- from the top edge and left edge of the page. At this point, the macro stops. You can now create the actual graphic -- retrieve a graphic into a figure, write text in a text box, etc.


LOCKGRAF.WPM (provided on the Applications Disk)

1.  {ON CANCEL}{GO}quit~~
    {CHAR}key~
    {^]}1 F{^\}igure  {^]}2 T{^\}able  
    {^]}3{^\} Te{^]}x{^\}t  {^]}4 U{^\}ser  
    {^]}5 Q{^\}uit  {^]}1{^\}{Left}~
    {CASE}{VARIABLE}key~~
      {Enter}~fig~
      1~fig~   F~fig~   f~fig~
      2~tab~   T~tab~   t~tab~
      3~text~  X~text~  X~text~
      4~user~  U~user~  u~user~
      5~quit~  Q~quit~  q~quit~
     ~{QUIT}
2.  {LABEL}fig~
    {Graphics}FC
    {GO}lock~
    {LABEL}tab~
    {Graphics}FC
    {GO}lock~
    {LABEL}text~
    {Graphics}BC
    {GO}lock~
    {LABEL}user~
    {Graphics}UC
    {GO}lock~
3.  {LABEL}lock~
    {TEXT}wide~Enter the width of the graphic  ~
    {TEXT}high~Enter the height of the graphic  ~
    {TEXT}vert~Enter the distance from top of page  ~
    {TEXT}horz~Enter the distance from left of page  ~
    TA{Enter}
    VS{VARIABLE}vert~{Enter}
    HS{VARIABLE}horz~{Enter}
    SB
    {VARIABLE}wide~{Enter}
    {VARIABLE}high~{Enter}
    {Exit}
    {QUIT}
4.  {LABEL}quit~
    {DISPLAY OFF}
    {WHILE}{SYSTEM}menu~!=65535~
    {Exit}
    {END WHILE}
    {QUIT}


Defining Graphics Boxes

WordPerfect insists you go through a rather elaborate chain of commands to create or edit graphics boxes. You can eliminate some keystrokes by assigning this duty to a macro. You should define a different macro for each type of box you create. This macro is provided on the Applications disk as DEFGRAPH.WPM.

Key Sequence What it Does
1. [Ctrl]-[F10] Starts macro definition.
2. defgraph
[Enter]
Names macro.
3. Define graphics box
[Enter]
Defines macro.
4. [Alt]-[F9] Chooses Graphics menu.
5. F C Selects Figure and Create options.
6. [Ctrl]-[F10] Ends macro definition.

Replace Step 5 with:

When the macro finishes execution, you are given a chance to assign further variables to the graphics box. Among your available choices are setting box type, vertical position, horizontal position, size, and wrap text feature. You may also set any of several formats from the Option selection.

If you regularly create elaborate graphics boxes, either store the formats in a style or include all the steps in a macro. Once the box is defined, the macro brings you back so that you may create or edit its contents.


Defining Lines

Some printers may not accept the IBM Extended graphics characters produced by WordPerfect's Line Draw feature, or the results may be less than acceptable (for example, when using Lie Draw with proportional PostScript fonts).

WordPerfect also provides a means to draw lines using the Graphics menu. In addition to assigning the length of the line, WordPerfect lets you set the horizontal position, width, and shading. The lines do no show unless you are examining the document with the Print View command.

Macros can be used to draw lines at any length and position, with a width and shading of your choice. The most basic graphic line draw macros draw a line from margin to margin using the preset options provided by WordPerfect. The two macros that follow are provided on the Applications Disk as DEFHLINE.WPM (define horizontal line) and DEFVLINE.WPM (define vertical line).


Horizontal Line

Key Sequence What it Does
1. [Ctrl]-[F10] Starts macro definition.
2. defhline
[Enter]
Names macro.
3. Define horizontal line
[Enter]
Defines macro.
4. [Alt]-[F9] Chooses Graphics menu.
5. L H Selects Line and Horizontal options.
6. [Ctrl]-[F10] Ends macro definition.


Vertical Line

Key Sequence What it Does
1. [Ctrl]-[F10] Starts macro definition.
2. defvline
[Enter]
Names macro.
3. Define vertical line
[Enter]
Defines macro.
4. [Alt]-[F9] Chooses Graphics menu.
5. L V . Selects Line and Vertical options
6. [Ctrl]-[F10] Ends macro definition.

When the macro finishes, you may now manually set the line variables or press [Enter] to accept the default settings. You need a more elaborate macro when you need to automate the variables of the line definition. If all the lines share the same formats, include those formats in the macro.


Viewing the Document

One of the more useful features of WordPerfect is the Print View command, where you can see a visual representation of the page as it will look on paper (you see only the basic text when using a display adapter that lacks graphics capability). Since you will probably switch to Print View often, it's worthy of a macro.


VIEW.WPM (provided on the Applications Disk)

{DISPLAY OFF}
{Print}
{DISPLAY ON}
V3

WordPerfect remembers the magnification you last used when viewing your document (full, facing pages, 100% or 200%). If you exit when the magnification setting is at 200%, that's what you get when you use the Print View command again. This macro automatically switches to Full view regardless of the magnification last used. To exit the View screen, press [F7].


Adding Vertical Column Rules

If you're creating multi-column pages, you may want to add vertical rules between the columns. WordPerfect provides a fairly simple means of doing this, but the following macro makes it completely automatic.


COLLINE.WPM (provided on the Applications Disk)

{DISPLAY OFF}
{Graphics}LVHB
{SYSTEM}column~{Enter}
{Enter}

To use the macro, start first by placing the cursor in one of the columns on the page. The macro automatically adds the line to the right of this column, no matter how many columns are in your document (this is done with the {SYSTEM} variable command). To place lines between each of three columns on the page, for example, use the macro twice: once at the left-most column, and once at the middle column.


Shading Text

If you have an Apple LaserWriter or similar PostScript printer, you can use WordPerfect to create shaded text. The technique uses the Color feature under the Font key. The printer interprets the color instructions as a shade. This macro varies the "red" color -- from 100 (white) to 0 (black). You can can set any gray shade between these two values.


SHADE.WPM (provided on the Applications Disk)

{TEXT}shade~Enter the amount of shading (0=black; 
100=white)  ~
{TEXT}text~Enter text  ~
{DISPLAY OFF}
{Font}CO{VARIABLE}shade~{Enter}{Enter}{Enter}{Enter}
{VARIABLE}text~
{Font}CK{Exit}
{DISPLAY ON}

You are first asked to enter the amount of shading you want. The lower the number, the darker the shade. A shade of 50 is 50 percent gray. Now enter the text. Press the [Enter] key and the macro formats the selected text in the shade you've selected. After printing the text in the document, the macro reverts to all black text.


Creating Reverse-Out Text

Another desktop publishing trick you can perform with WordPerfect (if you have a PostScript printer) is to create reversed text -- white text on a black background. You can use reverse-out text for accentuating headlines, or for producing eye-catching body copy.

Creating reverse-out text requires that you press a number of keys in a strict order. A macro makes the process of creating reverse-out text simple. The following macro, provided on the Applications Disk, can be used with any PostScript font. For best results, you should use the same font and font size for the reverse-out text as the surrounding text.


REVERSE.WPM (provided on the Applications Disk)

{TEXT}text~Enter the text for the box  ~
{DISPLAY OFF}{Graphics}UOO0{Enter}
0{Enter} 0{Enter}   0{Enter}  g100{Enter}{Enter}
{Graphics}U1TCVASA
E
{Font}CW{Enter}
{VARIABLE}text~
{Font}CK{Enter}{Exit}{Exit}

After starting the macro enter the text you want reversed. Experiment with leading and trailing blank spaces. These help to add extra black border space around the word. When you're done, press [Enter]. The macro completes all the steps necessary to create the reverse out text. Note that the text is actually a graphic box, formatted as a character. On the screen, the box will appear as a small square. You can preview the text with Print View, but the image may not accurately reflect the way the text will print on paper. You need to make a printout to see how true nature of the reversed text.

REMEMBER: This macro (as well as the SHADE.WPM macro described earlier, requires a PostScript-compatible printer, or some other printer capable of complex text manipulation. The macros will have no affect when printing with the Hewlett-Packard LaserJet.


Setting Gray Background for Text

Instead of setting a jet-black background for text, you set any background "color" you want. The SETGRAY.WPM macro described here lets you create black on gray text graphics boxes. Enter the text, and when you're done press the Exit key. As with text created with the REVERSE.WPM macro, the graphic box will appear as a small square in the screen. Use Print View to view the text, or print it out on your printer.

Use this macro with an Apple LaserWriter or similar PostScript printer. This macro will work with the Hewlett-Packard LaserJet, but the results aren't as good. When using the LaserJet, avoid grays darker than about 20-25 percent.


SETGRAY.WPM (provided on the Applications Disk)

{TEXT}gray~Enter shade of box background (0=black; 100=white)  ~
{DISPLAY OFF}
{Graphics}UOG
{VARIABLE}gray~{Enter}{Enter}
{Graphics}UC
TC VA SA E
{PAUSE KEY}{Exit}~{Exit}{Exit}

To use the macro, enter the gray scale (0 is black, 100 is white -- to use a 25 percent gray, enter 75). The macro will pop you into the User box graphics editing screen. Write the text, and press the Exit key ([F7]) when done.


Creating "Pull-Quotes"

Pull-quotes are convenient "text graphics" you can sprinkle whenever you need to add visual relief to your desktop published pages. Pull-quotes are merely short snippets of text drawn from the page. This macro makes it a simple task to create and format pull-quotes. Once the quote is created, you can position it on the page or within the column as you desire.


PULLQUOT.WPM (provided on the Applications Disk)

{DISPLAY OFF}
{Graphics}UOO
0{Enter}  0{Enter}  0{Enter}  0{Enter}
B{Down}{Down}TT
g10{Enter}{Enter}
{Graphics}U1TCVASA
E
{PAUSE KEY}{Exit}~{Exit}{Exit}

Start the macro and enter the text you want to use. Press Exit and the pull-quote text box will be created for you. You may need to size and position the box to suit the specific design of your page.


Making "Strip" Boxes

If you're adding half-tone photographs to your desktop published pages, you need to indicate where they will be "stripped in" on the camera ready copy. The STRIP.WPM macro shown here lets you easily create black boxes of any size and shape, and position them on the page. Once positioned, they are locked to the document. After printing, you can cover the boxes with the appropriate colored film for stripping in photographs.


STRIP.WPM (provided on the Applications Disk)

{Screen}2M
{PROMPT}Move cursor to upper left corner of box; press Enter when done~
{PAUSE}{Exit}
{TEXT}width~Enter the width of the box  ~
{TEXT}height~Enter the height of the box  ~
{Graphics}UOG100{Enter}{Enter}
{Graphics}UC   TC   SB
{VARIABLE}width~{Enter}
{VARIABLE}height~{Enter}
{Exit}

The macro uses the Line Draw screen to let you visually place the box on the page. Use the line and position indicators in the bottom right of the screen to position the cursor exactly. When you get the upper-left box corner coordinate set, press the Enter key. Enter the width and height of the box at the prompts. The macro takes care of the rest.

If you need to later move or resize the box, you can edit it just as you would any other User Box graphic. In the Graphics menu, choose a new size and page location.


Searching for Graphics

One of the pains of working with WordPerfect as a desktop publishing tool is editing existing graphics figures, tables, and boxes. Unless you remember the number of the graphic you want to edit, you need to turn Reveal Codes on, search for graphics codes, and display each graphic until you've found the one you want. WordPerfect provides a means to search for graphic codes, but it requires many keystrokes. And once the code is found, you must go through a series of additional keystrokes to display the graphic in the Graphics editor screen.

The SRCHGRAF.WPM (for search graph) macro does it all automatically. Start the macro and select the type of graphic you want to look for. The macro will find the next occurrence of that graphic type in the document, automatically opening it so you can see it in the Graphics editor window. If it's not the graphic you want, press Exit and start the macro again.


SRCHGRAF.WPM (provided on the Applications Disk)

1.  {CHAR}key~{^\}Search: 
    {^]}1 F{^\}igure  {^]}2 T{^\}able Box  
    {^]}3{^\} Text {^]}B{^\}ox  {^]}4 U{^\}ser Box  
    {^]}5 L{^\}ine  {^]}6 E{^\}quation  {^]}1{^\}{Left}~
    {CASE}{VARIABLE}key~~
      {Enter}~fig~
      1~fig~   F~fig~   f~fig~
      2~tab~   T~tab~   t~tab~
      3~text~  B~text~  b~text~
      4~user~  U~user~  u~user~
      5~line~  L~line~  l~line~
      6~eq~    E~eq~    e~eq~
      ~
    {QUIT}
2.  {LABEL}fig~
    {DISPLAY OFF}
    {Search}{Graphics}FF{Search}
    {Left}{Graphics}FE
    {DISPLAY ON}
    {Enter}
    {QUIT}

    {LABEL}tab~
    {DISPLAY OFF}
    {Search}{Graphics}TT{Search}
    {Left}{Graphics}TE
    {DISPLAY ON}
    {Enter}
    {QUIT}

    {LABEL}text~
    {DISPLAY OFF}
    {Search}{Graphics}BT{Search}
    {Left}{Graphics}BE
    {DISPLAY ON}
    {Enter}
    {QUIT}
 
    {LABEL}user~
    {DISPLAY OFF}
    {Search}{Graphics}UU{Search}
    {Left}{Graphics}UE
    {DISPLAY ON}
    {Enter}
    {QUIT}
    {LABEL}line~
    {CHAR}key~{^]}1 V{^\}ertical or {^]}2 
    H{^\}orizontal  {^]}V{^\}{Left}~
    {CASE}{VARIABLE}key~~
       {Enter}~vert~
       1~vert~  V~vert~  v~vert~
       2~horz~  H~horz~  h~horz~
       ~
    {QUIT}

    {LABEL}vert~
    {DISPLAY OFF}
    {Search}{Graphics}LV{Search}
    {Left}{Graphics}L
    {DISPLAY ON}E
    {QUIT}

    {LABEL}horz~
    {DISPLAY OFF}
    {Search}{Graphics}LH{Search}
    {Left}{Graphics}L
    {DISPLAY ON}O
    {QUIT}

    {LABEL}eq~
    {DISPLAY OFF}
    {Search}{Graphics}EE{Search}
    {Left}{Graphics}EE
    {DISPLAY ON}
    {Enter}
    {QUIT}

 

Quick Edit of Graphics

A "short-form" of the SRCHGRAF.WPM macro above is GRAPH.WPM, shown here. This macro merely opens whatever graphic is currently under the cursor. If the cursor is not resting on a graphic code, the macro displays an error message and quits. You can use GRAPH.WPM to edit any graphic type, including equations and lines.


GRAPH.WPM (provided on the Applications Disk)

{CASE}{SYSTEM}right~~
55808~fig~
55809~tab~
55810~txt~
55811~use~
55812~equ~
55813~hln~
55814~vln~
~
{GO}no_code~

{LABEL}fig~
{Graphics}FE{Enter}E
{QUIT}
{LABEL}tab~
{Graphics}TE{Enter}E
{QUIT}
{LABEL}txt~
{Graphics}BE{Enter}E
{QUIT}
{LABEL}use~
{Graphics}UE{Enter}E
{QUIT}
{LABEL}equ~
{Graphics}EE{Enter}E
{QUIT}
{LABEL}vln~
{Graphics}LE
{QUIT}
{LABEL}hln~
{Graphics}LO
{QUIT}

{LABEL}no_code~
{BELL}
{CHAR}key~Sorry, the cursor is not resting on a graphics code.  Press
a key  ~


Font Selection

WordPerfect has an awkward method of selecting a new font that requires you to press a series of keys, then search for the font you want from among a list (the more capable the printer, such as the Apple LaserWriter, the longer the list). You are likely to use only one or two fonts, so the rest just get in the way. Macros can be used to quickly select the most common fonts you use. When you want to select a new font, just run another macro.

When using a LaserWriter or other PostScript-compatible printer, you have full control over the point size of the font. The macros shown below also provides a means to select a point size for the font selected. Only a few representative macros are detailed here; compile your own macros to accommodate your needs and printer capability.


Palatino 12 Point

{DISPLAY OFF}
{Font}FnPalatino{Enter}
S12{Enter}
{DISPLAY ON}


Palatino 18 Point

{DISPLAY OFF}
{Font}FnPalatino{Enter}
S18{Enter}
{DISPLAY ON} 


New Century Schoolbook 24 Point

{DISPLAY OFF}
{Font}FnNew Century Schoolbook{Enter}
S24{Enter}
{DISPLAY ON}


Helvetica Bold 48 Point

{DISPLAY OFF}
{Font}FnHelvetica Bold{Enter}
S48{Enter}
{DISPLAY ON}

Suppose you regularly use just one or two fonts, but want to be able to set any font size you desire. This next macro is designed to display the possible choices for the Helvetica font. You pick the desired typeface from the list, then enter a point size. Although the macro takes a while to write, you can copy it and use it as the basis to make chooser macros for other fonts.


HELV.WPM (provided on the Applications Disk)

1.  {ON NOT FOUND}{GO}not_found~~
    {CHAR}1~{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}{Up}
    Select a font:                  {Enter}
    1  Helvetica                    {Enter}
    2  Helvetica Bold               {Enter}
    3  Helvetica Bold Oblique       {Enter}
    4  Helvetica Double High        {Enter}
    5  Helvetica Narrow             {Enter}
    6  Helvetica Narrow Bold        {Enter}
    7  Helvetica Narrow Bold Oblique{Enter}
    8  Helvetica Narrow Oblique     {Enter}
    9  Helvetica Oblique            ~
    {DISPLAY OFF}{DISPLAY ON}
2.  {TEXT}0~Enter a font size  ~
    {DISPLAY OFF}
3.  {CASE}{VAR 1}~
      1~Hel~
      2~Bold~
      3~Bold oblique~
      4~Double high~
      5~Narrow~
      6~Narrow bold~
      7~Narrow bold oblique~
      8~Narrow oblique~
      9~Oblique~
      ~
    {QUIT}
4.  {LABEL}Hel~
    {Font}FnHelvetica{Enter}S{VAR 0}{Enter}
    {QUIT}

    {LABEL}Bold~
    {Font}FnHelvetica Bold{Enter}S{VAR 0}{Enter}
    {QUIT}

    {LABEL}Bold oblique~
    {Font}FnHelvetica Bold Oblique{Enter}S{VAR 0}
    {Enter}{QUIT}

    {LABEL}Double high~
    {Font}FnHelvetica Double High{Enter}S{VAR 0}
    {Enter}{QUIT}

    {LABEL}Narrow~
    {Font}FnHelvetica Narrow{Enter}S{VAR 0}
    {Enter}{QUIT}

    {LABEL}Narrow bold~
    {Font}FnHelvetica Narrow Bold{Enter}S{VAR 0}
    {Enter}{QUIT}

    {LABEL}Narrow bold oblique~
    {Font}FnHelvetica Narrow Bold Oblique{Enter}
    S{VAR 0}{Enter}{QUIT}

    {LABEL}Narrow oblique~
    {Font}FnHelvetica Narrow Oblique{Enter}S
    {VAR 0}{Enter}{QUIT}

    {LABEL}Oblique~
    {Font}FnHelvetica Oblique{Enter}S{VAR 0}
    {Enter}{QUIT}

5.  {LABEL}not_found~
    {Cancel}{Exit}
    {PROMPT}Font not found  ~
    {WAIT}15~

 

All-in-one PostScript Font Chooser

You may want to use more than just the Helvetica fonts in your document. The PSFONT.WPM macro, provided on the Applications Disk, lets you select among all of the regular PostScript fonts, as used in the Apple LaserWriter Plus (and equivalent printers). The PSFONT.WPM macro is quite extensive, but it uses many repetitive steps. We'll provide just bits and pieces to explain how it works.


PSFONT.WPM (provided on the Applications Disk)

(portions only shown)

{LABEL}font 1~
{ASSIGN}8~a~
{PROMPT}{Home}
{^R}{^]}A{^\}vant Garde{^S}  {^]}B{^\}ookman  
{^]}C{^\}ourier  {^]}H{^\}elvetica  {^]}P{^\}alatino  
{^]}S{^\}choolbook  {^]}T{^\}imes  ~
{GO}input~

The PSFONT.WPM macro uses a novel "moving-bar" menu that appears at the top of the screen. The menu is in seven parts, with each part assigned a separate label. This is the label for the Avant Garde font. The {PROMPT} message is formatted so that the Avant Garde font is shown highlighted. The other formatting is used to indicate mnemonic keys that can also be used to choose a font. The other six fonts have their own label; the {PROMPT} message is changed to highlight the individual font for that label.

{LABEL}input~
{ASSIGN}2~~

{LABEL}loop~
{LOOK}2~
{IF}"{VAR 2}"="{Left}"~
   {ASSIGN}1~{VAR 1}-1~
   {GO}font {VAR 1}~
{ELSE}
{IF}"{VAR 2}"="{Right}"~
   {ASSIGN}1~{VAR 1}+1~
   {GO}font {VAR 1}~
{ELSE}
{IF}"{VAR 2}"="{Enter}"~
   {GO}{VAR 8}~
{ELSE}
{IF}"{VAR 2}"="{Cancel}"~
   {DISPLAY OFF}{DISPLAY ON}
   {QUIT}
{ELSE}
   {CASE}{VAR 2}~
      a~a~ A~a~ b~b~ B~b~ c~c~ C~c~ h~h~ H~h~
      p~p~ P~p~ s~s~ S~s~ t~t~ T~t~ 
      ~
{GO}loop~
{END IF}{END IF}{END IF}{END IF}

This section is the "menu engine," which tests the keys you press. Pressing the right or left arrow keys highlights a different font in the moving-bar menu. Pressing [Enter] selects that font, and pressing the Cancel key quits the macro. A simple up and down counter keeps track of the current menu.

{LABEL}b~
{CANCEL ON}
{ON NOT FOUND}{GO}not found~~
{ASSIGN}1~2~
{CHAR}9~{Up}{Up}{Up}{Up}
Select a font:{Enter}
1   Bookman Demi{Enter}
2   Bookman Demi Italic{Enter}
3   Bookman Light{Enter}
4   Bookman Light Italic  ~
{DISPLAY OFF}{DISPLAY ON}
{CASE}{VAR 9}~
1~BD~
2~BI~
3~BL~
4~BLI~
~
{CALL}no entry~
{GO}b~
{LABEL}BD~
{CALL}font size~
{Font}FnITC Bookman Demi
{GO}fin~

Each font family has its own selection routine where additional choices are provided. This section shows the Bookman family, and the four available choices. Pressing a number from 1 to 4 indicates the exact font you wish to use. A {CASE} instruction is used to test your entry. The macro then branches to the label indicated in the {CASE) instruction.

{LABEL}font size~
{TEXT}0~Enter a font size  ~
{IF}{VAR 0}>127~
{GO}bad size~
{END IF}
{IF}{VAR 0}<4~
{GO}bad size~
{END IF}
{RETURN}

PostScript lets you scale fonts to most any size. Many PostScript printers limit scaling between four and 127 points, so these check values are included in the macro. This routine asks you to enter a font size, then checks to make sure the number is between 4 and 127. If it is, then the macro continues to the next and final step.

{LABEL}fin~
{Enter}S{VAR 0}{Enter}
{DISPLAY ON}
{QUIT}

The macro selects the indicated font, at the desired size, and returns you to the document.

 

DUMMY-PAGE DESIGN

Dummy-page design macro used WordPerfect as a designer's tool. The look of the finished page is designed in WordPerfect using the Line Draw feature to make lines and boxes. If you printer supports the IBM extended character set used by Line Draw, you can use the boxes and lines you create with the dummy-page design macro as graphics embellishments to the page.

The DPBOXER.WPM macro, detailed below, automatically selects the Line Draw menu. You then position the cursor to where you want the box or line. Pressing the [Enter] key starts the box or line. A line/character space counter appears in the upper left corner of the screen as you press the cursor keys. The first digit displays the character position and the second digit displays the line position. The numbers are relative to where you started the graphic. When you are done defining the dimensions of the graphic, press [Enter] again.

You should avoid moving the cursor above or to the left of the start point, as this displays a negative number in the position indicator. The macro can't use negative numbers.


DPBOXER.WPM (provided on the Applications Disk)

1.  {ON CANCEL}{GO}cancel~~
    {ASSIGN}1~0~
    {ASSIGN}2~0~
2.  {DISPLAY OFF}
    {Exit}nn
    {Format}LM
    0"{Enter}0"{Enter}{Enter}
    PM
    0"{Enter}0"{Enter}{Enter}{Enter}
    {Screen}LM
    {DISPLAY ON}{Right}{Left}
3.  {LABEL}start~
    {ASSIGN}0~~
    {LABEL}loop1~
    {VAR 0}
    {LOOK}0~
    {IF}"{VAR 0}"="{Enter}"~
       {GO}make box~
    {ELSE}
      {GO}loop1~
    {END IF}
4.  {LABEL}make box~
    {ASSIGN}0~~
    {VAR 0}
    {LOOK}0~
    {IF}"{VAR 0}"="{Enter}"~
       1{Esc}{VAR 1}{Left}
       {Esc}{VAR 2}{Up}
       {Esc}{VAR 1}{Right}
       {Esc}{VAR 2}{Down}
       {ASSIGN}1~0~
       {ASSIGN}2~0~
       M{GO}start~
    {ELSE}
    {IF}"{VAR 0}"="{Right}"~
       {ASSIGN}1~{VAR 1}+1~
       {CALL}display~{GO}loop~
    {ELSE}
    {IF}"{VAR 0}"="{Left}"~
       {ASSIGN}1~{VAR 1}-1~
       {CALL}display~{GO}loop~
    {ELSE}
    {IF}"{VAR 0}"="{Up}"~
       {ASSIGN}2~{VAR 2}-1~
       {CALL}display~{GO}loop~
    {ELSE}
    {IF}"{VAR 0}"="{Down}"~
       {ASSIGN}2~{VAR 2}+1~
       {CALL}display~{GO}loop~
    {ELSE}
       {GO}loop~
    {END IF}{END IF}{END IF}{END IF}{END IF}
5.  {LABEL}display~
    {PROMPT}{Home}{Del to EOL}{VAR 1}  {VAR 2}~
    {RETURN}
6.  {LABEL}cancel~
    {DISPLAY OFF}
    {Exit}
    {DISPLAY ON}

When you are done drawing, press Cancel.

Note: the counter display may temporarily disappear while defining a box. This happens when WordPerfect rewrites the display, as it does when scrolling down past the bottom of the screen. The counter will reappear if you press the [Up] key.

The macro is designed to create a page layout from scratch. You can use DPBOXER.WPM to draw lines and boxes around already written text by removing the "{Exit}nn" and format instructions that appear near the beginning of the macro.

An additional macro, BOXER.WPM (provided on the Applications Disk), is functionally similar to DBBOXER.WPM, but doesn't reset the margins or erase the existing document. It automatically terminates after the box is drawn.


BOXER.WPM (provided on the Applications Disk)

{ON CANCEL}{GO}cancel~~
{ASSIGN}1~0~
{ASSIGN}2~0~
{Screen}LM

{LABEL}start~
{ASSIGN}0~~
{LABEL}loop1~
{VAR 0}
{LOOK}0~
{IF}"{VAR 0}"="{Enter}"~
{GO}make box~
{ELSE}
{GO}loop1~
{END IF}

{LABEL}make box~
{ASSIGN}0~~
{LABEL}loop~
{VAR 0}
{LOOK}0~
{IF}"{VAR 0}"="{Enter}"~
1{Esc}{VAR 2}{Up}
{Esc}{VAR 1}{Left}
{Esc}{VAR 2}{Down}
{Esc}{VAR 1}{Right}
{ASSIGN}1~0~
{ASSIGN}2~0~
M0{Right}
{DISPLAY OFF}{DISPLAY ON}{QUIT}
{ELSE}

... the rest of the macro is the same as DPBOXER.WPM

---

 Top Contents

WordPerfect 5.1 Macros and Templates
Electronic Edition
Copyright 1990, 1997, Gordon McComb.  All Rights Reserved.
First published by Bantam Electronic Publishing, 1990.
http://www.gmccomb.com/