X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mup/blobdiff_plain/cdb3c0882392596f814cf939cbfbd38adc6f2bfe..ddf6330b56bcfb657e0186b24b9b1422c51d3424:/mup/docs/uguide/prnttext.html diff --git a/mup/docs/uguide/prnttext.html b/mup/docs/uguide/prnttext.html new file mode 100644 index 0000000..2d0d3d9 --- /dev/null +++ b/mup/docs/uguide/prnttext.html @@ -0,0 +1,277 @@ + + +"Mup commands for printing text + + +

+   <-- previous page + +     Table of Contents    next page --> +

+ +

+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 of 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"
+

+

+

+Another type of print command +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 final command for printing text is +the "paragraph" command. +This is used when you have a long section of text, +and you would like it to automatically wrap around onto as many +lines as necessary. +You can specify whether you want the right margin to be "justified" or "ragged." +If you don't specify, the type of the previous paragraph is used. +The default for the very first paragraph is to be justified. +By default, the values of the +fontfamily, +font, +and +size +parameters are used to determine the text style, but any or all of those +parameters can be overridden on the paragraph command. The complete syntax is: +
+ justify_type paragraph fontfamily font (size) "string" +
+Only the keyword "paragraph" and the string are required. +Here are some example paragraphs: +

+paragraph "This is an example of a paragraph. Since no justification
+type was specified, and this is the very first paragraph, the default
+(justified) is used. A paragraph will wrap around
+to as many lines as needed.
+An explicit newline is given at the end of this paragraph,
+to force a blank line between it and the following paragraph.\n"
+
+ragged paragraph avantgarde ital (15) "This paragraph
+is ragged rather than flush right. It is in a different font and size.
+Ragged paragraphs are split onto multiple lines if necessary,
+but they are not spread out to make lines go all the way to
+the right margin."
+
+justified paragraph (14) "     Here is another paragraph.
+This one is justified.
+Only the size was specified for this paragraph; the font was not,
+so the current default will be used.
+Some spaces are included at the beginning of the paragraph text,
+to create an indented first line for the paragraph."
+
+paragraph "Here is the final paragraph.
+Since no justification type was given,
+that of the previous paragraph (justified in this case) was used.
+A paragraph may be used for many things,
+such as describing how you want a piece to be performed,
+or a biography of the composer."
+

+Picture of Mup output
+

+

+Sometimes you may want to mix +blocks of text with music. +This can be done by specifying a "block" context. The block context +will typically contain one or more "paragraph" commands, although any +of the printing commands (paragraph, print, left, center, right, or title) +can be used. The block can also contain changes in certain parameters, namely +font, +size, +and +fontfamily, +which will affect the appearance of +the following text. A block can also contain +"newscore" or "newpage" commands. +Using "newscore" will cause vertical space to be added, +as would be used to separate scores. The amount of space is affected +by the +scoresep +and +scorepad +parameters. Using "newpage" will cause a new page to be started. +If a newscore or newpage includes a "leftmargin" specification, +that will alter the left margin on the block text that follows. +A "rightmargin" specification will alter the right margin +of the block text that precedes it. +

+

+Here is an example of a block. +

+block
+title bold "Notation in Simple and Compound Meters"
+title ""
+paragraph "It is common for a person familiar
+with mathematics but not with music to assume
+that 3/4 and 6/8 time are equivalent,
+but that is not the case.
+In 3/4 time (which is known as simple triple meter),
+a measure containing 3 quarter notes
+would be notated like this:"
+score time=3/4
+music
+1: c;;;
+bar
+block
+paragraph "whereas in 6/8 time
+(which is compound duple meter),
+a measure with 3 quarter notes should be notated thus:"
+score time=6/8
+music
+1: 4c;8~;;4;
+bar
+

+Picture of Mup output
+

+

+The printing commands may occur in the +header, footer, header2, footer2, top, bottom, top2, bottom2, +block, +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. +

+

+Including raw PostScript +

+

+There is another command that looks a lot like the printing commands, +but gives you a way to insert raw PostScript into the Mup output. +This might be used, for example, +to include a picture or logo along with your music. +The syntax is +

+postscript optional_location "raw PostScript"
+

+As with the other print commands, if the location is omitted, +the current location is used. +

+

+The string is copied directly to the Mup output. +You can use the usual \" to embed a double quote in the string, +but otherwise the string is copied exactly as it is, +enclosed inside a PostScript save/restore. +After the restore, the current location is reset back to where it +was originally. +

+

+Since the string is copied without any interpretation, +Mup does not reserve any space on the page for the PostScript, +and it is your responsibility to provide valid PostScript. +The PostScript language is beyond the scope of this User's Guide; +consult a book on PostScript if you need more information. +

+

+As a simple example, you might include an Encapsulated PostScript file +near the lower left corner of the current page using +

+postscript "50 50 translate (file.eps) run"
+

+

+

+Or you could print a message in red italics +near the bottom of the page like this: +

+postscript (70, 20) "
+              1 0 0 setrgbcolor
+              /NewCenturySchlbk-Italic findfont
+              16 scalefont setfont
+              (Photocopying prohibited) show
+              "
+

+

+

+   <-- previous page     Table of Contents    next page --> +

+