Printing commands

There are several commands for printing text. There are four commands that have similar formats, differing only in how they justify text.

print location "text"
left location "text"
right location "text"
center location "text"

The location is optional. If the location is omitted, the "print" command will cause the text to be printed beginning at the current horizontal and vertical location. The other commands will cause the text to be placed vertically at the current vertical position, but left justified, right justified, or centered within the current margins of the page.

The location can be specified using the special keyword of "nl" which means "next line." This moves the current location to the beginning of the following line before placing the text. In other words, the current vertical position is moved downward by the height of the current text point size (or by as much as necessary if the string is taller than that). Then the text is printed on that line with the given justification style.

The other way to specify a location is by using coordinates. The justification then takes place relative to the referenced location. For example, consider the following "right" command containing a reference to an absolute location:

right (25, 4) "something"

The y location given is 4. Since this is an absolute location with no location tags being referenced, this means the vertical position will be 4 stepsizes from the bottom on the page. The x location given is 25. Again, this is an absolute location, so the current horizontal position will be 25 stepsizes from the left edge of the page. Since right justification is indicated, the word "something" will be placed such that the right edge of the final "g" will be 25 stepsizes from the left edge of the page. If "center" had been specified, the middle of the word "something" would be at the 25 stepsize point.

Here are some other examples:

print "Author unknown"
center nl "subtitle"
left (h.x - 1.5, h.n + 2.3) "Ad lib"
right (_fine.e + time 3, _note.n + 5) "Duet"

The final type of print command (and probably the most useful) is "title." The full format of this command is:

title fontfamily font size  "text1"  "text2"  "text3"

However, only the word "title" and one quoted text string are required. The fontfamily, if specified, has one of the values valid for the "fontfamily" parameter (avantgarde, bookman, courier, helvetica, newcentury, palatino, or times). The default is the value of the "fontfamily" parameter. The font, if specified, has one of the values valid for the "font" parameter (rom, bold, ital, or boldital). If no font is specified the default is the value of the "font" parameter. The optional size is a point size within parentheses. If not specified, the default is the value of the "size" parameter.

In all cases, the location will be like that obtained via the "nl" location to a print command. In other words, the title text string(s) will be printed on the line below the location that was current when the title command was encountered. If there is only one string given, it will be centered between the margins. If two strings are given, both will be printed on the same line, but the first will be left justified and the second will be right justified. If three strings are given, they will all be printed on the same line, with the first left justified, the second centered, and the last right justified.

Some samples:

title bold (12) "Sonata 12"
title (18) "Song Without Words"
title ital (12) "Text: John Doe" "Tune: Jane Doe"
title "Suite in C" "Trumpet I" "Waltz"
title    ""    "A. Composer"

The printing commands may occur in the header, footer, header2, footer2, and music contexts. After each printing command, the current location is set to the right edge of the last character printed horizontally and at the baseline of the current line vertically.


Mup User's Guide Table of Contents