Import upstream version 5.3.
[mup] / mup / docs / uguide / textstr.html
1 <HTML>
2 <HEAD><TITLE>
3 Text Strings
4 </TITLE></HEAD>
5 <BODY>
6 <P>
7 &nbsp;&nbsp;&nbsp;<A HREF="shaped.html">&lt;-- previous page</A>
8
9 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="stuff.html">next page --&gt;</A>
10 </P>
11
12 <H1>
13 TEXT STRINGS
14 </H1>
15 <P>
16 Text strings are used in many different ways.
17 A text string is enclosed in double quotes,
18 and can contain any combination of letters, numbers, spaces,
19 and punctuation.
20 It can contain a \n to indicate a newline or \b to indicate a backspace,
21 but otherwise cannot contain tabs or other
22 control characters. If you want a double quote mark inside a string, it
23 has to be preceded by a backslash, to indicate it is not ending the string:
24 <BR><PRE>
25 &quot;A \&quot;word\&quot; in quotes&quot;
26 </PRE><BR>
27 </P>
28 <P>
29 If you want an actual backslash in a string, it must be entered as two
30 backslashes.
31 </P>
32 <P>
33 <A NAME="strcat">You can concatenate strings with a + sign. Thus the following are equivalent:</A>
34 <BR><PRE>
35 &quot;this is a string&quot;
36 &quot;this is &quot; + &quot;a string&quot;
37 </PRE><BR>
38 </P>
39 <H2>
40 Special characters
41 </H2>
42 <P>
43 <A NAME="symlist">A string can also contain special</A>
44 music characters.
45 These are specified
46 by \(<I>xxx</I>), where the <I>xxx</I> is a code from the following table:
47 </P>
48 <H3>
49 Clef
50 </H3>
51 <PRE>
52 gclef G clef (treble clef)
53 fclef F clef (bass clef)
54 cclef C clef (used for alto clef, tenor clef, etc.)
55 </PRE>
56 <H3>
57 Time Signature
58 </H3>
59 <PRE>
60 com common time
61 cut cut time
62 </PRE>
63 <H3>
64 Accidentals
65 </H3>
66 <PRE>
67 flat flat
68 dblflat double flat
69 sharp sharp
70 dblsharp double sharp
71 nat natural
72 </PRE>
73 <H3>
74 Notes
75 </H3>
76 <PRE>
77 dn2n half note with stem down
78 dn4n quarter note with stem down
79 dn8n eighth note with stem down
80 dn16n 16th note with stem down
81 dn32n 32nd note with stem down
82 dn64n 64th note with stem down
83 dn128n 128th note with stem down
84 dn256n 256th note with stem down
85 up2n half note with stem up
86 up4n quarter note with stem up
87 up8n eighth note with stem up
88 up16n 16th note with stem up
89 up32n 32nd note with stem up
90 up64n 64th note with stem up
91 up128n 128th note with stem up
92 up256n 256th note with stem up
93 upflag upward flag
94 dnflag downward flag
95 </PRE>
96 <H3>
97 Noteheads
98 </H3>
99 <PRE>
100 4n quarter (and shorter) note head
101 2n half note head
102 1n whole note
103 dblwhole double whole note
104 xnote X-shaped note head
105 diamond open diamond-shaped note head
106 filldiamond filled diamond-shaped note head
107 dwhdiamond double whole diamond-shaped note
108 isostriangle open isosceles triangle notehead
109 fillisostriangle filled isosceles triangle notehead
110 dwhisostriangle double whole isosceles triangle notehead
111 piewedge open piewedge notehead
112 fillpiewedge filled piewedge notehead
113 dwhpiewedge double whole piewedge notehead
114 rectangle open rectangle notehead
115 fillrectangle filled rectangle notehead
116 dwhrectangle double whole rectangle notehead
117 righttriangle open right triangle notehead
118 fillrighttriangle filled right triangle notehead
119 dwhrighttriangle double whole right triangle notehead
120 urighttriangle upside-down open right triangle notehead
121 ufillrighttriangle upside-down filled right triangle notehead
122 udwhrighttriangle upside-down double whole right triangle notehead
123 semicircle open semicircle notehead
124 fillsemicircle filled semicircle notehead
125 dwhsemicircle double whole semicircle notehead
126 slashhead open slash notehead
127 fillslashhead filled slash notehead
128 dwhslashhead double whole slash notehead
129 blankhead blank notehead
130 </PRE>
131 <H3>
132 Rests
133 </H3>
134 <PRE>
135 qwhrest quadruple whole rest
136 dwhrest double whole rest
137 1rest whole rest
138 2rest half rest
139 4rest quarter rest
140 8rest eighth rest
141 16rest sixteenth rest
142 32rest thirty-second rest
143 64rest sixty-fourth rest
144 128rest 128th rest
145 256rest 256th rest
146 </PRE>
147 <H3>
148 Pedal
149 </H3>
150 <PRE>
151 begped begin pedal mark
152 endped end pedal mark
153 pedal pedal up/down mark
154 </PRE>
155 <H3>
156 Ornaments
157 </H3>
158 <PRE>
159 tr trill
160 mor mordent
161 invmor inverted mordent
162 turn turn
163 invturn inverted turn
164 </PRE>
165 <H3>
166 Miscellaneous
167 </H3>
168 <PRE>
169 ferm fermata
170 uferm upside-down fermata
171 acc_gt accent like a greater-than sign
172 acc_hat accent like a &quot;hat&quot; or ^ (circumflex or &quot;up-arrow&quot;)
173 acc_uhat accent like an upside down hat
174 leg legato mark
175 dot dot
176 wedge wedge
177 uwedge upside-down wedge
178 sign sign for D. S.
179 coda coda mark
180 upbow up bow
181 dnbow down bow
182 rr &quot;railroad tracks&quot; or caesura (2 slanted lines sometimes put
183 at the top of a staff to indicate the end of a musical thought)
184 measrpt measure repeat
185 copyright C-in-circle copyright symbol
186 dim diminished
187 halfdim half diminished
188 triangle triangle
189 </PRE>
190 <BR>
191 <IMG SRC="muschar.gif" ALT="music characters">
192 <BR>
193 <P>
194 Any of these music character names can be prefixed by &quot;sm&quot; to indicate a
195 smaller version of the character. For example, &quot;smup4n&quot; is a small quarter
196 note, as might be used for a &quot;cue&quot; note.
197 Small music characters are 0.65 times as big as regular characters.
198 </P>
199 <P>
200 <A NAME="special">Various non-ASCII characters</A>
201 can be included in text strings. If you have a non-United States keyboard
202 which can produce characters listed in the table below
203 from the &quot;Latin-1&quot; alphabet, you can simply type them into strings as
204 you normally would. If you want a character that your keyboard does not
205 support, you can put them in strings
206 by using their names in a manner similar to the music characters.
207 For example, you can include an 'a' with an acute accent on it in
208 a string by using \(aacute), or an upside down question mark
209 using \(questiondown). Many characters have shorthand names too.
210 For example, \(a') is a shorter name for 'a' with an acute accent.
211 The full names of the special characters and their shorthand names, if any,
212 are given in the following table:
213 <PRE>
214 full name shorthand full name shorthand
215 ------------------------------------------------------
216 exclamdown questiondown
217 sterling yen
218 cent quotedblbase
219 quotedblleft &#96;&#96; quotedblright &#180;&#180;
220 guillemotleft &lt;&lt; guillemotright &gt;&gt;
221 guilsinglleft guilsinglright
222 dagger daggerdbl
223 grave acute
224 macron breve
225 dotaccent dieresis
226 ring cedilla
227 hungarumlaut ogonek
228 caron emdash
229 AE ae
230 ordfeminine ordmasculine
231 Lslash L/ lslash l/
232 Oslash O/ oslash o/
233 OE oe
234 dotlessi germandbls ss
235 Aacute A&#180; aacute a&#180;
236 Acircumflex A^ acircumflex a^
237 Adieresis A: adieresis a:
238 Agrave A&#96; agrave a&#96;
239 Aring Ao aring ao
240 Atilde A~ atilde a~
241 Ccedilla C, ccedilla c,
242 Eacute E&#180; eacute e&#180;
243 Ecircumflex E^ ecircumflex e^
244 Edieresis E: edieresis e:
245 Egrave E&#96; egrave e&#96;
246 Iacute I&#180; iacute i&#180;
247 Icircumflex I^ icircumflex i^
248 Idieresis i: idieresis i:
249 Igrave I&#96; igrave i&#96;
250 Ntilde N~ ntilde n~
251 Oacute O&#180; oacute o&#180;
252 Ocircumflex O^ ocircumflex o^
253 Odieresis O: odieresis o:
254 Ograve O&#96; ograve o&#96;
255 Otilde O~ otilde o~
256 Scaron Sv scaron sv
257 Uacute U&#180; uacute u&#180;
258 Ucircumflex U^ ucircumflex u^
259 Udieresis U: udieresis u:
260 Ugrave U&#96; ugrave u&#96;
261 Ydieresis Y: ydieresis y:
262 Zcaron Zv zcaron Zv
263 bullet
264 </PRE>
265 </P>
266 <P>
267 <A NAME="space">There is one additional special characters,</A>
268 specified by \(space).
269 This character appears as a normal space on output, but is not treated
270 like a space when Mup is looking for word or syllable boundaries.
271 The most common use for this is probably in
272 <A HREF="lyrics.html">lyrics</A>
273 when you want several words to be sung on a single note.
274 Another use would be in cases where Mup would normally split up a long
275 string between words in order to avoid running off the edge of a page,
276 but you want to prevent that split.
277 </P>
278 <H2>
279 Font and size changes
280 </H2>
281 <P>
282 Strings can also contain special codes to indicate changes in font or size.
283 The font codes begin with \f, and
284 can either be spelled out, as in the first column of
285 the table below, or as the abbreviations given in the second column.
286 <PRE>
287 Code Abbr Meaning
288
289 \f(avantgarde rom) \f(AR) Avant Garde roman font
290 \f(avantgarde bold) \f(AB) Avant Garde bold font
291 \f(avantgarde ital) \f(AI) Avant Garde italic font
292 \f(avantgarde boldital) \f(AX) Avant Garde bold-italic font
293
294 \f(bookman rom) \f(BR) Bookman roman font
295 \f(bookman bold) \f(BB) Bookman bold font
296 \f(bookman ital) \f(BI) Bookman italic font
297 \f(bookman boldital) \f(BX) Bookman bold-italic font
298
299 \f(courier rom) \f(CR) Courier roman font
300 \f(courier bold) \f(CB) Courier bold font
301 \f(courier ital) \f(CI) Courier italic font
302 \f(courier boldital) \f(CX) Courier bold-italic font
303
304 \f(helvetica rom) \f(HR) Helvetica* roman font
305 \f(helvetica bold) \f(HB) Helvetica bold font
306 \f(helvetica ital) \f(HI) Helvetica italic font
307 \f(helvetica boldital) \f(HX) Helvetica bold-italic font
308
309 \f(newcentury rom) \f(NR) New Century roman font
310 \f(newcentury bold) \f(NB) New Century bold font
311 \f(newcentury ital) \f(NI) New Century italic font
312 \f(newcentury boldital) \f(NX) New Century bold-italic
313
314 \f(palatino rom) \f(PR) Palatino roman font
315 \f(palatino bold) \f(PB) Palatino bold font
316 \f(palatino ital) \f(PI) Palatino italic font
317 \f(palatino boldital) \f(PX) Palatino bold-italic font
318
319 \f(times rom) \f(TR) Times* roman font
320 \f(times bold) \f(TB) Times bold font
321 \f(times ital) \f(TI) Times italic font
322 \f(times boldital) \f(TX) Times bold-italic font
323
324 \f(previous) \f(PV) previous font
325 </PRE>
326 Some of the
327 <A HREF="textstr.html#special">special characters</A>
328 look better in some fonts than others. We have found that
329 some PostScript interpreters unfortunately don't always
330 implement all the special characters in all fonts.
331 </P>
332 <P>
333 If you need a font other than those Mup supports directly,
334 it is possible to override Mup's builtin fonts with other fonts.
335 This is described later in the
336 <A HREF="fontfile.html">section on "Installing other fonts."</A>
337 </P>
338 <P>
339 <A NAME="size">The point size can also be changed. (A "point" is about 1/72 of an inch.)</A>
340 <PRE>
341 Code Meaning
342
343 \s(<I>N)</I> change to point size <I>N</I>
344 \s(+<I>N)</I> increase point size by <I>N</I> points
345 \s(-<I>N)</I> decrease point size by <I>N</I> points
346 \s(PV) or \s(previous) revert to previous size
347
348 </PRE>
349 The point size can range from 1 to 100. A font or size change will last until
350 changed or until the end of the string. Any subsequent strings will begin
351 with default font and size values, except in the case of
352 <A HREF="lyrics.html">lyrics,</A>
353 where font and size information is maintained separately
354 for each staff and verse, and carried forward from measure to measure, and
355 <A HREF="bars.html#reh">rehearsal marks,</A>
356 where the information is also carried forward.
357 The default values can be set as
358 <A HREF="param.html">described in the "Parameters" section. The</A>
359 <A HREF="textstr.html#symlist">music symbols</A>
360 are affected by size changes.
361 If a music symbol follows italics or bolditalics characters, it will be
362 made italics to match.
363 </P>
364 <P>
365 Here are some examples of strings:
366 <BR><PRE>
367 &quot;hello&quot;
368 &quot;( \(up2n) = 100 )&quot;
369 &quot;\f(TB)this will be bold. \f(TI)this will be italics&quot;
370 &quot;A \f(TX)\s(+12)BIG\f(PV)\s(-12) word&quot;
371 &quot;\f(newcentury boldital)Allegro&quot;
372 </PRE><BR>
373 </P>
374 <H2>
375 Horizontal and vertical motion
376 </H2>
377 <P>
378 It is also possible to specify a string that takes up more than one line,
379 by putting a &quot;\n&quot; where you want to move to a new line. The place where
380 this is most likely to be useful is for
381 <A HREF="param.html#label">staff labels,</A>
382 which you may want
383 to make multi-line, to keep them from becoming excessively wide.
384 For example:
385 <BR><PRE>
386 &quot;Violins\nI&amp;II&quot;
387 </PRE><BR>
388 </P>
389 <P>
390 A &quot;\b&quot; can be used to specify a backspace. This might be useful for
391 adding underlines to text.
392 If you wish to use letters with diacritical marks,
393 you will probably want to use the
394 <A HREF="textstr.html#special">special characters,</A>
395 described earlier in this section,
396 rather than trying to construct them using the plain letter,
397 a backspace, and the mark.
398 </P>
399 <P>
400 You are not allowed to back up to before the beginning of a line.
401 Note that in all fonts except Courier,
402 different characters have different widths, so
403 using backspaces can be a bit tricky. For example, underlining a 5-letter
404 word might require more than 5 underscores, if the characters in the word
405 are wider than an underscore character. In general, it works better to
406 enter an entire string, then backspace to add underscoring or accents, rather
407 than doing them along the way. For example, &quot;My\b\b___&quot; will line up
408 much better than &quot;M\b_y\b_&quot;.
409 </P>
410 <P>
411 <A NAME="vert">Vertical motion within a string</A>
412 can be specified using &quot;\v(<I>N</I>)&quot;
413 where <I>N</I> is some percentage of the current font height.
414 The distance may be negative for downward motion
415 or positive for upward motion, ranging from -100 to 100.
416 This might be used for creating superscripts and subscripts, although
417 the next section describes an alternate way of doing that which is
418 usually better. It might also be used just to line something up differently
419 than Mup normally would.
420 You cannot put newlines (with \n) in the same string with vertical
421 motion.
422 </P>
423 <H2>
424 Piled text, for superscripts, subscripts, etc.
425 </H2>
426 <P>
427 It is also possible to &quot;pile up&quot; lines of text in a string.
428 Some common uses of this could be for superscripts and subscripts or for
429 figured bass notation.
430 Some facilities to specifically deal with
431 <A HREF="textmark.html#chordmod">figured bass</A>
432 will be described in a later section, but
433 here we describe the general-purpose constructs for piling text.
434 A \: is used to indicate the beginning of piling. Any subsequent
435 instances of \: in the same string will alternately turn piling off and on.
436 When a pile is begun, the text size is automatically made smaller, and
437 the text baseline is moved up, so that the first line of piled text is
438 like a superscript, and the next like a subscript. If there are additional
439 lines, they are placed below the subscript.
440 By default, the lines in a pile are placed such that the last digit
441 in each line all line up, or if there is no digit, the last character.
442 However, you can force different alignment.
443 A \| will force alignment at that point, or a \^ will force alignment
444 at the center of the following character. A maximum of one alignment marker
445 can be specified on each line of a pile.
446 You cannot put newlines (with \n) in the same string with piling.
447 A new line of the pile is started at each &lt;space&gt; character in the input string.
448 If you want an actual literal space inside a piled line, it must be
449 preceded with a backslash. As an example:
450 <BR><PRE>
451 &quot;Text\:superscript subscript\: back to normal.&quot;;
452 &quot;This pile \:has\ literal spaces\ in\ it.&quot;;
453 &quot;This pile \:h\^as align\|ment spec\^ified.&quot;;
454 </PRE><BR>
455 <IMG SRC="mugex65.gif" ALT="Picture of Mup output"><BR>
456 </P>
457 <H2>
458 Slash through number
459 </H2>
460 <P>
461 Another thing which is common in figured bass notation
462 is to draw a slash through a number. Again, the section on
463 <A HREF="textmark.html#chordmod">figured bass</A>
464 will describe how to do that inside figured bass,
465 but it is possible to put a slash through a number elsewhere by
466 placing a backslashed slash after a number, like this:
467 <BR><PRE>
468 &quot;6\/&quot;
469 &quot;10\/&quot;
470 </PRE><BR>
471 </P>
472 <H2>
473 Boxed or circled text
474 </H2>
475 <P>
476 <A NAME="boxed">You can cause the text to be</A>
477 printed inside a box by placing a \[ at
478 the beginning of the string and a \] at the end of the string.
479 Similarly you can cause text to be placed inside a circle (or ellipse
480 for strings that are wide) by placing a \{ at
481 the beginning of the string and a \} at the end of the string.
482 Boxed or circled text are not allowed in
483 <A HREF="lyrics.html">lyrics.</A>
484 <BR><PRE>
485 &quot;\[This is in a box\]&quot;
486 &quot;\{This is in an ellipse\}&quot;
487 </PRE><BR>
488 <IMG SRC="mugex66.gif" ALT="Picture of Mup output"><BR>
489 <HR>
490 * Times is a trademark and Helvetica is a registered trademark of Allied Corporation.
491 </P>
492 <HR><P>
493 &nbsp;&nbsp;&nbsp;<A HREF="shaped.html">&lt;-- previous page</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="index.html">Table of Contents</A>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="stuff.html">next page --&gt;</A>
494 </P>
495 </BODY></HTML>