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