OUT_TXT_FILES = $(addprefix $(outdir)/, $(addsuffix .txt, $(README_TOP_FILES)))
### Web site idiosyncrases
-
-$(outdir)/web/index.html: TEXI2HTML_SPLIT = $(WEB_TEXI2HTML_SPLIT)
$(XREF_MAPS_DIR)/web.xref-map: XREF_MAP_FLAGS += --split=node
+ifeq ($(out),www)
+website: $(outdir)/web.texi
+ mkdir -p $(outdir)/upload/
+ $(TEXI2HTML) $(TEXI2HTML_SPLIT) $(TEXI2HTML_FLAGS) -D web_version \
+ --output=$(outdir)/upload/ $(outdir)/web.texi
+ cp $(top-src-dir)/Documentation/css/*.css $(outdir)/upload/
+ #cd out-website && ln -sf ../$(outdir)/pictures pictures
+endif
+
+
### bad hack for badly-integrated roadmap.
$(outdir)/ROADMAP:
cp $(top-src-dir)/ROADMAP $(outdir)
@item
LilyPond is now licensed under the GNU GPL v3+.
+@item
+In tablature, frets can be indicated with labels other than numbers:
+
+@lilypond[verbatim,quote,relative=1]
+\new TabStaff
+\with {
+ stringTunings = #'(17 14 9 5 2 -3)
+ tablatureFormat = #fret-letter-tablature-format
+}
+\new TabVoice {
+ \set fretLabels = #`(,(markup #:with-color red "a")
+ "b"
+ ,(markup #:italic #:smaller "c"))
+ <f d>4. <bes>8 <g e>4
+}
+@end lilypond
+
+@item
+Layout objects can be printed over a white background, which whites-out objects
+in lower layers which lie beneath:
+
+@lilypond[verbatim,quote,relative=1]
+\time 3/4
+\override Staff.StaffSymbol #'layer = #4
+\once \override Tie #'layer = #2
+b'2.~
+\once \override Staff.TimeSignature #'whiteout = ##t
+\once \override Staff.TimeSignature #'layer = #3
+\time 5/4
+b4
+@end lilypond
+
@item
Chords can be repeated using the @code{q} shortcut:
@example
-1- Web site
-251 web.texi
-3647 web/introduction.itexi
-1036 web/download.itexi
+478 web.texi
+3652 web/introduction.itexi
+979 web/download.itexi
1059 macros.itexi
161 translations.template.html.in
9 po/lilypond-doc.pot (translate to po/@var{MY_LANGUAGE}.po)
--- lilypond-texi2html.init (section TRANSLATIONS)
-6163 total
+6338 total
-2- Tutorial
-2089 web/manuals.itexi
-132 learning.tely
-2941 learning/tutorial.itely
-4138 learning/common-notation.itely
-9300 total
+1948 web/manuals.itexi
+122 learning.tely
+3145 learning/tutorial.itely
+4035 learning/common-notation.itely
+9250 total
-3- Fundamental Concepts, starting of Usage and Community
11135 learning/fundamental.itely -- Fundamental concepts
411 learning/preface.itely
-145 usage.tely
+135 usage.tely
3555 usage/running.itely
1189 usage/updating.itely
-2385 web/community.itexi
-18820 total
+2401 web/community.itexi
+18826 total
-4- Rest of Learning manual and Suggestions on writing LilyPond files
15578 learning/tweaks.itely -- Tweaking output
18473 total
-5- Notation reference
-467 notation.tely
+353 notation.tely
91 notation/notation.itely -- Musical notation
3155 notation/pitches.itely
4757 notation/rhythms.itely
4487 notation/ancient.itely
6264 notation/input.itely -- Input syntax
2164 notation/non-music.itely -- Non-musical notation
-8793 notation/spacing.itely -- Spacing issues
-11458 notation/changing-defaults.itely -- Changing defaults
+9247 notation/spacing.itely -- Spacing issues
+11871 notation/changing-defaults.itely -- Changing defaults
5187 notation/programming-interface.itely -- Interfaces for programmers
2004 notation/notation-appendices.itely -- Notation manual tables
252 notation/cheatsheet.itely -- Cheat sheet
-64470 total
+65223 total
-6- Rest of Application Usage
3511 usage/lilypond-book.itely -- LilyPond-book
@item
@@var - Use for variables.
+@item
+@@version@{@} - Return the current LilyPond version string
+
@item
@@warning@{@} - produces a "Note: " box. Use for important messages.
@@untranslated
@end example
-@noindent
+@warning{you do not have to translate the node name of a cross-reference
+to a node that you do not have translated. If you do, you must define
+an @qq{empty} node like explained just above; this will produce a
+cross-reference with the translated node name in output, although the
+target node will still be in English. On the opposite, if all
+cross-references that refer to an untranslated node use the node name in
+English, then you do not have to define such an @qq{empty} node, and the
+cross-reference text will appear in English in the output. The choice
+between these two strategies implies its particular maintenance
+requirements and is left to the translators, although the opinion of the
+Translation meister leans towards not translating these
+cross-references.}
+
Finally, press in Emacs @key{C-c C-u C-a} to update or generate
menus. This process should be made easier in the future, when the helper
script @command{texi-langutils.py} and the makefile target are updated.
Take care of using typographic rules for your language, especially in
@file{macros.itexi}.
+If you wonder whether a word, phrase or larger piece of text should be
+translated, whether it is an argument of a Texinfo command or a small
+piece sandwiched between two Texinfo commands, try to track whether and
+where it appears in PDF and/or HTML output as visible text. This piece
+of advice is especially useful for translating @file{macros.itexi}.
Please keep verbatim copies of music snippets (in @code{@@lilypond}
blocs). However, some music snippets containing text that shows in
you should do a @command{git commit}. If it lists any
@emph{Untracked files}, then you should do a @command{git add}.
+@seealso
+
+If your patch includes a significant amount of code, you may want to see
+@ref{Adding or modifying features}, especially @emph{Post patch for
+comments}.
+
@node Committing directly
@subsection Committing directly
@section Introduction to website work
The website is @emph{not} written directly in HTML;
-instead, the source is texinfo, which is then generated into HTML,
-pdf, and info formats. The sources are
+instead, the source is Texinfo, which is then generated into HTML,
+PDF, and Info formats. The sources are
@verbatim
Documentation/web.texi
Unless otherwise specified, follow the instructions and policies
given in @ref{Documentation work}. That chapter also contains a
-quick introduction to texinfo; consulting an external texinfo
+quick introduction to Texinfo; consulting an external Texinfo
manual should be not necessary.
@subheading Exceptions to the documentation policies
@node Translating the website
@section Translating the website
-
-
+As it has much more audience, the website should be translated before
+the documentation; see @ref{Translating the documentation}.
-·<p><i>Zuletzt aktualisiert am·Sun Dec 13 21:12:26 UTC 2009
+·<p><i>Zuletzt aktualisiert am·Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
<th>Mehr Information</th>
</tr>
<tr align="left">
- <td>Überschriften<br>(103)</td>
+ <td>Überschriften<br>(93)</td>
<td>Till Paala</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
<th>Mehr Information</th>
</tr>
<tr align="left">
- <td>Überschriften<br>(132)</td>
+ <td>Überschriften<br>(122)</td>
<td>Till Rettig</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
<td>vor-GDP</td>
</tr>
<tr align="left">
- <td>1 Übliche Notation<br>(4138)</td>
+ <td>1 Übliche Notation<br>(4035)</td>
<td>Till Rettig</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
- <td><span style="background-color: #1fff1f">ja</span></td>
+ <td><span style="background-color: #25fe1f">teilweise</span></td>
<td>vor-GDP</td>
</tr>
<tr align="left">
<th>Mehr Information</th>
</tr>
<tr align="left">
- <td>Überschriften<br>(467)</td>
+ <td>Überschriften<br>(353)</td>
<td>Till Paala</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
- <td><span style="background-color: #dbff38">teilweise</span></td>
+ <td><span style="background-color: #ffda43">teilweise</span></td>
<td>vor-GDP</td>
</tr>
<tr align="left">
<td>vor-GDP</td>
</tr>
<tr align="left">
- <td>4 Abstände<br>(8793)</td>
+ <td>4 Abstände<br>(9247)</td>
<td>Till Paala</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
- <td><span style="background-color: #4efe25">teilweise</span></td>
+ <td><span style="background-color: #8aff2d">teilweise</span></td>
<td>vor-GDP</td>
</tr>
<tr align="left">
- <td>5 Standardeinstellungen verändern<br>(11458)</td>
+ <td>5 Standardeinstellungen verändern<br>(11871)</td>
<td>Till Paala</td>
<td></td>
- <td><span style="background-color: #1fff1f">ja</span></td>
- <td><span style="background-color: #47ff24">teilweise</span></td>
+ <td><span style="background-color: #dfef77">teilweise (96 %)</span></td>
+ <td><span style="background-color: #54ff26">teilweise</span></td>
<td>vor-GDP</td>
</tr>
<tr align="left">
<th>Mehr Information</th>
</tr>
<tr align="left">
- <td>Überschriften<br>(145)</td>
+ <td>Überschriften<br>(135)</td>
<td>Till Paala</td>
<td></td>
<td><span style="background-color: #1fff1f">ja</span></td>
ISOLANG = es
depth = ../..
-SUBDIRS = learning notation texidocs usage
+SUBDIRS = learning notation texidocs usage web
STEPMAKE_TEMPLATES = documentation
LOCALSTEPMAKE_TEMPLATES = lilypond ly doc-i18n-root
- <p><i>Actualizado en Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Actualizado en Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
<th>Más inf.</th>
</tr>
<tr align="left">
- <td>Títulos de sección<br>(132)</td>
+ <td>Títulos de sección<br>(122)</td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>1 Tutorial<br>(2941)</td>
+ <td>1 Tutorial<br>(3145)</td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
<th>Más inf.</th>
</tr>
<tr align="left">
- <td>Títulos de sección<br>(467)</td>
+ <td>Títulos de sección<br>(353)</td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>4 Problemas de espaciado<br>(8793)</td>
+ <td>4 Problemas de espaciado<br>(9247)</td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
- <td><span style="background-color: #4efe25">parcialmente</span></td>
+ <td><span style="background-color: #8aff2d">parcialmente</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>5 Cambiar los valores por omisión<br>(11458)</td>
+ <td>5 Cambiar los valores por omisión<br>(11871)</td>
<td>Francisco Vila</td>
<td></td>
- <td><span style="background-color: #dfef77">parcialmente (96 %)</span></td>
- <td><span style="background-color: #54ff26">parcialmente</span></td>
+ <td><span style="background-color: #dfef77">parcialmente (93 %)</span></td>
+ <td><span style="background-color: #62ff28">parcialmente</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
<th>Más inf.</th>
</tr>
<tr align="left">
- <td>Títulos de sección<br>(145)</td>
+ <td>Títulos de sección<br>(135)</td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
<td>Francisco Vila</td>
<td></td>
<td><span style="background-color: #1fff1f">sí</span></td>
- <td><span style="background-color: #47ff24">parcialmente</span></td>
+ <td><span style="background-color: #40fe23">parcialmente</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
</table>
<p></p>
+<table align="center" border="2">
+ <tr align="center">
+ <th>LilyPond... notación musical para todos</th> <th>Traductores</th>
+ <th>Revisores</th>
+ <th>Traducido</th>
+ <th>Actualizado</th>
+ <th>Más inf.</th>
+ </tr>
+ <tr align="left">
+ <td>Títulos de sección<br>(478)</td>
+ <td>Francisco Vila</td>
+ <td></td>
+ <td><span style="background-color: #1fff1f">sí</span></td>
+ <td><span style="background-color: #efff3a">parcialmente</span></td>
+ <td>pre-GDP</td>
+ </tr>
+ <tr align="left">
+ <td>Introducción<br>(3652)</td>
+ <td>Francisco Vila</td>
+ <td></td>
+ <td><span style="background-color: #1fff1f">sí</span></td>
+ <td><span style="background-color: #2cff20">parcialmente</span></td>
+ <td>pre-GDP</td>
+ </tr>
+ <tr align="left">
+ <td>Descarga<br>(979)</td>
+ <td>Francisco Vila</td>
+ <td></td>
+ <td><span style="background-color: #1fff1f">sí</span></td>
+ <td><span style="background-color: #83fe2c">parcialmente</span></td>
+ <td>pre-GDP</td>
+ </tr>
+ <tr align="left">
+ <td>Manuales<br>(1948)</td>
+ <td>Francisco Vila</td>
+ <td></td>
+ <td><span style="background-color: #1fff1f">sí</span></td>
+ <td><span style="background-color: #9eff30">parcialmente</span></td>
+ <td>pre-GDP</td>
+ </tr>
+ <tr align="left">
+ <td>Comunidad<br>(2401)</td>
+ <td>Francisco Vila</td>
+ <td></td>
+ <td><span style="background-color: #1fff1f">sí</span></td>
+ <td><span style="background-color: #33ff21">parcialmente</span></td>
+ <td>pre-GDP</td>
+ </tr>
+</table>
+<p></p>
+
</body>
</html>
@vskip 0pt plus 1filll
@c @vskip 20pt
-@insertcopying{}
+@insertcopying
Para LilyPond versión @version{}
@end titlepage
@rlearning{Écriture de chants simples}.
@item
-La musisque vocale nécessite souvent de recourir au mode @code{markup},
+La musique vocale nécessite souvent de recourir au mode @code{markup},
aussi bien pour des paroles que pour d'autres éléments textuels comme le
nom des personnages. Cette syntaxe est expliquée dans
@ref{Introduction au formatage de texte}.
- <p><i>Dernière mise à jour Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Dernière mise à jour Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
<th>Autres informations</th>
</tr>
<tr align="left">
- <td>Titre des chapitres<br>(132)</td>
+ <td>Titre des chapitres<br>(122)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude</td>
<td></td>
<td>post-GDP</td>
</tr>
<tr align="left">
- <td>1 Tutoriel<br>(2941)</td>
+ <td>1 Tutoriel<br>(3145)</td>
<td>Nicolas Grandclaude<br>
Ludovic Sardain<br>
Gauvain Pocentek</td>
Valentin Villenave<br>
John Mandereau</td>
<td><span style="background-color: #1fff1f">oui</span></td>
- <td><span style="background-color: #ff6959">partiellement</span></td>
+ <td><span style="background-color: #ff6b58">partiellement</span></td>
<td>post-GDP</td>
</tr>
<tr align="left">
<th>Autres informations</th>
</tr>
<tr align="left">
- <td>Titre des chapitres<br>(467)</td>
+ <td>Titre des chapitres<br>(353)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude</td>
<td></td>
<td><span style="background-color: #1fff1f">oui</span></td>
- <td><span style="background-color: #dbff38">partiellement</span></td>
+ <td><span style="background-color: #ffda43">partiellement</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>4 Gestion de l'espace<br>(8793)</td>
+ <td>4 Gestion de l'espace<br>(9247)</td>
<td>Frédéric Chiasson<br>
Jean-Charles Malahieude</td>
<td></td>
<td><span style="background-color: #dfef77">partiellement (6 %)</span></td>
- <td><span style="background-color: #ffea40">partiellement</span></td>
+ <td><span style="background-color: #ff645a">partiellement</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>5 Modification des réglages prédéfinis<br>(11458)</td>
- <td>Valentin Villenave</td>
+ <td>5 Modification des réglages prédéfinis<br>(11871)</td>
+ <td>Valentin Villenave<br>
+ Jean-Charles Malahieude</td>
<td>Gilles Thibault</td>
- <td><span style="background-color: #dfef77">partiellement (40 %)</span></td>
+ <td><span style="background-color: #dfef77">partiellement (35 %)</span></td>
<td><span style="background-color: #ff6759">partiellement</span></td>
<td>pré-GDP</td>
</tr>
<th>Autres informations</th>
</tr>
<tr align="left">
- <td>Titre des chapitres<br>(145)</td>
+ <td>Titre des chapitres<br>(135)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude</td>
<td></td>
Jean-Charles Malahieude</td>
<td></td>
<td><span style="background-color: #d0f0f8">non</span></td>
- <td><span style="background-color: #62ff28">partiellement</span></td>
+ <td><span style="background-color: #68ff28">partiellement</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
<th>Autres informations</th>
</tr>
<tr align="left">
- <td>Titre des chapitres<br>(251)</td>
+ <td>Titre des chapitres<br>(478)</td>
<td>Test</td>
<td></td>
<td><span style="background-color: #1fff1f">oui</span></td>
- <td><span style="background-color: #ff7257">partiellement</span></td>
+ <td><span style="background-color: #ff6d58">partiellement</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>Introduction<br>(3647)</td>
+ <td>Introduction<br>(3652)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">non</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>Download<br>(1036)</td>
+ <td>Download<br>(979)</td>
<td></td>
<td></td>
- <td><span style="background-color: #d0f0f8">non</span></td>
+ <td><span style="background-color: #dfef77">partiellement (3 %)</span></td>
<td></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>Manuals<br>(2089)</td>
+ <td>Manuals<br>(1948)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">non</span></td>
<td>pré-GDP</td>
</tr>
<tr align="left">
- <td>Community<br>(2385)</td>
+ <td>Community<br>(2401)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">non</span></td>
@vskip 0pt plus 1filll
-@insertcopying{}
+@insertcopying
A LilyPond @version{} verziójához
@end titlepage
- <p><i>Last updated Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Last updated Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
</p>
<tr align="left">
- <td>A LilyPond tárgymutató<br>(132)</td>
+ <td>A LilyPond tárgymutató<br>(122)</td>
<td>Harmath Dénes</td>
<td></td>
<td><span style="background-color: #1fff1f">yes</span></td>
- <td><span style="background-color: #1fff1f">yes</span></td>
+ <td><span style="background-color: #47ff24">partially</span></td>
<td>pre-GDP</td>
</tr>
<table align="center" border="2">
</table>
<p></p>
<tr align="left">
- <td>1 Első lecke<br>(2941)</td>
+ <td>1 Első lecke<br>(3145)</td>
<td>Harmath Dénes</td>
<td></td>
<td><span style="background-color: #dfef77">partially (95 %)</span></td>
- <td><span style="background-color: #97ff2f">partially</span></td>
+ <td><span style="background-color: #54ff26">partially</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>2 Elemi kottaírás<br>(4138)</td>
+ <td>2 Elemi kottaírás<br>(4035)</td>
<td>Harmath Dénes</td>
<td></td>
<td><span style="background-color: #1fff1f">yes</span></td>
- <td><span style="background-color: #1fff1f">yes</span></td>
+ <td><span style="background-color: #25fe1f">partially</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
@vskip 0pt plus 1filll
-@insertcopying{}
+@insertcopying
Per la versione di LilyPond @version{}
@end titlepage
- <p><i>Last updated Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Last updated Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
</p>
<tr align="left">
- <td>4 Tweaking output<br>(132)</td>
+ <td>4 Tweaking output<br>(122)</td>
<td>Federico Bruni</td>
<td>Luca Rossetto Casel</td>
<td><span style="background-color: #dfef77">partially (93 %)</span></td>
</table>
<p></p>
<tr align="left">
- <td>1 Tutorial<br>(2941)</td>
+ <td>1 Tutorial<br>(3145)</td>
<td>Federico Bruni</td>
<td>Luca Rossetto Casel</td>
<td><span style="background-color: #1fff1f">yes</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>2 Notazione comunemente utilizzata<br>(4138)</td>
+ <td>2 Notazione comunemente utilizzata<br>(4035)</td>
<td>Federico Bruni</td>
<td>Luca Rossetto Casel</td>
<td><span style="background-color: #1fff1f">yes</span></td>
- <p><i>最終更新日 Sun Dec 13 21:12:26 UTC 2009
+ <p><i>最終更新日 Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
<th>その他の情報</th>
</tr>
<tr align="left">
- <td>セクション タイトル<br>(132)</td>
+ <td>セクション タイトル<br>(122)</td>
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #1fff1f">はい</span></td>
<td>post-GDP</td>
</tr>
<tr align="left">
- <td>1 チュートリアル<br>(2941)</td>
+ <td>1 チュートリアル<br>(3145)</td>
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #1fff1f">はい</span></td>
<td>post-GDP</td>
</tr>
<tr align="left">
- <td>2 一般的な記譜法<br>(4138)</td>
+ <td>2 一般的な記譜法<br>(4035)</td>
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #1fff1f">はい</span></td>
<th>その他の情報</th>
</tr>
<tr align="left">
- <td>セクション タイトル<br>(145)</td>
+ <td>セクション タイトル<br>(135)</td>
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #1fff1f">はい</span></td>
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #dfef77">一部 (58 %)</span></td>
- <td><span style="background-color: #ffea40">partially</span></td>
+ <td><span style="background-color: #ffed40">partially</span></td>
<td>post-GDP</td>
</tr>
<tr align="left">
<td>Yoshiki Sawada</td>
<td></td>
<td><span style="background-color: #d0f0f8">いいえ</span></td>
- <td><span style="background-color: #47ff24">partially</span></td>
+ <td><span style="background-color: #40fe23">partially</span></td>
<td>post-GDP</td>
</tr>
<tr align="left">
@menu
* Organizing pieces with variables::
-* Version number::
* Adding titles::
* Absolute note names::
* After the tutorial::
@end example
-@node Version number
-@subsection Version number
-
-@cindex versioning
-@cindex version
-@cindex version number
-@cindex upgrades
-@cindex future upgrades
-@cindex updating files
-@cindex files, updating
-
-@funindex \version
-@funindex version
-@funindex convert-ly
-
-The @code{\version} statement records the version of LilyPond that
-was used to write the file:
-
-@example
-\version @w{"@version{}"}
-@end example
-
-@noindent
-By convention, this is placed at the top of your LilyPond file.
-
-These annotations make future upgrades of LilyPond go more
-smoothly. Changes in the syntax are handled with a special
-program, @command{convert-ly}, and it uses @code{\version} to
-determine what rules to apply. For details, see
-@rprogram{Updating files with convert-ly}.
-
-
@node Adding titles
@subsection Adding titles
This example shows a simple input file:
@example
+\version "@w{@version{}}"
@{
c' e' g' e'
@}
@subheading Producing output
-@c TODO: move index entries
@cindex PDF file
@cindex viewing music
@cindex text editors
-@cindex running LilyPond under MacOS X
-@cindex MacOS X, running LilyPond
-@cindex running LilyPond under Windows
-@cindex Windows, running LilyPond
-@cindex running LilyPond under Unix
-@cindex Unix, running LilyPond
The method of producing output depends on your operating system
and the program(s) you use.
minute or two because all of the system fonts have to be analyzed
first. After this, LilyPond will be much faster!}
+@cindex running LilyPond under MacOS X
+@cindex MacOS X, running LilyPond
@node MacOS X
@subsection MacOS X
from a previous compilation open, then any further compilations
may fail to generate an update PDF until you close the original.
+@cindex running LilyPond under Windows
+@cindex Windows, running LilyPond
@node Windows
@subsection Windows
PDF if you wish to make a new compilation as it may fail to create
the new PDF while it is still being viewed.
+@cindex running LilyPond under Unix
+@cindex Unix, running LilyPond
@node Command-line
@subsection Command-line
Create a text file called @file{test.ly} and enter:
@example
+\version "@w{@version{}}"
@{
c' e' g' e'
@}
@subsubheading Step 2. Compile (with command-line)
-To process @file{test.ly}, proceed as follows:
+To process @file{test.ly}, type the following at the command prompt:
@example
lilypond test.ly
You will see something resembling:
@example
-lilypond test.ly
GNU LilyPond @version{}
Processing `test.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...
-Finding the ideal number of pages...
-Fitting music on 1 page...
+Solving 1 page-breaking chunks...[1: 1 pages]
Drawing systems...
Layout output to `test.ps'...
-Converting to `test.pdf'...
+Converting to `./test.pdf'...
@end example
@subsubheading Step 3. View output
@cindex case sensitive
@cindex whitespace insensitive
@cindex expressions
+@cindex versioning
+@cindex version
+@cindex version number
+@funindex \version
@funindex { ... }
@funindex %
@funindex %@{ ... %@}
LilyPond input files are similar to source files in many common
-programming languages. They are case sensitive, and white-space
+programming languages. They contain a version statement,
+are case sensitive, and white-space
is generally ignored. Expressions are formed with curly braces
@{ @}, and comments are denoted with @code{%} or
@w{@code{%@{ ... %@}}}.
@itemize
+@item
+@strong{Version statement}:
+Every LilyPond file should contain a version statement. A version
+statement is a line that describes the version of LilyPond for which
+the file was written, as in the following example:
+
+@example
+\version "@w{@version{}}"
+@end example
+
+By convention, the version statement is placed at the top of the
+LilyPond file.
+
+The version statement is important for at least two reasons. First,
+it allows automatic updating of the input file as LilyPond syntax
+changes. Second, it describes the version of LilyPond needed to
+compile the file.
+
+If the version statement is omitted from an input file, LilyPond will print
+a warning during the compilation of the file.
+
@item
@strong{Case sensitive}:
it matters whether you enter a letter in lower case (e.g.
online version.
@menu
-* Omitting braces::
+* Omitted material::
* Clickable examples::
* Keyboard navigation::
* Overview of manuals::
@end menu
-@node Omitting braces
-@subsection Omitting braces
+@node Omitted material
+@subsection Omitted material
@cindex how to read the manual
own. Most people want to add material to an existing piece, so we
format the manual this way.
+Also, remember that every LilyPond file should have a @code{@bs{}version}
+statement. Because the examples in the manuals are snippets, not files,
+the @code{@bs{}version} statement is omitted. But you should make a
+practice of including them in your files.
@node Clickable examples
@subsection Clickable examples
@vskip 0pt plus 1filll
-@insertcopying{}
+@insertcopying
For LilyPond version @version{}
@end titlepage
- <p><i>Last updated Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Last updated Wed Dec 23 19:23:34 UTC 2009
</i></p>
<html>
<!-- This page is automatically generated by translation-status.py from
<th>Other info</th>
</tr>
<tr align="left">
- <td>Section titles<br>(132)</td>
+ <td>Section titles<br>(122)</td>
<td></td>
<td></td>
<td><span style="background-color: #dfef77">partially (93 %)</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>1 Common notation<br>(4138)</td>
+ <td>1 Common notation<br>(4035)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">no</span></td>
<th>Other info</th>
</tr>
<tr align="left">
- <td>Section titles<br>(467)</td>
+ <td>Section titles<br>(353)</td>
<td></td>
<td></td>
- <td><span style="background-color: #dfef77">partially (61 %)</span></td>
+ <td><span style="background-color: #dfef77">partially (49 %)</span></td>
<td></td>
<td>pre-GDP</td>
</tr>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>4 Spacing issues<br>(8793)</td>
+ <td>4 Spacing issues<br>(9247)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">no</span></td>
<td>pre-GDP</td>
</tr>
<tr align="left">
- <td>5 Changing defaults<br>(11458)</td>
+ <td>5 Changing defaults<br>(11871)</td>
<td></td>
<td></td>
<td><span style="background-color: #d0f0f8">no</span></td>
<th>Other info</th>
</tr>
<tr align="left">
- <td>Section titles<br>(145)</td>
+ <td>Section titles<br>(135)</td>
<td></td>
<td></td>
<td><span style="background-color: #dfef77">partially (94 %)</span></td>
printable area (ie. the top of the bottom margin).
See @var{after-title-spacing}.
-@item foot-separation
-@funindex foot-separation
-
-Distance between the bottom-most music system and the page
-footer. Default: @code{4\mm}.
-
@item top-title-spacing
@funindex top-title-spacing
like a staff. Conversely, setting @var{staff-affinity} for a staff will
cause it to be treated like a non-staff.
-@c FIXME: is it possible to have @example inside @warning?
-@c @warning{ Adjacent non-staff lines should have non-increasing
-@c @var{staff-affinity} from top-to-bottom. For example, the behavior of
-@c @example
-@c <<
-@c \new Staff c
-@c \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #DOWN @}
-@c \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #UP @}
-@c \new Staff c
-@c >>
-@c @end example
-@c is undefined.
-@c }
-
-@warning{A non-staff line at the bottom of a system should have
-@var{staff-affinity} set to @code{UP}. Similarly, a non-staff
-line at the top of a system should have @var{staff-affinity} set
-to @code{DOWN}.
-}
-
Non-staff lines admit three properties to control their spacing. Each
of the these properties is an alist of the same format as
@var{next-staff-spacing}, above.
@rinternals{VerticalAlignment},
@rinternals{Axis_group_engraver}.
-
-@node Vertical spacing between systems
-@subsection Vertical spacing between systems
-
-Space between systems are controlled by four @code{\paper} variables,
-
+@knownissues
+Adjacent non-staff lines should have non-increasing
+@var{staff-affinity} from top-to-bottom. For example, the behavior of
@example
-\paper @{
- between-system-space = 1.5\cm
- between-system-padding = #1
- ragged-bottom=##f
- ragged-last-bottom=##f
-@}
+<<
+ \new Staff c
+ \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #DOWN @}
+ \new Lyrics \with @{ \override VerticalAxisGroup #'staff-affinity = #UP @}
+ \new Staff c
+>>
@end example
+is undefined.
-When only a couple of flat systems are placed on a page, the resulting
-vertical spacing may be non-elegant: one system at the top of the page,
-and the other at the bottom, with a huge gap between them. To avoid this
-situation, the space added between the systems can be limited. This
-feature is activated by setting to @code{#t} the
-@code{page-limit-inter-system-space} variable in the @code{\paper}
-block. The paper variable @code{page-limit-inter-system-space-factor}
-determines how much the space can be increased: for instance, the value
-@code{1.3} means that the space can be 30% larger than what it would be
-on a ragged-bottom page.
-
-In the following example, if the inter system space were not limited,
-the second system of page 1 would be placed at the page bottom. By
-activating the space limitation, the second system is placed closer to
-the first one. By setting @code{page-limit-inter-system-space-factor} to
-@code{1}, the spacing would the same as on a ragged-bottom page, like
-the last one.
+A non-staff line at the bottom of a system should have
+@var{staff-affinity} set to @code{UP}. Similarly, a non-staff
+line at the top of a system should have @var{staff-affinity} set
+to @code{DOWN}.
-@lilypond[verbatim]
-#(set-default-paper-size "a6")
-\book {
- \paper {
- page-limit-inter-system-space = ##t
- page-limit-inter-system-space-factor = 1.3
-
- oddFooterMarkup = \markup "page bottom"
- evenFooterMarkup = \markup "page bottom"
- oddHeaderMarkup = \markup \fill-line {
- "page top" \fromproperty #'page:page-number-string }
- evenHeaderMarkup = \markup \fill-line {
- "page top" \fromproperty #'page:page-number-string }
- }
- \new Staff << \repeat unfold 4 { g'4 g' g' g' \break }
- { s1*2 \pageBreak } >>
-}
-@end lilypond
+@node Vertical spacing between systems
+@subsection Vertical spacing between systems
+The mechanisms that control spacing between systems are similar to those
+that control spacing between staves within a system (see
+@ref{Vertical spacing inside a system}). The main difference is that
+the variables to control spacing between systems are set in the
+@code{\paper} block, rather than as grob properties. These paper block
+variables are @var{between-system-spacing},
+@var{between-scores-system-spacing}, @var{after-title-spacing},
+@var{before-title-spacing}, @var{between-title-spacing},
+@var{top-system-spacing}, @var{top-system-spacing},
+@var{top-title-spacing} and @var{bottom-system-spacing}. Note that
+these variables ignore non-staff lines. For example,
+@var{between-system-spacing} controls the spacing from the middle staff
+line of the bottom staff from one system to the middle staff line of the
+top staff of the next system, whether or not there are lyrics below the
+upper system. See @ref{Vertical dimensions} for a description of each
+of these variables.
+
+There are two more @code{\paper} block variables that affect vertical
+spacing: if @var{ragged-bottom} is set to @code{##t} then no pages will
+be stretched (which means that neither the space between systems nor the
+space within systems will be stretched). If @var{ragged-last-bottom}
+is set to @code{##t} then the last page will not be stretched.
@seealso
Snippets:
vertical positions on the page.
@code{NonMusicalPaperColumn #'line-break-system-details} accepts an associative
-list of five different settings:
+list of three different settings:
@itemize
@item @code{X-offset}
@item @code{Y-offset}
-@item @code{alignment-offsets}
-@item @code{alignment-extra-space}
-@item @code{fixed-alignment-extra-space}
+@item @code{alignment-distances}
@end itemize
Grob overrides, including the overrides for @code{NonMusicalPaperColumn}
#'line-break-system-details #'((X-offset . 20) (Y-offset . 40))
\overrideProperty NonMusicalPaperColumn
- #'line-break-system-details #'((alignment-offsets . (0 -15)))
+ #'line-break-system-details #'((alignment-distances . (15)))
\overrideProperty NonMusicalPaperColumn
#'line-break-system-details #'((X-offset . 20) (Y-offset . 40)
- (alignment-offsets . (0 -15)))
+ (alignment-distances . (15)))
@end example
To understand how each of these different settings work, we begin
position on the page at which each new system will render.
Now that we have set the vertical startpoint of each system
-explicitly, we can also set the vertical startpoint of each staff
-within each system manually. We do this using the @code{alignment-offsets}
+explicitly, we can also set the vertical distances between staves
+within each system manually. We do this using the @code{alignment-distances}
subproperty of @code{line-break-system-details}.
@lilypond[quote]
\new Voice {
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 20)
- (alignment-offsets . (0 -15)))
+ (alignment-distances . (15)))
s1*5 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 60)
- (alignment-offsets . (0 -15)))
+ (alignment-distances . (15)))
s1*5 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 100)
- (alignment-offsets . (0 -15)))
+ (alignment-distances . (15)))
s1*5 \break
}
\new Voice { \repeat unfold 15 { c'4 c' c' c' } }
@code{line-break-system-details} attribute alist accepts many
additional spacing parameters (including, for example, a corresponding
@code{X-offset} pair), we need only set the @code{Y-offset} and
-@code{alignment-offsets} pairs to control the vertical startpoint of
-every system and every staff. Finally, note that @code{alignment-offsets}
+@code{alignment-distances} pairs to control the vertical startpoint of
+every system and every staff. Finally, note that @code{alignment-distances}
specifies the vertical positioning of staves but not of staff groups.
@lilypond[quote]
\new Voice {
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 0)
- (alignment-offsets . (0 -30 -40)))
+ (alignment-distances . (30 10)))
s1*5 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 60)
- (alignment-offsets . (0 -10 -20)))
+ (alignment-distances . (10 10)))
s1*5 \break
\overrideProperty #"Score.NonMusicalPaperColumn"
#'line-break-system-details #'((Y-offset . 100)
- (alignment-offsets . (0 -10 -40)))
+ (alignment-distances . (10 30)))
s1*5 \break
}
\new Voice { \repeat unfold 15 { c'4 c' c' c' } }
Some points to consider:
@itemize
-@item When using @code{alignment-offsets}, lyrics count as a staff.
+@item When using @code{alignment-distances}, lyrics and other non-staff lines
+do not count as a staff.
@item The units of the numbers passed to @code{X-offset},
-@code{Y-offset} and @code{alignment-offsets} are interpreted as multiples
+@code{Y-offset} and @code{alignment-distances} are interpreted as multiples
of the distance between adjacent staff lines. Positive values move staves
and lyrics up, negative values move staves and lyrics down.
is finished.
</p>
- <p><i>Last updated Sun Dec 13 21:12:26 UTC 2009
+ <p><i>Last updated Wed Dec 23 19:23:34 UTC 2009
</i></p>
<table align="center" border="2">
<tr align="center">
<p></p>
<tr align="left">
- <td>A LilyPond index<br>(103)</td>
+ <td>A LilyPond index<br>(93)</td>
<td>Till Paala<br>
<span style="background-color: #1fff1f">translated</span><br>
<span style="background-color: #ffc746">partially up to date</span><br>
</tr>
<tr align="left">
- <td>A LilyPond index<br>(132)</td>
+ <td>A LilyPond index<br>(122)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude<br>
<span style="background-color: #1fff1f">translated</span><br>
</td>
<td>Harmath Dénes<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #1fff1f">up to date</span><br>
+ <span style="background-color: #47ff24">partially up to date</span><br>
</td>
<td>Yoshiki Sawada<br>
<span style="background-color: #1fff1f">translated</span><br>
</table>
<p></p>
<tr align="left">
- <td>1 Tutorial<br>(2941)</td>
+ <td>1 Tutorial<br>(3145)</td>
<td>Francisco Vila<br>
<span style="background-color: #1fff1f">translated</span><br>
<span style="background-color: #ff625a">partially up to date</span><br>
Valentin Villenave<br>
John Mandereau</small><br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #ff6959">partially up to date</span><br>
+ <span style="background-color: #ff6b58">partially up to date</span><br>
</td>
<td>Federico Bruni<br>
<small>Luca Rossetto Casel</small><br>
</td>
<td>Harmath Dénes<br>
<span style="background-color: #dfef77">partially translated (95 %)</span><br>
- <span style="background-color: #97ff2f">partially up to date</span><br>
+ <span style="background-color: #54ff26">partially up to date</span><br>
</td>
</tr>
<tr align="left">
- <td>2 Common notation<br>(4138)</td>
+ <td>2 Common notation<br>(4035)</td>
<td>Yoshiki Sawada<br>
<span style="background-color: #1fff1f">translated</span><br>
<span style="background-color: #ff6d58">partially up to date</span><br>
</td>
<td>Till Rettig<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #1fff1f">up to date</span><br>
+ <span style="background-color: #25fe1f">partially up to date</span><br>
</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
</td>
<td>Harmath Dénes<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #1fff1f">up to date</span><br>
+ <span style="background-color: #25fe1f">partially up to date</span><br>
</td>
</tr>
<tr align="left">
</tr>
<tr align="left">
- <td>B LilyPond grammar<br>(467)</td>
+ <td>B LilyPond grammar<br>(353)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #dbff38">partially up to date</span><br>
+ <span style="background-color: #ffda43">partially up to date</span><br>
</td>
<td>Till Paala<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #dbff38">partially up to date</span><br>
+ <span style="background-color: #ffda43">partially up to date</span><br>
</td>
- <td> <span style="background-color: #dfef77">partially translated (61 %)</span><br>
+ <td> <span style="background-color: #dfef77">partially translated (49 %)</span><br>
</td>
<td>Francisco Vila<br>
<span style="background-color: #1fff1f">translated</span><br>
</td>
</tr>
<tr align="left">
- <td>4 Spacing issues<br>(8793)</td>
+ <td>4 Spacing issues<br>(9247)</td>
<td>Frédéric Chiasson<br>
Jean-Charles Malahieude<br>
<span style="background-color: #dfef77">partially translated (6 %)</span><br>
- <span style="background-color: #ffea40">partially up to date</span><br>
+ <span style="background-color: #ff645a">partially up to date</span><br>
</td>
<td>Till Paala<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #4efe25">partially up to date</span><br>
+ <span style="background-color: #8aff2d">partially up to date</span><br>
</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
<td>Francisco Vila<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #4efe25">partially up to date</span><br>
+ <span style="background-color: #8aff2d">partially up to date</span><br>
</td>
</tr>
<tr align="left">
- <td>5 Changing defaults<br>(11458)</td>
+ <td>5 Changing defaults<br>(11871)</td>
<td>Valentin Villenave<br>
+ Jean-Charles Malahieude<br>
<small>Gilles Thibault</small><br>
- <span style="background-color: #dfef77">partially translated (40 %)</span><br>
+ <span style="background-color: #dfef77">partially translated (35 %)</span><br>
<span style="background-color: #ff6759">partially up to date</span><br>
</td>
<td>Till Paala<br>
- <span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #47ff24">partially up to date</span><br>
+ <span style="background-color: #dfef77">partially translated (96 %)</span><br>
+ <span style="background-color: #54ff26">partially up to date</span><br>
</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
<td>Francisco Vila<br>
- <span style="background-color: #dfef77">partially translated (96 %)</span><br>
- <span style="background-color: #54ff26">partially up to date</span><br>
+ <span style="background-color: #dfef77">partially translated (93 %)</span><br>
+ <span style="background-color: #62ff28">partially up to date</span><br>
</td>
</tr>
<tr align="left">
</tr>
<tr align="left">
- <td>C LilyPond index<br>(145)</td>
+ <td>C LilyPond index<br>(135)</td>
<td>John Mandereau<br>
Jean-Charles Malahieude<br>
<span style="background-color: #1fff1f">translated</span><br>
</td>
<td>Yoshiki Sawada<br>
<span style="background-color: #dfef77">partially translated (58 %)</span><br>
- <span style="background-color: #ffea40">partially up to date</span><br>
+ <span style="background-color: #ffed40">partially up to date</span><br>
</td>
<td>Francisco Vila<br>
<span style="background-color: #dfef77">partially translated (80 %)</span><br>
<td>John Mandereau<br>
Jean-Charles Malahieude<br>
<span style="background-color: #d0f0f8">not translated</span><br>
- <span style="background-color: #62ff28">partially up to date</span><br>
+ <span style="background-color: #68ff28">partially up to date</span><br>
</td>
<td>Reinhold Kainhofer<br>
<small>Till Paala</small><br>
</td>
<td>Yoshiki Sawada<br>
<span style="background-color: #d0f0f8">not translated</span><br>
- <span style="background-color: #47ff24">partially up to date</span><br>
+ <span style="background-color: #40fe23">partially up to date</span><br>
</td>
<td>Francisco Vila<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #47ff24">partially up to date</span><br>
+ <span style="background-color: #40fe23">partially up to date</span><br>
</td>
</tr>
<tr align="left">
<tr align="center">
<th>LilyPond... music notation for everyone</th> <th>fr</th>
<th>nl</th>
+ <th>es</th>
</tr>
<tr align="left">
- <td>Section titles<br>(251)</td>
+ <td>Section titles<br>(478)</td>
<td>Test<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #ff7257">partially up to date</span><br>
+ <span style="background-color: #ff6d58">partially up to date</span><br>
</td>
<td>Test<br>
<span style="background-color: #1fff1f">translated</span><br>
- <span style="background-color: #ff7257">partially up to date</span><br>
+ <span style="background-color: #ff6d58">partially up to date</span><br>
+ </td>
+ <td>Francisco Vila<br>
+ <span style="background-color: #1fff1f">translated</span><br>
+ <span style="background-color: #efff3a">partially up to date</span><br>
</td>
</tr>
<table align="center" border="2">
<span style="background-color: #dfef77">partially translated (17 %)</span><br>
<span style="background-color: #ff6b58">partially up to date</span><br>
</td>
- <td><br>
+ <td>Francisco Vila<br>
<span style="background-color: #dfef77">partially translated (17 %)</span><br>
<span style="background-color: #ffd544">partially up to date</span><br>
</td>
</table>
<p></p>
<tr align="left">
- <td>Introduction<br>(3647)</td>
+ <td>Introduction<br>(3652)</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
- <td>so far it's mostly from<br>
+ <td>Test<br>
<span style="background-color: #dfef77">partially translated (6 %)</span><br>
<span style="background-color: #d587ff"></span><br>
</td>
+ <td>Francisco Vila<br>
+ <span style="background-color: #1fff1f">translated</span><br>
+ <span style="background-color: #2cff20">partially up to date</span><br>
+ </td>
</tr>
<tr align="left">
- <td>Download<br>(1036)</td>
- <td> <span style="background-color: #d0f0f8">not translated</span><br>
+ <td>Download<br>(979)</td>
+ <td> <span style="background-color: #dfef77">partially translated (3 %)</span><br>
</td>
- <td> <span style="background-color: #d0f0f8">not translated</span><br>
+ <td> <span style="background-color: #dfef77">partially translated (3 %)</span><br>
+ </td>
+ <td>Francisco Vila<br>
+ <span style="background-color: #1fff1f">translated</span><br>
+ <span style="background-color: #83fe2c">partially up to date</span><br>
</td>
</tr>
<tr align="left">
- <td>Manuals<br>(2089)</td>
+ <td>Manuals<br>(1948)</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
- <td> <span style="background-color: #dfef77">partially translated (12 %)</span><br>
+ <td> <span style="background-color: #dfef77">partially translated (13 %)</span><br>
+ </td>
+ <td>Francisco Vila<br>
+ <span style="background-color: #1fff1f">translated</span><br>
+ <span style="background-color: #9eff30">partially up to date</span><br>
</td>
</tr>
<tr align="left">
- <td>Community<br>(2385)</td>
+ <td>Community<br>(2401)</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
<td> <span style="background-color: #d0f0f8">not translated</span><br>
</td>
+ <td>Francisco Vila<br>
+ <span style="background-color: #1fff1f">translated</span><br>
+ <span style="background-color: #33ff21">partially up to date</span><br>
+ </td>
</tr>
</table>
<p></p>
@vskip 0pt plus 1filll
@c @vskip 20pt
-@insertcopying{}
+@insertcopying
For LilyPond version @version{}
@end titlepage
@item
@sourceimage{logo-fedora,,,}
-@uref{http://koji.fedoraproject.org/koji/packageinfo?packageID=2447
-Fedora: LilyPond 2.12.0}
+@uref{http://koji.fedoraproject.org/koji/packageinfo?packageID=2447,
+Fedora: LilyPond 2.12.2}
@item
@sourceimage{logo-ubuntu,,,}
@item
@sourceimage{logo-suse,,,}
-@uref{http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/
+@uref{http://download.opensuse.org/repositories/openSUSE:/Factory:/Contrib/standard/,
openSUSE: LilyPond 2.12.2}
@end itemize
find $(outdir) -name '*-root' | xargs rm -rf
$(buildscript-dir)/www_post $(PACKAGE_NAME) $(TOPLEVEL_VERSION) $(outdir) "$(WEB_TARGETS)"
find $(outdir)/offline-root -type l -delete
- cd $(outdir)/offline-root/Documentation && ln -sf ./ v$(MAJOR_VERSION).$(MINOR_VERSION)
endif # ifeq ($(out),www)
# For those who cannot for the life in them remember to type
################################################################
# website (without the rest of the docs)
-web-version:
- touch $(top-src-dir)/Documentation/web.texi
- cd $(top-build-dir)/Documentation && make out=www WEB_VERSION=yes out-www/web/index.html
-
+website:
+ $(MAKE) out=www -C Documentation website
################################################################
# testing
--- /dev/null
+\version "2.13.10"
+
+\header { texidoc = "A sample tablature with lettered tab,
+using fretLabels to modify the fret letters.
+
+By default, letters are drawn sequentially from the alphabet,
+but if the context property fretLabels is defined, these are
+substituted. If specified, the length of fretLabels must be
+sufficient to label all the frets used. A warning is issued
+if the length is too short.
+"
+}
+
+notes = \relative c' {
+ \time 3/4
+ <f d>4. <bes>8 <g e>4
+ \set fretLabels = #`("a" "b" ,(markup #:italic #:smaller "c"))
+ <f d>4. <bes>8 <g e>4
+ \set fretLabels = #`(,(markup #:with-color red "a")
+ "b"
+ ,(markup #:italic #:smaller "c"))
+ <f d>4. <bes>8 <g e>4
+ \set fretLabels = #'("α" "β" "γ")
+ <f d>4. <bes>8 <g e>4
+}
+
+\score {
+ \new TabStaff
+ \with {
+ stringTunings = #'(17 14 9 5 2 -3)
+ tablatureFormat = #fret-letter-tablature-format
+ }
+ \new TabVoice {
+ \notes
+ }
+}
+
+
+
--- /dev/null
+\version "2.13.10"
+
+\header { texidoc = "If the 'whiteout property of a
+grob is set to #t, that part of all objects in lower
+layers which falls under the extent of the grob is
+whited out. Here the TimeSignature whites out the
+Tie but not the StaffSymbol.
+"
+}
+
+\relative c' {
+ \time 3/4
+ \override Staff.StaffSymbol #'layer = #4
+ \once \override Tie #'layer = #2
+ b'2.~
+ \once \override Staff.TimeSignature #'whiteout = ##t
+ \once \override Staff.TimeSignature #'layer = #3
+ \time 5/4
+ b4
+}
+
" or bottom to top. For vertical alignments of staves, the"
" @code{break-system-details} of the left"
" @rinternals{NonMusicalPaperColumn} may be set to tune"
- " vertical spacing. Set @code{alignment-extra-space} to add"
- " extra space for staves. Set"
- " @code{fixed-alignment-extra-space} to force staves in"
- " @code{PianoStaff}s further apart.",
+ " vertical spacing.",
/* properties */
"align-dir "
retval = Stencil (retval.extent_box (), expr);
}
+ /* process whiteout */
+ if (to_boolean (get_property ("whiteout")))
+ {
+ /* Call the scheme procedure stencil-whiteout in scm/stencils.scm */
+ /* to add a round-filled-box stencil to the stencil list */
+ retval
+ = *unsmob_stencil (scm_call_1 (ly_lily_module_constant ("stencil-whiteout"),
+ retval.smobbed_copy()));
+ }
}
return retval;
"staff-symbol "
"stencil "
"transparent "
+ "whiteout "
);
/****************************************************************
"TabNoteHead ",
/* read */
+ "fretLabels "
+ "highStringOne "
"middleCPosition "
- "stringTunings "
"minimumFret "
- "tablatureFormat "
- "highStringOne "
- "stringOneTopmost ",
+ "stringOneTopmost "
+ "stringTunings "
+ "tablatureFormat ",
/* write */ ""
);
#include "context.hh"
#include "stream-event.hh"
#include "translator.icc"
-// #include "international.hh"
-#include <deque>
+#include <list>
-struct Head_event_tuple
+struct Head_audio_event_tuple
{
Audio_element_info head_;
- Moment moment_;
- Head_event_tuple () { }
- Head_event_tuple (Audio_element_info h, Moment m)
+ // The end moment of the note, so we can calculate a skip and check whether
+ // the note still goes on
+ Moment end_moment_;
+ Head_audio_event_tuple () {}
+ Head_audio_event_tuple (Audio_element_info h, Moment m)
{
head_ = h;
- moment_ = m;
+ end_moment_ = m;
}
};
class Tie_performer : public Performer
{
Stream_event *event_;
- // We don't really need a deque here. A vector would suffice. However,
- // for some strange reason, using vectors always leads to memory
- // corruption in the STL templates! (i.e. after the first
- // now_heads_.push_back (inf_mom), the now_heads_.size() will be
- // something like 3303820998 :(
- deque<Head_event_tuple> now_heads_;
- deque<Head_event_tuple> now_tied_heads_;
- deque<Head_event_tuple> heads_to_tie_;
+ list<Head_audio_event_tuple> now_heads_;
+ list<Head_audio_event_tuple> now_tied_heads_; // new tied notes
+ list<Head_audio_event_tuple> heads_to_tie_; // heads waiting for closing tie
protected:
void stop_translation_timestep ();
{
if (Audio_note *an = dynamic_cast<Audio_note *> (inf.elem_))
{
-// message (_f ("acknowledge_audio_element, Size of now_heads_=%d", now_heads_.size ()));
- Head_event_tuple inf_mom (inf, now_mom ());
+ // for each tied note, store the info and its end moment, so we can
+ // later on check whether (1) the note is still ongoing and (2) how
+ // long the skip is with tieWaitForNote
+ Head_audio_event_tuple inf_mom (inf, now_mom () + an->length_mom_);
if (an->tie_event_)
now_tied_heads_.push_back (inf_mom);
else
now_heads_.push_back (inf_mom);
-// message (_f ("acknowledge_audio_element, added, Size of now_heads_=%d", now_heads_.size ()));
// Find a previous note that ties to the current note. If it exists,
// remove it from the heads_to_tie vector and create the tie
- deque<Head_event_tuple>::iterator it;
+ list<Head_audio_event_tuple>::iterator it;
bool found = false;
Stream_event *right_mus = inf.event_;
- for ( it = heads_to_tie_.begin() ; (!found) && (it < heads_to_tie_.end()); it++ )
- {
+ for (it = heads_to_tie_.begin ();
+ !found && (it != heads_to_tie_.end());
+ it++)
+ {
Audio_element_info et = (*it).head_;
Audio_note *th = dynamic_cast<Audio_note *> (et.elem_);
Stream_event *left_mus = et.event_;
left_mus->get_property ("pitch")))
{
found = true;
- Moment skip = now_mom() - (*it).moment_ - th->length_mom_;
+ // (*it).moment_ already stores the end of the tied note!
+ Moment skip = now_mom() - (*it).end_moment_;
an->tie_to (th, skip);
// this invalidates the iterator, we are leaving the loop anyway
heads_to_tie_.erase (it);
ly_bool2scm (heads_to_tie_.size ()));
}
+// a predicate implemented as a class, used to delete all tied notes with end
+// moment in the past:
+class end_moment_passed
+{
+protected:
+ Moment now;
+public:
+ end_moment_passed (Moment mom) : now (mom) {}
+ bool operator() (const Head_audio_event_tuple &value) {
+ return (value.end_moment_ <= now);
+ }
+};
+
void
Tie_performer::stop_translation_timestep ()
{
- // We might have dangling open ties like c~ d. Close them, unless we have
- // tieWaitForNote set...
+ // We might have dangling open ties like c~ d. Close them, unless the first
+ // note is still ongoing or we have we have tieWaitForNote set...
if (!to_boolean (get_property ("tieWaitForNote")))
{
- heads_to_tie_.clear ();
+ heads_to_tie_.remove_if (end_moment_passed (now_mom ()));
}
+ // Append now_heads_ and now_tied_heads to heads_to_tie_ for the next time step
if (event_)
{
- for (vsize i = now_heads_.size (); i--;)
- heads_to_tie_.push_back (now_heads_[i]);
+ heads_to_tie_.splice (heads_to_tie_.end (), now_heads_);
}
-
- for (vsize i = now_tied_heads_.size (); i--;)
- heads_to_tie_.push_back (now_tied_heads_[i]);
+ heads_to_tie_.splice (heads_to_tie_.end (), now_tied_heads_);
event_ = 0;
now_heads_.clear ();
blank-after-score-page-force = 2
blank-page-force = 5
- %%
- %% To limit space between systems on a page with a lot of space left
- %%
- page-limit-inter-system-space = ##f
- page-limit-inter-system-space-factor = 1.4
-
#(define font-defaults
'((font-family . feta) (font-encoding . fetaMusic)))
TEXI2HTML_LANG = --lang=$(ISOLANG)
endif
-TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
-
-DOC_TEXI2HTML_SPLIT = --prefix=index --split=section
-WEB_TEXI2HTML_SPLIT = --prefix=index --split=node --node-files
-TEXI2HTML_SPLIT = $(DOC_TEXI2HTML_SPLIT)
-
-$(top-build-dir)/Documentation/$(outdir)/web/index.$(ISOLANG).html:\
- TEXI2HTML_SPLIT := $(WEB_TEXI2HTML_SPLIT)
$(XREF_MAPS_DIR)/web.$(ISOLANG).xref-map:\
XREF_MAP_FLAGS += --split=node
+TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
+
+TEXI2HTML_SPLIT = --prefix=index --split=section
+
TEXI2HTML_INCLUDES += --I=. --I=$(src-dir) --I=$(outdir) $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR)
TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_LANG) $(TEXI2HTML_INIT)
TEXI2HTML = SRC_DIR=$(src-dir) PERL_UNICODE=SD $(TEXI2HTML_PROGRAM)
abovementioned horizontal reflection taken into account), then the prefix
`s' (for `symmetric') should be used. See the existing files for
examples. The numbers in the glyph names refer to the duration of the
- note; e.g., `s0cross' in feta-bolletjes.mf defines the notehead for a
+ note; e.g., `s0cross' in feta-noteheads.mf defines the notehead for a
whole cross-shaped note (similarly, `s1cross' and `s2cross' are for half
and quarter notes, respectively).
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- Accidentals
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+%
+% also show in other configuration wrt staff lines.
+%
+def draw_shifted_too =
+if test > 0:
+ fet_beginchar ("shifted too", "");
+ set_char_box (0, 0, 0, 0);
+ currentpicture := remember_pic;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+enddef;
+
+
+%
+% Accidentals from various sources, notably
+%
+% Baerenreiter edition of Schuberts `Auf dem Strom' (sharp, natural)
+% F Hofmeister edition of Muellers `Etueden fuer Horn' (double sharp, flat)
+%
+
+
+%
+% Naming for accidentals (including microtonal variants):
+%
+% SHARPBASE[.SLASHES.STEMS]
+% FLATBASE[.MODIFIER]
+%
+% Examples:
+%
+% sharp.slashslash.stem
+% mirroredflat.flat
+%
+%
+
+
+fet_begingroup ("accidentals");
+
+%
+% Draw an arrow
+%
+% * `stemslant' gives the direction of the stem's left boundary
+% (needed for brushed stems, equals "up" for straight stems)
+% * `extend' is used to make the stem longer or shorter (if negative);
+% different kinds of accidentals need different values here
+%
+def draw_arrow (expr attach, stemwidth, stemslant, extend, pointingdown) =
+begingroup;
+ save htip; % tip height
+ save wwing; % wing `radius'
+ save angle_wing_bot, angle_wing_top, angle_tip;
+ save upshift;
+ clearxy;
+
+ wwing := 0.26 stemwidth;
+ htip := staff_space * 0.85 + stafflinethickness - wwing;
+
+ % `flip' is used to reflect the arrow vertically
+ % if arrow points downward
+ transform flip;
+ if pointingdown:
+ flip = identity reflectedabout (origin, right);
+ else:
+ flip = identity;
+ fi;
+
+ z1 = attach shifted (-stemwidth / 2, 0);
+ upshift := max (0, wwing + 0.1 staff_space + extend);
+ z2 = z1 shifted (((unitvector stemslant)
+ scaled upshift) transformed flip);
+
+ z7 = attach shifted ((stemwidth/2),0);
+ z6 = z7 shifted (((unitvector (-xpart stemslant, ypart stemslant))
+ scaled upshift) transformed flip);
+ z2 - z3 = ( 0.38 staff_space, 0.05 htip) transformed flip;
+ z6 - z5 = (-0.38 staff_space, 0.05 htip) transformed flip;
+
+ z4 = attach shifted ((-0.2 stemwidth, upshift + htip)
+ transformed flip);
+ z4'= attach shifted (( 0.2 stemwidth, upshift + htip)
+ transformed flip);
+
+ % `angle_wing_bot' is the angle at which the arc
+ % from z2 to z3a enters z3a
+ % `angle_wing_top' is the angle at which the arc
+ % from z3b to z4 leaves z3b
+ % `angle_tip' is the angle at which the arc
+ % from z4 to z4' leaves z4
+ angle_wing_bot = 30;
+ angle_wing_top = 55;
+ angle_tip = 68;
+
+ z3a = z3 shifted ((((dir angle_wing_bot) rotated -90)
+ scaled wwing) transformed flip);
+ z3b = z3 shifted ((((dir angle_wing_top) rotated 90)
+ scaled wwing) transformed flip);
+
+ z5a = z5 shifted ((((dir (180 - angle_wing_bot)) rotated 90)
+ scaled wwing) transformed flip);
+ z5b = z5 shifted ((((dir (180 - angle_wing_top)) rotated -90)
+ scaled wwing) transformed flip);
+
+ % Draw the arrow
+ pickup pencircle scaled 1;
+ fill z1
+ -- z2{stemslant transformed flip}
+ .. {(-dir angle_wing_bot) transformed flip}z3a
+ .. z3b{(dir angle_wing_top) transformed flip}
+ .. z4{(dir angle_tip) transformed flip}
+ .. z4'{(dir (-angle_tip)) transformed flip}
+ .. {(dir (-angle_wing_top)) transformed flip}z5b
+ .. z5a{(-dir (-angle_wing_bot)) transformed flip}
+ .. z6{((-stemslant) reflectedabout (origin, up)) transformed flip}
+ -- z7
+ -- cycle;
+
+ labels (range 0 thru 7, 4', 3a, 3b, 5a, 5b);
+endgroup;
+enddef;
+
+save remember_pic;
+picture remember_pic;
+
+save sharp_beamheight;
+sharp_beamheight# := 0.3 staff_space# + stafflinethickness#;
+
+%
+% The beams of most sharps have horizontal endings (as if drawn with
+% a square pen). [Wanske] does not mention this, so we'll just ignore
+% this fact.
+%
+
+def draw_meta_sharp (expr width, offset) =
+ save beamwidth, beamslope;
+ save ne, nw_dist;
+ pair ne, nw_dist;
+
+ beamwidth := width;
+
+ define_whole_vertical_blacker_pixels (sharp_beamheight);
+
+ clearxy;
+
+ beamslope = sharp_beamheight / beamwidth;
+
+ pickup pencircle scaled 2 blot_diameter;
+
+ rt x2 - lft x1 = beamwidth;
+ z2 = z1 + whatever * (beamwidth, sharp_beamheight);
+ .5 [z1, z3] = (.5 w, offset);
+ x3 = x2;
+ top y2 - bot y3 = sharp_beamheight;
+ x4 = x1;
+ top y1 - bot y4 = sharp_beamheight;
+
+ ne = unitvector (z2 - z1);
+ nw_dist = (ne rotated 90) * blot_diameter;
+
+ fill lft z1{up}
+ ... (z1 + nw_dist){ne}
+ -- (z2 + nw_dist){ne}
+ ... rt z2{down}
+ -- rt z3{down}
+ ... (z3 - nw_dist){-ne}
+ -- (z4 - nw_dist){-ne}
+ ... lft z4{up}
+ -- cycle;
+
+ labels (1, 2, 3, 4);
+enddef;
+
+
+def draw_sharp(expr arrowup, arrowdown) =
+ save stem, stemx, stemwidth;
+ save outer_space, interbeam;
+ save stemlength, extendleft, extendright, height, depth;
+
+ stemwidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (stemwidth);
+
+ interbeam := 1.05 staff_space_rounded;
+
+ stemlength# := 1.5 staff_space#;
+ define_pixels (stemlength);
+
+ height# = stemlength#;
+ depth# = stemlength#;
+ extendright# = 0;
+ extendleft# = 0;
+ if arrowup:
+ height# := height# + 1.2 staff_space#;
+ extendright# := extendright# + 1.5 stafflinethickness#;
+ fi;
+ if arrowdown:
+ depth# := depth# + 1.2 staff_space#;
+ extendleft# := extendleft# + 1.5 stafflinethickness#;
+ fi;
+ define_pixels (extendleft, extendright);
+ set_char_box (extendleft#, 1.1 staff_space#, depth#, height#);
+
+ stem := 7 / 16 * w;
+ stemx := hround stem;
+ outer_space := hround ((w - stemx - stemwidth) / 2);
+
+ w := 2 outer_space + stemx + stemwidth;
+ d := d - feta_space_shift;
+
+ draw_meta_sharp (w, -.5 interbeam);
+ draw_meta_sharp (w, -.5 interbeam + vround interbeam);
+
+ % expand the charbox so that it encloses the whole arrow;
+ % this must not happen earlier because some commands above
+ % still rely on the old width
+ w := w + extendright;
+
+ pickup pencircle scaled stemwidth;
+
+ lft x5 = lft x6 = outer_space;
+ lft x7 = lft x8 = outer_space + stemx;
+ bot y5 = -stemlength;
+ top y6 = vround (1.5 staff_space - stem * beamslope);
+ bot y7 = -top y6 + feta_space_shift;
+ top y8 = stemlength;
+
+ labels (5, 6, 7, 8);
+
+ draw_gridline (z5, z6, stemwidth);
+ draw_gridline (z7, z8, stemwidth);
+
+ if arrowup:
+ draw_arrow (z8, stemwidth, up,
+ stafflinethickness / 2 + stemwidth / 2, false);
+ fi;
+ if arrowdown:
+ draw_arrow (z5, stemwidth, up,
+ stafflinethickness / 2 + stemwidth / 2, true);
+ fi;
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Sharp", "sharp");
+ draw_sharp (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow up)", "sharp.arrowup");
+ draw_sharp (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow down)", "sharp.arrowdown");
+ draw_sharp (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrows up and down)", "sharp.arrowboth");
+ draw_sharp (true, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("1/2 Sharp", "sharp.slashslash.stem");
+ save stem, stemwidth;
+ save outer_space, interbeam;
+
+ stemwidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (stemwidth);
+
+ interbeam := 1.05 staff_space_rounded;
+
+ set_char_box (0, 0.7 staff_space#,
+ 1.5 staff_space#, 1.5 staff_space#);
+
+ stem := 7 / 16 * w;
+ outer_space := hround ((w - stemwidth) / 2);
+
+ w := 2 outer_space + stemwidth;
+ d := d - feta_space_shift;
+
+ draw_meta_sharp (w, -.5 interbeam);
+ draw_meta_sharp (w, -.5 interbeam + vround interbeam);
+
+ pickup pencircle scaled stemwidth;
+
+ lft x5 = lft x6 = outer_space;
+ top y6 = vround (1.5 staff_space - .5 stem);
+ bot y5 = -top y6 + feta_space_shift;
+
+ labels (5, 6);
+
+ draw_gridline (z5, z6, stemwidth);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Sharp (3 beams)", "sharp.slashslashslash.stemstem");
+ save stem, stemx, stemwidth;
+ save outer_space, interbeam;
+ save sharp_beamheight;
+
+ sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
+
+ stemwidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (stemwidth);
+
+ interbeam := 1.2 staff_space_rounded;
+
+ set_char_box (0, 1.1 staff_space#,
+ 1.5 staff_space#, 1.5 staff_space#);
+
+ stem := 7 / 16 * w;
+ stemx := hround stem;
+ outer_space := hround ((w - stemx - stemwidth) / 2);
+
+ w := 2 outer_space + stemx + stemwidth;
+ d := d - feta_space_shift;
+
+ draw_meta_sharp (.88 w, -.5 interbeam);
+ draw_meta_sharp (.88 w, -.5 interbeam + vround interbeam);
+ sharp_beamheight# := 1/.88 sharp_beamheight#;
+ draw_meta_sharp (w, 0);
+
+ pickup pencircle scaled stemwidth;
+
+ lft x5 = lft x6 = outer_space;
+ lft x7 = lft x8 = outer_space + stemx;
+ bot y5 = -d;
+ top y6 = vround (1.5 staff_space - stem * beamslope);
+ bot y7 = -top y6 + feta_space_shift;
+ top y8 = h;
+
+ labels (5, 6, 7, 8);
+
+ draw_gridline (z5, z6, stemwidth);
+ draw_gridline (z7, z8, stemwidth);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("1/2 Sharp (3 beams)", "sharp.slashslashslash.stem");
+ save stem, stemx, stemwidth;
+ save outer_space, interbeam;
+ save sharp_beamheight;
+
+ sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
+
+ stemwidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (stemwidth);
+
+ interbeam := 1.2 staff_space_rounded;
+
+ set_char_box (0, 0.95 staff_space#,
+ 1.3 staff_space#, 1.3 staff_space#);
+
+ stem := 7 / 16 * w;
+ outer_space := hround ((w - stemwidth) / 2);
+
+ w := 2 outer_space + stemwidth;
+ d := d - feta_space_shift;
+
+ draw_meta_sharp (.8 w, -.5 interbeam);
+ draw_meta_sharp (.8 w, -.5 interbeam + vround interbeam);
+ sharp_beamheight# := 1/.8 sharp_beamheight#;
+ draw_meta_sharp (w, 0);
+
+ pickup pencircle scaled stemwidth;
+
+ lft x5 = lft x6 = outer_space;
+ top y6 = vround (1.5 staff_space - .5 stem);
+ bot y5 = -top y6 + feta_space_shift;
+ labels (5, 6);
+
+ draw_gridline (z5, z6, stemwidth);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("3/4 Sharp", "sharp.slashslash.stemstemstem");
+ save stem, stemx, stemwidth;
+ save outer_space, interbeam;
+
+ stemwidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (stemwidth);
+
+ interbeam := 1.05 staff_space_rounded;
+
+ set_char_box (0, 1.6 staff_space#,
+ 1.5 staff_space#, 1.5 staff_space#);
+
+ stem := 9 / 32 * w;
+ stemx := hround stem;
+ outer_space := hround ((w - 2 stemx - stemwidth) / 2);
+
+ w := 2 outer_space + 2 stemx + stemwidth;
+ d := d - feta_space_shift;
+
+ draw_meta_sharp (w, -.5 interbeam);
+ draw_meta_sharp (w, -.5 interbeam + vround interbeam);
+
+ pickup pencircle scaled stemwidth;
+
+ lft x5 = lft x6 = outer_space;
+ lft x7 = lft x8 = outer_space + stemx;
+ lft x9 = lft x10 = outer_space + 2 stemx;
+ bot y5 = -d;
+ top y6 = vround (1.5 staff_space - 2 stem * beamslope);
+ bot y9 = -top y6 + feta_space_shift;
+ top y10 = h;
+ y7 = .5 [y5, y9];
+ y8 = .5 [y6, y10];
+
+ labels (5, 6, 7, 8, 9, 10);
+
+ draw_gridline (z5, z6, stemwidth);
+ draw_gridline (z7, z8, stemwidth);
+ draw_gridline (z9, z10, stemwidth);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+%
+% The stems of the natural are brushed (at least, in Barenreiter SCS)
+%
+
+def draw_natural (expr arrowup, arrowdown) =
+ save stemwidth, top_stem_thick;
+ save ne, pat_top, pat_bottom;
+ save depth, height, extendleft, extendright, stemlength;
+ save brush_scale_up, brush_scale_down;
+ pair ne;
+ path pat_top, pat_bottom;
+
+ top_stem_thick# = stafflinethickness# + .10 staff_space#;
+ stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
+ define_whole_blacker_pixels (top_stem_thick, stemwidth);
+
+ stemlength# = 1.5 staff_space#;
+ define_pixels (stemlength);
+
+ height# = stemlength#;
+ depth# = stemlength#;
+ extendleft# = 0;
+ extendright# = 0;
+ if arrowup:
+ extendleft# := 3 stafflinethickness#;
+ height# := height# + 1.2 staff_space#;
+ fi;
+ if arrowdown:
+ extendright# := 3.15 stafflinethickness#;
+ depth# := depth# + 1.2 staff_space#;
+ fi;
+ define_pixels (extendright);
+
+ set_char_box (extendleft#, 2/3 staff_space#, depth#, height#);
+
+ d := d - feta_space_shift;
+
+ pickup pencircle scaled stemwidth;
+
+ brush_scale_up := 1.0;
+ brush_scale_down := 1.0;
+ % to look nice, arrowed stems must be less brushed
+ if arrowup:
+ brush_scale_up := 0.85;
+ fi;
+ if arrowdown:
+ brush_scale_down := 0.85;
+ fi;
+
+ penpos1 (top_stem_thick, 0);
+ penpos3 (top_stem_thick, 0);
+ penpos2 (stemwidth, 0);
+ penpos4 (stemwidth, 0);
+ % z1' and z3' are needed for the arrowed accidentals
+ penpos1' (top_stem_thick * brush_scale_up, 0);
+ penpos3' (top_stem_thick * brush_scale_down, 0);
+
+ x2r = w;
+ x4l = 0;
+ x3 = x3' = x2;
+ x1 = x1' = x4;
+
+ y1 = y1' = stemlength;
+ y3 = y3' = -stemlength;
+ top y2 = vround (staff_space - 3/2 stafflinethickness);
+ y4 = -y2 + feta_space_shift;
+
+ pat_bottom := z4r{z4r - z1r}
+ .. bot z4
+ .. z4l{z1l - z4l};
+ fill simple_serif (z1'l, z1'r, -30)
+ -- pat_bottom
+ -- cycle;
+
+ pat_top := z2r{z2r - z3r}
+ .. top z2
+ .. z2l{z3l - z2l};
+ fill simple_serif (z3'l, z3'r, 30)
+ -- pat_top
+ -- cycle;
+
+ ne = (x2 - x4, stafflinethickness);
+
+ z11' = z3l + whatever * (z2l - z3l);
+ y11' = vround (.5 (staff_space - stafflinethickness));
+ z11 = z11' + whatever * ne;
+ x11 = x12;
+ z12 = directionpoint -ne of pat_top;
+ z13 = z12 + whatever * ne;
+ x13 = x1;
+ z14 = z11 + whatever * ne;
+ x14 = x1;
+
+ z21' = z4r + whatever * (z1r - z4r);
+ y21' = -y11' + feta_space_shift;
+ z21 = z21' + whatever * ne;
+ x21 = x22;
+ z22 = directionpoint -ne of pat_bottom;
+ z23 = z22 + whatever * ne;
+ x23 = x3;
+ z24 = z21 + whatever * ne;
+ x24 = x3;
+
+ fill z11
+ -- z12
+ -- z13
+ -- z14
+ -- cycle;
+ fill z21
+ -- z22
+ -- z23
+ -- z24
+ -- cycle;
+
+ penlabels (1, 1', 2, 3, 3', 4);
+ labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
+
+ if arrowup:
+ draw_arrow (z1, top_stem_thick * brush_scale_up,
+ z1'l - z4l, stafflinethickness / 2, false);
+ fi;
+ if arrowdown:
+ draw_arrow (z3, top_stem_thick * brush_scale_down,
+ z2r - z3'r, stafflinethickness / 2, true);
+ w := w + extendright;
+ fi;
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Natural", "natural");
+ draw_natural (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow up)", "natural.arrowup");
+ draw_natural (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow down)", "natural.arrowdown");
+ draw_natural (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrows up and down)", "natural.arrowboth");
+ draw_natural (true, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+%
+% Dedicated to my mom. (3/10/97)
+%
+% Mamma, ik hou van je; kom je alsjeblieft terug?
+% -- HW
+%
+%
+% TODO: remove crook_fatness
+% TODO: document, simplify!
+%
+
+def draw_meta_flat (expr xcenter, w, crook_fatness, arrowup, arrowdown) =
+ save crook_thinness;
+ save bottom_overshoot, bot_crook_dir;
+ save top_stem_thick, top_stem_thick_orig;
+ save bottom_stem_thick, hair, smaller_hole;
+ save top_crook_thinness;
+ save zwiep;
+ save center;
+ pair center, bot_crook_dir;
+ save clearing, clearing_orig;
+
+ clearxy;
+
+ % the stem shouldn't reach the top staff line.
+ %% TODO: should take from height.
+ %
+ % TODO: parameterize this
+ %
+ if w >= 0.75 staff_space:
+ smaller_hole = 0.35 stafflinethickness;
+ else:
+ smaller_hole = 0;
+ fi;
+ crook_thinness = .7 stafflinethickness + .06 staff_space;
+ top_crook_thinness = 1 stafflinethickness + .065 staff_space;
+ clearing = 1.7 stafflinethickness;
+ clearing_orig = clearing;
+ if arrowup:
+ clearing := 0.5 staff_space;
+ fi;
+ bottom_overshoot = stafflinethickness;
+
+ bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
+ top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
+ top_stem_thick_orig# = top_stem_thick#;
+ if arrowup:
+ % to look nice, arrowed stems should be less brushed
+ top_stem_thick# := top_stem_thick# * 0.8;
+ fi;
+ define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick,
+ top_stem_thick_orig);
+
+ if odd (top_stem_thick - bottom_stem_thick):
+ top_stem_thick := top_stem_thick - 1;
+ fi;
+ if odd (top_stem_thick_orig - bottom_stem_thick):
+ top_stem_thick_orig := top_stem_thick_orig - 1;
+ fi;
+
+ center = (xcenter, 0);
+
+ x1l = hround (xcenter - .5 top_stem_thick);
+ y1 = vround (2 staff_space - clearing);
+ x2l = hround (xcenter - .5 bottom_stem_thick);
+ y2 = -.5 staff_space - .5 stafflinethickness;
+ % z16 and the `*_orig' variables are needed for arrowed accidentals
+ % because their inner part should be unchanged from plain ones but
+ % the points z3l, z3r, and z10 depend on values that are different
+ % for arrowed accidentals
+ x16l = hround (xcenter -.5 top_stem_thick_orig);
+ y16 = vround (2 staff_space - clearing_orig);
+
+ penpos1 (top_stem_thick, 0);
+ penpos16 (top_stem_thick_orig, 0);
+ penpos2 (bottom_stem_thick, 0);
+
+ y3l = vfloor ((staff_space - stafflinethickness) / 2);
+ z3l = whatever [z2r, z1r];
+ z3r = .3 [z2r,
+ (z16r shifted (0, clearing_orig - 1.7 stafflinethickness))]
+ + (smaller_hole, 0);
+ x3r := hceiling x3r;
+
+ % we insert z3l to get better conversion with mf2pt1
+ fill simple_serif (z1r, z1l, 30)
+ -- z2l
+ -- z2r
+ -- z3l
+ -- cycle;
+
+ z10 = whatever [z2r, z16r] + (smaller_hole, 0);
+ y10 = -1/10 staff_space;
+ x10 := hceiling x10;
+
+ x11 = xcenter + bottom_overshoot / 3;
+ y11 = -vround (.5 (staff_space + stafflinethickness)
+ + bottom_overshoot);
+
+ x2a = 0.2[x2r, x7];
+ y2a = 1.5[y2, y11];
+
+ penpos4 (whatever, 53);
+
+ y4l - y4r = top_crook_thinness;
+ y5r = .15 staff_space;
+ x5l = hround (w + xcenter);
+ y4 = staff_space / 2;
+ x4r = .45 [x5r, x3r];
+ y4l := vround y4l;
+
+ penpos5 (crook_fatness, -175);
+
+ bot_crook_dir = unitvector ((x5l, 0) - z11);
+ z8 = z11 + whatever * bot_crook_dir;
+ y8 = -staff_space / 2;
+
+ z7 = z8
+ + whatever * bot_crook_dir
+ + crook_thinness * (bot_crook_dir rotated 90);
+ x7 = .1 [x3r, x8];
+
+ unfill z3r{z3r - z10}
+ .. z4r{right}
+ .. z5r{down}
+ .. z7{-bot_crook_dir}
+ & z7
+ .. z10{z3r - z10}
+ -- cycle;
+
+ if arrowdown:
+ fill z2l{down}
+ .. z2a{up}
+ .. z8{bot_crook_dir}
+ .. z5l{up}
+ .. z4l{left}
+ .. z3l
+ -- cycle;
+ else:
+ fill z2l{down}
+ .. z11{right}
+ .. z8{bot_crook_dir}
+ .. z5l{up}
+ .. z4l{left}
+ .. z3l
+ -- cycle;
+ fi;
+
+ if arrowup:
+ draw_arrow (z1, top_stem_thick, z1l - z2l,
+ 0.5 stafflinethickness, false);
+ fi;
+ if arrowdown:
+ draw_arrow ((0.5 [x2l, x2a], y2), x2a - x2l, up,
+ staff_space / 2, true);
+ fi;
+enddef;
+
+
+def draw_arrowed_meta_flat (expr xcenter, width, crook_fatness,
+ arrowup, arrowdown) =
+ save depth, height, extendleft;
+
+ depth# = 0.6 staff_space#;
+ height# = 1.9 staff_space#;
+ extendleft# := 1.2 stafflinethickness#;
+ if arrowup:
+ extendleft# := 3.45 stafflinethickness#;
+ height# := height# + 0.8 staff_space#;
+ fi;
+ if arrowdown:
+ extendleft# := 3.45 stafflinethickness#;
+ depth# := depth# + 1.6 staff_space#;
+ fi;
+
+ set_char_box (extendleft#, width, depth#, height#);
+ draw_meta_flat(xcenter, w, crook_fatness, arrowup, arrowdown);
+enddef;
+
+%
+% unfortunately, 600dpi is not enough to show the brush of the stem.
+%
+
+fet_beginchar ("Flat", "flat");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ false, false);
+ penlabels (range 0 thru 11);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow up)", "flat.arrowup");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ true, false);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow down)", "flat.arrowdown");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ false, true);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow up and down)", "flat.arrowboth");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ true, true);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Flat (slashed)", "flat.slash");
+ set_char_box (.4 staff_space#, .8 staff_space#,
+ 0.6 staff_space#, 1.9 staff_space#);
+
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
+
+ clearxy;
+
+ save slope, slash_width;
+ slope = 0.5;
+ slash_width = w;
+
+ z11 = (0, h / 2);
+ z12 = z11 - (slash_width, slash_width * slope) / 2;
+ z13 = z11 + (slash_width, slash_width * slope) / 2;
+ penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+ penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+
+ z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
+ z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
+
+ fill z13r
+ .. z15
+ .. z13l
+ -- z12l
+ .. z14
+ .. z12r
+ -- z13r
+ .. cycle;
+
+ penlabels (12, 13);
+ labels (14, 15);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
+ set_char_box (.4 staff_space#, .8 staff_space#,
+ 0.6 staff_space#, 1.9 staff_space#);
+
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
+
+ clearxy;
+
+ save slope, slash_width;
+ slope = 0.5;
+ slash_width = w;
+
+ z11 = (0, 5/12 h);
+ z12 = z11 - (slash_width, slash_width * slope) / 2;
+ z13 = z11 + (slash_width, slash_width * slope) / 2;
+ penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+ penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+
+ z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
+ z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
+
+ fill z13r
+ .. z15
+ .. z13l
+ -- z12l
+ .. z14
+ .. z12r
+ -- z13r
+ .. cycle;
+
+ penlabels (12, 13);
+ labels (14, 15);
+
+ z21 = (0, 2/3 h);
+ z22 = z21 - (slash_width, slash_width * slope) / 2;
+ z23 = z21 + (slash_width, slash_width * slope) / 2;
+ penpos22 (1.5 stafflinethickness, angle (z23 - z22) - 90);
+ penpos23 (1.5 stafflinethickness, angle (z23 - z22) - 90);
+
+ z24 = z22 - .75 stafflinethickness * unitvector (z23 - z22);
+ z25 = z23 + .75 stafflinethickness * unitvector (z23 - z22);
+
+ fill z23r
+ .. z25
+ .. z23l
+ -- z22l
+ .. z24
+ .. z22r
+ -- z23r
+ .. cycle;
+
+ penlabels (22, 23);
+ labels (24, 25);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Flatflat (mirrored)", "mirroredflat.flat");
+ set_char_box (0, 1.6 staff_space#,
+ 0.6 staff_space#, 1.9 staff_space#);
+
+ % This is a modified version of `draw_meta_flat'.
+
+ save crook_thinness, crook_fatness;
+ save bottom_overshoot, bot_crook_dir;
+ save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
+ save top_crook_thinness;
+ save zwiep;
+ save center;
+ pair center, bot_crook_dir;
+ save clearing, wid;
+ save pat;
+ path pat;
+
+ clearxy;
+
+ wid = w / 2;
+
+ % the stem shouldn't reach the top staff line.
+ %% TODO: should take from height.
+ %
+ % TODO: parameterize this
+ %
+ if wid >= 0.75 staff_space:
+ smaller_hole = 0.35 stafflinethickness;
+ else:
+ smaller_hole = 0;
+ fi;
+ clearing = 1.7 stafflinethickness;
+ crook_thinness = .7 stafflinethickness + .06 staff_space;
+ crook_fatness = 0.31 staff_space;
+ top_crook_thinness = 1 stafflinethickness + .065 staff_space;
+ bottom_overshoot = stafflinethickness;
+
+ bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
+ top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
+ define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
+
+ if odd (top_stem_thick - bottom_stem_thick):
+ top_stem_thick := top_stem_thick - 1;
+ fi;
+
+ center = (0, 0);
+
+ x1l = hround (-.5 top_stem_thick);
+ y1 = vround (2 staff_space - clearing);
+ x2l = hround (-.5 bottom_stem_thick);
+ y2 = -.5 staff_space - .5 stafflinethickness;
+
+ penpos1 (top_stem_thick, 0);
+ penpos2 (bottom_stem_thick, 0);
+
+ y3l = vfloor ((staff_space - stafflinethickness) / 2);
+ z3l = whatever [z2r, z1r];
+ z3r = .3 [z2r, z1r] + (smaller_hole, 0);
+ x3r := hceiling x3r;
+
+ z10 = whatever [z2r, z1r] + (smaller_hole, 0);
+ y10 = -1/10 staff_space;
+ x10 := hceiling x10;
+
+ x11 = bottom_overshoot / 3;
+ y11 = -vround (.5 (staff_space + stafflinethickness)
+ + bottom_overshoot);
+
+ penpos4 (whatever, 53);
+
+ y4l - y4r = top_crook_thinness;
+ y5r = .15 staff_space;
+ x5l = hround (wid);
+ y4 = staff_space / 2;
+ x4r = .45 [x5r, x3r];
+ y4l := vround y4l;
+
+ penpos5 (crook_fatness, -175);
+
+ bot_crook_dir = unitvector ((x5l, 0) - z11);
+ z8 = z11 + whatever * bot_crook_dir;
+ y8 = -staff_space / 2;
+
+ z7 = z8
+ + whatever * bot_crook_dir
+ + crook_thinness * (bot_crook_dir rotated 90);
+ x7 = .1 [x3r, x8];
+
+ pat := z3r{z3r - z10}
+ .. z4r{right}
+ .. z5r{down}
+ .. z7{-bot_crook_dir}
+ & z7
+ .. z10{z3r - z10}
+ -- cycle;
+ unfill pat;
+ unfill pat xscaled -1;
+
+ pat := z11{right}
+ .. z8{bot_crook_dir}
+ .. z5l{up}
+ .. z4l{left}
+ .. z3l;
+ fill pat
+ -- simple_serif (z1r, z1l, 30)
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+
+ currentpicture := currentpicture shifted (w/2, 0);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Semi flat", "mirroredflat");
+ set_char_box (1.2 stafflinethickness#, .8 staff_space#,
+ 0.6 staff_space#, 1.9 staff_space#);
+
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
+ currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
+fet_endchar;
+
+
+fet_beginchar ("Semi flat", "mirroredflat.backslash");
+ set_char_box (.4 staff_space#, .8 staff_space#,
+ 0.6 staff_space#, 1.9 staff_space#);
+
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
+
+ clearxy;
+
+ save slope, slash_width;
+ slope = 0.5;
+ slash_width = w;
+
+ z11 = (0, h / 2);
+ z12 = z11 - (slash_width, slash_width * slope) / 2;
+ z13 = z11 + (slash_width, slash_width * slope) / 2;
+ penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+ penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
+
+ z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
+ z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
+
+ fill z13r
+ .. z15
+ .. z13l
+ -- z12l
+ .. z14
+ .. z12r
+ -- z13r
+ .. cycle;
+
+ currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
+
+ labels (1, 2, 3);
+fet_endchar;
+
+
+fet_beginchar ("Double Flat", "flatflat");
+ save left_wid, overlap, right_wid;
+
+ left_wid = .7;
+ right_wid = .8;
+ overlap = .05;
+
+ set_char_box (1.2 stafflinethickness#,
+ (left_wid + right_wid - overlap) * staff_space#,
+ .6 staff_space#, 1.9 staff_space#);
+ draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+ false, false);
+ draw_meta_flat (hround ((left_wid - overlap) * staff_space),
+ right_wid * staff_space, 1/3 staff_space,
+ false, false);
+fet_endchar;
+
+
+fet_beginchar ("3/4 Flat", "flatflat.slash");
+ save left_wid, overlap, right_wid;
+
+ left_wid = .7;
+ right_wid = .8;
+ overlap = .05;
+
+ set_char_box (1.2 stafflinethickness#,
+ (left_wid + right_wid - overlap) * staff_space#,
+ .6 staff_space#, 1.9 staff_space#);
+ draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+ false, false);
+ draw_meta_flat (hround ((left_wid - overlap) * staff_space),
+ right_wid * staff_space, 1/3 staff_space,
+ false, false);
+
+ %% maybe we should clip part of the stems?
+ %% or make the 1st flat smaller?
+ %% or reverse it?
+ pickup pencircle scaled 2 stafflinethickness;
+
+ z12 = round (-.25 w - b, .55 staff_space) + feta_offset;
+ z13 = round (.75 w, 1.45 staff_space) + feta_offset;
+ penpos12 (2 stafflinethickness, angle (z13 - z12) - 90);
+ penpos13 (2 stafflinethickness, angle (z13 - z12) - 90);
+
+ z14 = z12 - stafflinethickness * unitvector (z13 - z12);
+ z15 = z13 + stafflinethickness * unitvector (z13 - z12);
+
+ fill z13r
+ .. z15
+ .. z13l
+ -- z12l
+ .. z14
+ .. z12r
+ -- z13r
+ .. cycle;
+
+ penlabels (12, 13);
+ labels (14, 15);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Double Sharp", "doublesharp");
+ save klaverblad, klaversteel;
+ save pat;
+ path pat;
+
+ klaversteel = 1/15 staff_space;
+ klaverblad = .4 staff_space - .5 stafflinethickness;
+
+ set_char_box (0, staff_space#, .5 staff_space#, .5 staff_space#);
+
+ z1 = (klaversteel, 0);
+ z2 = (w / 2 - klaverblad / 10, h - klaverblad);
+ z3 = (w / 2, h);
+ z4 = z2 reflectedabout ((0, 0), (1, 1));
+ z5 = z1 reflectedabout ((0, 0), (1, 1));
+
+ labels (1, 2, 3, 4, 5);
+
+ pickup pencircle scaled blot_diameter;
+
+ x2 := hfloor (rt x2) - blot_diameter / 2;
+ x3 := hfloor (rt x3) - blot_diameter / 2;
+ y3 := vfloor (top y3) - blot_diameter / 2;
+ y4 := vfloor (top y4) - blot_diameter / 2;
+
+ pat = (rt z1){dir45}
+ .. {right}(bot z2)
+ .. rt z2
+ -- rt z3{z3 - z2}
+ .. top z3{z4 - z3}
+ -- top z4{z4 - z3}
+ .. (lft z4){down}
+ .. {dir 225}(top z5);
+ pat := pat
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0);
+
+ % assure symmetry -- it's more important to center the glyph on the
+ % staff line than centering it between staff lines, so we use
+ % feta_shift, not feta_space_shift.
+ h := h + feta_shift;
+
+ fill pat shifted (0, feta_shift)
+ -- reverse pat yscaled -1 shifted (0, -feta_eps)
+ -- cycle;
+
+ % ugh
+ currentpicture := currentpicture shifted (hround (w / 2), 0);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+def draw_paren =
+ save leftindent;
+
+ leftindent := .2 staff_space;
+
+ set_char_box (0, .5 staff_space# + stafflinethickness#,
+ staff_space#, staff_space#);
+
+ d := d - feta_shift;
+
+ z1 = (leftindent, h);
+ z2 = (w - stafflinethickness, .5 (h - d));
+ z3 = (leftindent, -d);
+
+ penpos1 (stafflinethickness, 35);
+ penpos2 (.1 staff_space + stafflinethickness, 0);
+ penpos3 (stafflinethickness, -35);
+
+ fill z2l{down}
+ .. simple_serif (z3l, z3r, 90)
+ .. z2r{up}
+ .. simple_serif (z1r, z1l, 90)
+ .. z2l{down}
+ -- cycle;
+enddef;
+
+
+fet_beginchar ("Right Parenthesis", "rightparen");
+ draw_paren;
+ penlabels (1, 2, 3);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Left Parenthesis", "leftparen");
+ draw_paren;
+
+ currentpicture := currentpicture xscaled -1;
+
+ set_char_box (charwd, charbp, chardp, charht);
+fet_endchar;
+
+fet_endgroup ("accidentals");
number_design_size := design_size / 2;
dynamic_design_size := 14 design_size / 20;
-input feta-nummer-code;
-input feta-din-code;
+input feta-numbers;
+input feta-dynamics;
-fet_endfont ("feta-nummer");
+fet_endfont ("feta-numbers");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- draw arrow heads
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("arrowheads");
-
-%
-% To consider: we could put arrow heads at their real Unicode locations.
-%
-
-%
-% Set up paths for upper half of arrow head pointing right.
-% CLOSE_PATH is for a closed arrow, OPEN_PATH is for the open arrow.
-% OPEN_TENSION sets the tension for the part which forms the path in
-% OPEN_PATH.
-%
-
-def set_arrow_paths (expr width, height, open_tension, arrowlinethickness) =
- save pat, finalpath;
- save tip_angle_o, tip_angle_c, tip_dir_c, tip_dir_o;
- save indent;
- path pat, open_path, close_path;
- pair tip_dir_o, tip_dir_c;
-
- pickup pencircle scaled arrowlinethickness;
-
- indent = linethickness / 2;
-
- lft x1 = -width;
- x2 = 0;
- top y1 = height;
- y2 = 0;
-
- z4 = z3;
- y5 = 0;
- x5 = x4 + indent;
-
- pat := z1
- ..tension open_tension.. z2{right};
- penpos2 (arrowlinethickness, 90);
- tip_dir_o := direction 0.0 of pat;
- tip_angle_o := angle (tip_dir_o);
- penpos1 (arrowlinethickness, 90 + tip_angle_o);
- z3 = z1;
- penpos3 (arrowlinethickness, tip_angle_o);
-
- open_path := z1r{tip_dir_o}
- .. z2r{right}
- .. z2l{left}
- .. z1l{-tip_dir_o}
- .. z3l
- .. cycle;
-
- pat := z4
- .. z5{down};
- tip_dir_c := direction 0.0 of pat;
- tip_angle_c := angle (tip_dir_c);
- penpos4 (arrowlinethickness, 90+ tip_angle_c);
- penpos5 (arrowlinethickness, 0);
- z6 = z5;
- penpos6 (arrowlinethickness, 90);
-
- close_path := z4l{tip_dir_c}
- .. z5l{down}
- .. z6l{right}
- .. z2l{right}
- .. z2r{left}
- ..tension open_tension.. z1r{-tip_dir_o}
- .. z3l
- .. cycle;
-enddef;
-
-
-fet_beginchar ("open", "open.01");
- set_char_box (staff_space#, 1.6 linethickness# / 2,
- 0.5 staff_space#, 0.5 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space,
- 1.0, 1.6 linethickness);
- fill open_path;
- open_path := open_path yscaled -1;
- fill open_path;
-
- penlabels (1, 2, 3);
- penlabels (4, 5, 6);
-fet_endchar;
-
-
-fet_beginchar ("open", "open.0M1");
- set_char_box (1.6 linethickness# / 2, staff_space#,
- 0.5 staff_space#, 0.5 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space,
- 1.0, 1.6 linethickness);
- fill open_path;
- open_path := open_path yscaled -1;
- fill open_path;
- currentpicture := currentpicture xscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("open", "open.11");
- set_char_box (.5 staff_space#, .5 staff_space#,
- 1.0 staff_space#, 1.6 linethickness# / 2);
- set_arrow_paths (staff_space, 0.5 staff_space,
- 1.0, 1.6 linethickness);
- fill open_path;
- open_path := open_path yscaled -1;
- fill open_path;
- currentpicture := currentpicture rotated 90;
-fet_endchar;
-
-
-fet_beginchar ("open", "open.1M1");
- set_char_box (.5 staff_space#, .5 staff_space#,
- 1.6 linethickness# / 2, 1.0 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space,
- 1.0, 1.6 linethickness);
- fill open_path;
- open_path := open_path yscaled -1;
- fill open_path;
- currentpicture := currentpicture rotated 90;
- currentpicture := currentpicture yscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("close", "close.01");
- set_char_box (staff_space#, 0, 0.5 staff_space#, 0.5 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
- fill close_path;
- close_path := close_path yscaled -1;
- fill close_path;
-fet_endchar;
-
-
-fet_beginchar ("close", "close.0M1");
- set_char_box (0, staff_space#, 0.5 staff_space#, 0.5 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
- fill close_path;
- close_path := close_path yscaled -1;
- fill close_path;
- currentpicture := currentpicture xscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("close", "close.11");
- set_char_box (.5 staff_space#, .5 staff_space#,
- 1.0 staff_space#, 0.0 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
- fill close_path;
- close_path := close_path yscaled -1;
- fill close_path;
- currentpicture := currentpicture rotated 90;
-fet_endchar;
-
-
-fet_beginchar ("close", "close.1M1");
- set_char_box (.5 staff_space#, .5 staff_space#,
- 0.0 staff_space#, 1.0 staff_space#);
- set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
- fill close_path;
- close_path := close_path yscaled -1;
- fill close_path;
- currentpicture := currentpicture rotated -90;
-fet_endchar;
-
-
-fet_endgroup ("arrowheads");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- draw arrow heads
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("arrowheads");
+
+%
+% To consider: we could put arrow heads at their real Unicode locations.
+%
+
+%
+% Set up paths for upper half of arrow head pointing right.
+% CLOSE_PATH is for a closed arrow, OPEN_PATH is for the open arrow.
+% OPEN_TENSION sets the tension for the part which forms the path in
+% OPEN_PATH.
+%
+
+def set_arrow_paths (expr width, height, open_tension, arrowlinethickness) =
+ save pat, finalpath;
+ save tip_angle_o, tip_angle_c, tip_dir_c, tip_dir_o;
+ save indent;
+ path pat, open_path, close_path;
+ pair tip_dir_o, tip_dir_c;
+
+ pickup pencircle scaled arrowlinethickness;
+
+ indent = linethickness / 2;
+
+ lft x1 = -width;
+ x2 = 0;
+ top y1 = height;
+ y2 = 0;
+
+ z4 = z3;
+ y5 = 0;
+ x5 = x4 + indent;
+
+ pat := z1
+ ..tension open_tension.. z2{right};
+ penpos2 (arrowlinethickness, 90);
+ tip_dir_o := direction 0.0 of pat;
+ tip_angle_o := angle (tip_dir_o);
+ penpos1 (arrowlinethickness, 90 + tip_angle_o);
+ z3 = z1;
+ penpos3 (arrowlinethickness, tip_angle_o);
+
+ open_path := z1r{tip_dir_o}
+ .. z2r{right}
+ .. z2l{left}
+ .. z1l{-tip_dir_o}
+ .. z3l
+ .. cycle;
+
+ pat := z4
+ .. z5{down};
+ tip_dir_c := direction 0.0 of pat;
+ tip_angle_c := angle (tip_dir_c);
+ penpos4 (arrowlinethickness, 90+ tip_angle_c);
+ penpos5 (arrowlinethickness, 0);
+ z6 = z5;
+ penpos6 (arrowlinethickness, 90);
+
+ close_path := z4l{tip_dir_c}
+ .. z5l{down}
+ .. z6l{right}
+ .. z2l{right}
+ .. z2r{left}
+ ..tension open_tension.. z1r{-tip_dir_o}
+ .. z3l
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("open", "open.01");
+ set_char_box (staff_space#, 1.6 linethickness# / 2,
+ 0.5 staff_space#, 0.5 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space,
+ 1.0, 1.6 linethickness);
+ fill open_path;
+ open_path := open_path yscaled -1;
+ fill open_path;
+
+ penlabels (1, 2, 3);
+ penlabels (4, 5, 6);
+fet_endchar;
+
+
+fet_beginchar ("open", "open.0M1");
+ set_char_box (1.6 linethickness# / 2, staff_space#,
+ 0.5 staff_space#, 0.5 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space,
+ 1.0, 1.6 linethickness);
+ fill open_path;
+ open_path := open_path yscaled -1;
+ fill open_path;
+ currentpicture := currentpicture xscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("open", "open.11");
+ set_char_box (.5 staff_space#, .5 staff_space#,
+ 1.0 staff_space#, 1.6 linethickness# / 2);
+ set_arrow_paths (staff_space, 0.5 staff_space,
+ 1.0, 1.6 linethickness);
+ fill open_path;
+ open_path := open_path yscaled -1;
+ fill open_path;
+ currentpicture := currentpicture rotated 90;
+fet_endchar;
+
+
+fet_beginchar ("open", "open.1M1");
+ set_char_box (.5 staff_space#, .5 staff_space#,
+ 1.6 linethickness# / 2, 1.0 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space,
+ 1.0, 1.6 linethickness);
+ fill open_path;
+ open_path := open_path yscaled -1;
+ fill open_path;
+ currentpicture := currentpicture rotated 90;
+ currentpicture := currentpicture yscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("close", "close.01");
+ set_char_box (staff_space#, 0, 0.5 staff_space#, 0.5 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
+ fill close_path;
+ close_path := close_path yscaled -1;
+ fill close_path;
+fet_endchar;
+
+
+fet_beginchar ("close", "close.0M1");
+ set_char_box (0, staff_space#, 0.5 staff_space#, 0.5 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
+ fill close_path;
+ close_path := close_path yscaled -1;
+ fill close_path;
+ currentpicture := currentpicture xscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("close", "close.11");
+ set_char_box (.5 staff_space#, .5 staff_space#,
+ 1.0 staff_space#, 0.0 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
+ fill close_path;
+ close_path := close_path yscaled -1;
+ fill close_path;
+ currentpicture := currentpicture rotated 90;
+fet_endchar;
+
+
+fet_beginchar ("close", "close.1M1");
+ set_char_box (.5 staff_space#, .5 staff_space#,
+ 0.0 staff_space#, 1.0 staff_space#);
+ set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
+ fill close_path;
+ close_path := close_path yscaled -1;
+ fill close_path;
+ currentpicture := currentpicture rotated -90;
+fet_endchar;
+
+
+fet_endgroup ("arrowheads");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- draw flags
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("flags");
-
-save outer_path;
-path outer_path;
-
-%
-% Flags pointing down overlap with the notehead (in x-direction), so
-% the down-flag can be bigger.
-%
-
-upflag_width# = .65 black_notehead_width# + stemthickness# / 2;
-downflag_width# = .833 black_notehead_width# + stemthickness# / 2;
-
-right_upflag_space# = .0 upflag_width#;
-right_downflag_space# = .0 downflag_width#;
-
-%
-% Flags pointing down cannot overlap with the notehead in y-direction,
-% so they have less slant.
-%
-% Because of optical illusion, the utmost flag (bottom for
-% down-pointing, top for up-pointing) should be smaller than the other
-% flags. Adobe Sonata doesn't do this correctly. (Instead they have
-% an extension flag, which looks less elegant.)
-%
-
-save hip_thickness, foot_thickness;
-
-hip_thickness# = 1.0 linethickness# + 0.069 staff_space#;
-foot_thickness# = 1.2055 linethickness# + 0.06 staff_space#;
-
-define_pixels (hip_thickness, foot_thickness);
-
-%
-% Inspired by Adobe Sonata and [Wanske].
-% For example, see POSTSCRIPT Language -- program design,
-% page 119, and [Wanske], p 41, 42.
-%
-
-def draw_flag (expr center, flare, dims, hip_depth, foot_wid,
- hip_thickness, foot_thickness, show_labels) =
- save c;
-
- clearxy;
-
- c = 0.7;
-
- penpos1 (flare, 90);
- penpos2 (whatever, 0);
-
- x2r - x2l = hround (hip_thickness);
-
- penpos3 (foot_thickness, -20.0);
-
- z1r = center;
- z2r = center + (xpart (dims), -ypart (dims) * hip_depth);
- z3r = center + (xpart (dims) * foot_wid, -ypart (dims));
-
- x2r := hround x2r;
- y2r := vround y2r;
-
- outer_path := z3r{curl c}
- .. z2r{up}
- .. {up}z1r;
-
- if show_labels = 1:
- penlabels (1, 2, 3);
- fi;
-
- fill z1l{curl 0}
- ..tension 1.1.. z2l{down}
- .. {curl c}simple_serif (z3l, z3r, 80)
- & outer_path
- & z1r
- -- cycle;
-enddef;
-
-%
-% TODO: calculate intersectpoint (see TeX book, p. 137)
-% TODO: calculate incision_depth
-%
-
-def add_flag (expr yoff, flare, hip_wid_multiplier, hip_dep_multiplier,
- intersectpoint, hip_thickness, foot_thickness) =
-begingroup
- save prev_center, prev_xextreme, prev_yextreme;
- save rel_foot, ip, center, incision_depth;
- save prev_hipwid, prev_footdep, prev_hipdep, wid, dep, hip_dep;
- save hip_dep_ratio, foot_wid_ratio;
- pair prev_center, center, foot, prev_xextreme, prev_yextreme;
- pair ip, rel_foot;
-
- incision_depth = 1.013;
- prev_center = point 2 of outer_path;
- prev_xextreme = point 1 of outer_path;
- prev_yextreme = point 0 of outer_path;
- prev_hipwid = xpart (prev_xextreme - prev_center);
- prev_footdep = -ypart (prev_yextreme - prev_center);
- prev_hipdep = -ypart (prev_xextreme - prev_center);
- ip = point intersectpoint of outer_path;
-
- wid = prev_hipwid * hip_wid_multiplier;
- hip_dep = prev_hipdep * hip_dep_multiplier;
-
- center = prev_center + (0, yoff);
- rel_foot = incision_depth [(wid, hip_dep), ip - center];
- dep = -ypart (rel_foot);
- foot_wid_ratio = xpart (rel_foot) / wid;
- hip_dep_ratio = hip_dep / dep;
-
- draw_flag (center, flare, (wid, dep),
- hip_dep_ratio, foot_wid_ratio,
- hip_thickness, foot_thickness, 0);
-endgroup
-enddef;
-
-
-fet_beginchar ("8th Flag (up)", "u3");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
-
- flare = staff_space;
- hip_depth_ratio = .72;
- foot_width_ratio = .8;
- hip_width# = upflag_width# - hip_thickness# / 2;
- foot_depth# = 3 staff_space# - blot_diameter# / 2;
- define_pixels (hip_width, foot_depth);
-
- set_char_box (0,
- hip_width# + stemthickness# / 2 + right_upflag_space#,
- foot_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0,0), flare, (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 1);
-
- draw_square_block ((-0.5 stemthickness_rounded, -staff_space_rounded),
- (0, 0));
-fet_endchar;
-
-
-fet_beginchar ("16th Flag (up)", "u4");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- total_depth# = 3.5 staff_space# - blot_diameter# / 2;
- flag_count = 2;
- flare = .85 staff_space;
- flagspace# = .85 staff_space#;
- hip_depth_ratio = .72;
- hip_width# = upflag_width# - hip_thickness# / 2;
- flagspace# + foot_depth# = total_depth#;
- foot_width_ratio = .8;
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0,
- hip_width# + stemthickness# / 2 + right_upflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -flagspace), flare, (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 1);
-
- add_flag (flagspace, flare, .97, 1.00, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -2 staff_space_rounded));
-fet_endchar;
-
-
-fet_beginchar ("32nd Flag (up)", "u5");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 3;
- total_depth# = 4.25 staff_space#;
- flare = .85 staff_space;
- flagspace# = .87 staff_space#;
- hip_depth_ratio = .72;
- hip_width# = upflag_width# - hip_thickness# / 2;
- foot_width_ratio = .8;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_upflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -2 flagspace), flare, (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 1);
-
- add_flag (flagspace, flare, .97, 1.00, 1.25,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .95, 1.05, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -3 staff_space_rounded));
-fet_endchar;
-
-
-fet_beginchar ("64th Flag (up)", "u6");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 4;
- flare = .85 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .72;
- hip_width# = upflag_width# - hip_thickness# / 2;
- total_depth# = 5.25 staff_space#;
- foot_width_ratio = .8;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_upflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 1);
-
- add_flag (flagspace, flare, .97, 1.00, 1.3,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, 1.00, 1.00, 1.25,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .95, 1.05, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -4 staff_space_rounded));
-fet_endchar;
-
-
-fet_beginchar ("128th Flag (up)", "u7");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 5;
- flare = .85 staff_space;
- flagspace# = .93 staff_space#;
- hip_depth_ratio = .72;
- hip_width# = upflag_width# - hip_thickness# / 2;
- total_depth# = 6.25 staff_space#;
- foot_width_ratio = .8;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_upflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 1);
-
- add_flag (flagspace, flare, .97, 1.00, 1.3,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, 1.00, 1.00, 1.25,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, 1.00, 1.00, 1.25,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, 0.95, 1.05, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -5 staff_space_rounded));
-fet_endchar;
-
-
-fet_beginchar ("8th (down)", "d3");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 1;
- flare = staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .72;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 2.85 staff_space#;
- foot_width_ratio = .8;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, flagspace, foot_depth);
-
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2)
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 0);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-
-%%%%%%%%
-%
-% Single Stroke for Short Appogiatura
-%
-
-fet_beginchar ("grace dash (up)", "ugrace");
- save flare, hip_depth_ratio, hip_width, foot_depth;
-
- hip_depth_ratio = .72;
- flare# = staff_space#;
- hip_width# = upflag_width# - hip_thickness# / 2;
- foot_depth# = 3 staff_space#;
-
- define_pixels (hip_width, foot_depth);
-
- set_char_box (hip_width# * hip_depth_ratio,
- hip_width# + right_upflag_space#,
- foot_depth# * hip_depth_ratio, -flare#)
-
- pickup pencircle scaled 1.5 stemthickness;
-
- z1 = (-b, -d);
- z2 = (w, h);
-
- penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
- penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
-
- fill z1l
- -- z2l
- .. top z2
- .. rt z2
- .. z2r
- -- z1r
- .. bot z1
- .. lft z1
- .. cycle;
-
- penlabels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("grace dash (down)", "dgrace");
- save flare, hip_depth_ratio, hip_width, foot_depth;
- save total_depth;
-
- hip_depth_ratio = .72 ;
- flare# = .99 staff_space#;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 2.85 staff_space#;
- foot_depth# = total_depth#;
- foot_width_ratio = .8;
-
- define_pixels (hip_width, foot_depth);
-
- set_char_box (hip_width# * hip_depth_ratio,
- hip_width# + right_downflag_space#,
- foot_depth# * hip_depth_ratio, -flare#)
-
- pickup pencircle scaled 1.5 stemthickness;
-
- z1 = (-b, -d);
- z2 = (w, h);
-
- penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
- penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
-
- fill z1l
- -- z2l
- .. top z2
- .. rt z2
- .. z2r
- -- z1r
- .. bot z1
- .. lft z1
- .. cycle;
-
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("16th (down)", "d4");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 2;
- flare = .8 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 3.0 staff_space# - blot_diameter# / 2;
- foot_width_ratio = .95;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 0);
-
- add_flag (flagspace, flare, .95, 1.00, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -2 staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("32nd (down)", "d5");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 3;
- flare = .84 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 3.85 staff_space#;
- foot_width_ratio = .95;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 0);
-
- add_flag (flagspace, flare, .97, 1.00, 1.25,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .95, 1.05, 1.25,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -3 staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("64th (down)", "d6");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 4;
- flare = .8 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 4.35 staff_space#;
- foot_width_ratio = .98;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
-
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 0);
-
- add_flag (flagspace, flare, .97, 1.20, 1.175,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .97, 1.10, 1.175,
- hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -4 staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("128th (down)", "d7");
- save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
- save flagspace, total_depth, flag_count;
-
- flag_count = 5;
- flare = .8 staff_space;
- flagspace# = .9 staff_space#;
- hip_depth_ratio = .85;
- hip_width# = downflag_width# - hip_thickness# / 2;
- total_depth# = 5.25 staff_space#;
- foot_width_ratio = .98;
-
- (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
- define_pixels (hip_width, foot_depth);
- define_whole_vertical_pixels (flagspace);
-
- set_char_box (0, hip_width# + right_downflag_space#,
- total_depth# + foot_thickness# / 2, stemthickness# / 2);
-
- draw_flag ((0, -(flag_count - 1) * flagspace), flare,
- (hip_width, foot_depth),
- hip_depth_ratio, foot_width_ratio,
- hip_thickness, foot_thickness, 0);
-
- add_flag (flagspace, flare, .97, 1.20, 1.175,
- hip_thickness, foot_thickness);
- add_flag (flagspace, flare, .97, 1.10, 1.175,
- hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
- hip_thickness, foot_thickness);
- add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
- hip_thickness, foot_thickness);
-
- draw_square_block ((-0.5 stemthickness_rounded, 0),
- (0, -5 staff_space_rounded));
-
- y_mirror_char;
-fet_endchar;
-
-fet_endgroup ("flags");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- Staff braces
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-% Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-% We have to reduce the pixel-per-point value to
-% support large brace glyphs in case we are using MetaPost
-% (which by default sets `hppp' to 49.80244, regardless of
-% the used `mag' value)
-
-if known miterlimit:
- bpppix_ := 0.2; % ten times larger than original
-
- numeric mm, pt, dd, bp, cm, pc, cc, in;
-
- mm * bpppix_ = 2.83464;
- pt * bpppix_ = 0.99626;
- dd * bpppix_ = 1.06601;
- bp * bpppix_ = 1;
- cm * bpppix_ = 28.34645;
- pc * bpppix_ = 11.95517;
- cc * bpppix_ = 12.79213;
- in * bpppix_ = 72;
-
- hppp := pt;
- vppp := pt;
-fi;
-
-
-input feta-autometric;
-input feta-macros;
-
-staffsize# := 20 pt#; %% arbitrary
-
-input feta-params;
-
-%
-% We must let the design increase for each font to make sure that mftrace
-% doesn't jack up the resolution too highly for the longer braces.
-%
-
-fet_beginfont ("feta-braces-" & char (97 + font_count),
- (font_count + 1) * 20, "fetaBraces");
-
-mode_setup;
-
-
-save code, braces_per_font;
-code := 64;
-braces_per_font := 64;
-
-def draw_brace (expr height_sharp, width_sharp, slt_sharp, brace_number) =
- save pendir, height, width, thin, thick, slt, pat;
- save penangle;
- pair pendir;
- path pat;
-
- height# := height_sharp;
- width# := width_sharp;
- slt# := slt_sharp;
-
- fet_beginchar ("brace number " & decimal (brace_number),
- "brace" & decimal (brace_number))
- set_char_box (width#, 0, height# / 2, height# / 2);
-
- define_pixels (height, width, slt);
- thin = 2 slt;
- thick = .5 width;
-
- z2 = .5 [z1, z3];
- y3l = y1 + height / 2;
- x3 = x1 + width;
- y1 = 0;
- x1 = -b;
- y0 = y1;
- x0 = x1 - 2/6 thin;
-
- pendir = unitvector (x3 - x1, y3l / 6 - y1);
- penangle = angle pendir - 90;
- penpos3 (thin, penangle);
- penpos2 (thick, angle (z3 - z1) - 90);
- penpos1 (2/3 thin, penangle);
-
- penlabels (1, 2, 3);
- labels (0);
-
- pat := z2r
- .. simple_serif (z3r, z3l, 90)
- .. z2l
- .. z1l{dir (angle (z1r - z1l) - 90)}
- .. z0{down}
- .. z1r{-dir (angle (z1l - z1r) + 90)}
- .. cycle;
- pat := subpath (0, 5) of pat
- -- subpath (6, 7) of pat
- .. cycle;
-
- fill pat;
- fill pat yscaled -1;
- fet_endchar;
-enddef;
-
-
-save stafflinethickness;
-save increment;
-
-linethickness := 0.5 pt#;
-increment := 0.5 pt#;
-y := 10 pt#;
-
-for i := 0 step 1 until font_count:
- save number;
-
- number := braces_per_font * i;
-
- for j := 0 step 1 until (braces_per_font - 1):
- % message "l: "&decimal l;
- % note: define_pixels (x) multiplies x by hppp,
- % must never get bigger than infinity
- y := y + increment;
- if y > infinity / hppp:
- message "Resolution and/or magnification is too high";
- message "HPPP: "& decimal hppp &" Y: " & decimal y;
- errmessage "please report to <bug-lilypond@gnu.org>";
- fi;
-
- % x should be about one staff space, taking brace to have
- % default height of 3 staffs, this yields height / 3 / 4 = 12
- % but 15 looks better
- x := y / 15;
-
- increment := x / 10;
- linethickness := min (0.5 pt#, y / 150);
- if i = font_count:
- draw_brace (y, x, linethickness, number);
- fi;
-
- number := number + 1;
- endfor;
-endfor;
-
-fet_endfont ("feta-braces");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- implement noteheads
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-% & Han-Wen Nienhuys <hanwen@xs4all.nl>
-% & Juergen Reuter <reuter@ipd.uka.de>
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-test_outlines := 0;
-
-
-save remember_pic;
-picture remember_pic;
-
-
-% Most beautiful noteheads are pronounced, not circular,
-% and not even symmetric.
-% These examples are inspired by [Wanske]; see literature list.
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% NOTE HEAD VARIABLES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-save black_notehead_width, noteheight;
-save half_notehead_width, whole_notehead_width, slash_thick;
-save slash_slope, overdone_heads, solfa_noteheight;
-
-numeric noteheight;
-numeric slash_thick;
-numeric black_notehead_width;
-numeric whole_notehead_width;
-numeric half_notehead_width;
-
-
-fet_begingroup ("noteheads");
-
-
-% Slope of slash. From scm/grob-description.scm. How to auto-copy?
-slash_slope := 1.7;
-
-% Thickness of slash lines. Quarter notes get 1.5slt width.
-slash_thick# := 2/3 * 0.48 staff_space#;
-
-
-%
-% Hand-engraved music often has balls extending above and below
-% the lines. If you like that, modify overdone heads (unit:
-% stafflinethickness).
-%
-overdone_heads = 0.0;
-noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
-
-
-%
-% solfa heads should not overlap on chords.
-%
-solfa_noteheight# := staff_space# - stafflinethickness#;
-
-define_pixels (slash_thick);
-define_whole_vertical_pixels (noteheight);
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% SLANT moves both extrema on the long axis (by SLANT * ELLIPTICITY,
-% so SLANT = -1, puts the extreme on the long axis next to the short
-% axis one).
-%
-
-def draw_outside_ellipse (expr ellipticity, tilt, superness, slant) =
- save attachment_y;
- save pat;
- path pat;
-
- pat := superellipse ((ellipticity, 0), (-slant * ellipticity, 1.0),
- (-ellipticity, 0), (slant * ellipticity, -1.0),
- superness);
- pat := pat rotated tilt;
-
- save top_point, right_point;
- pair top_point, right_point;
-
- top_point := directionpoint left of pat;
- right_point := directionpoint up of pat;
-
- save scaling, width;
-
- scaling# = noteheight# / (2 ypart (top_point));
- width# := 2 xpart (right_point) * scaling#;
- define_pixels (scaling, width);
-
- set_char_box (0, width#, noteheight# / 2, noteheight# / 2);
-
- d := d - feta_space_shift;
-
- % attachment Y
- charwy := ypart (right_point) * scaling#;
- charwx := width#;
-
- pat := pat scaled scaling shifted (w / 2, .5 (h - d));
-
- width := hround width;
-
- if test_outlines = 1:
- draw pat;
- else:
- fill pat;
- fi;
-enddef;
-
-
-def undraw_inside_ellipse (expr ellipticity, tilt, superness, clearance) =
-begingroup
- save pat;
- path pat;
-
- pat := superellipse ((ellipticity, 0), (0, 1.0),
- (-ellipticity, 0), (0, -1.0),
- superness);
- pat := pat rotated tilt;
-
- save top_point, right_point;
- pair top_point, right_point;
-
- top_point := directionpoint left of pat;
- right_point := directionpoint up of pat;
-
- save height, scaling;
-
- height# = staff_space# + stafflinethickness# - clearance;
- scaling# = height# / (2 ypart (top_point));
- define_pixels (scaling);
- pat := pat scaled scaling shifted (w / 2, .5 (h - d));
-
- if test_outlines = 1:
- draw pat;
- else:
- unfill pat;
- fi
-endgroup;
-enddef;
-
-
-%
-% dimensions aren't entirely right.
-%
-def draw_longa (expr up) =
- save stemthick, fudge;
-
- stemthick# = 2 stafflinethickness#;
- define_whole_blacker_pixels (stemthick);
-
- fudge = hround (blot_diameter / 2);
-
- draw_outside_ellipse (1.80, 0, 0.707, 0);
- undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
-
- pickup pencircle scaled stemthick;
-
- if up:
- bot y1 = -d;
- top y2 = h;
- rt x1 - fudge = 0;
- x1 = x2;
-
- fudge + lft x3 = w;
- x4 = x3;
- top y4 = h + 3.0 staff_space;
- y3 = y1;
- else:
- bot y1 = -d - 3.0 staff_space;
- top y2 = h;
- rt x1 - fudge = 0;
- x1 = x2;
-
- fudge + lft x3 = w;
- x4 = x3;
- y4 = y2;
- bot y3 = -d;
- fi;
-
- draw_gridline (z1, z2, stemthick);
- draw_gridline (z3, z4, stemthick);
-
- labels (1, 2, 3, 4);
-enddef;
-
-
-fet_beginchar ("Longa notehead", "uM2");
- draw_longa (true);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-fet_beginchar ("Longa notehead", "dM2");
- draw_longa (false);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Longa notehead", "uM2");
- draw_longa (true);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-
- fet_beginchar ("Longa notehead", "dM2");
- draw_longa (false);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-%
-% dimensions aren't entirely right.
-%
-def draw_brevis (expr linecount) =
- save stemthick, fudge;
-
- stemthick# = 2 stafflinethickness#;
- define_whole_blacker_pixels (stemthick);
-
- fudge = hround (blot_diameter / 2);
-
- draw_outside_ellipse (1.80, 0, 0.707, 0);
- undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
-
- pickup pencircle scaled stemthick;
-
- bot y1 = -d;
- top y2 = h;
- rt x1 - fudge = 0;
- x1 = x2;
-
- fudge + lft x3 = w;
- x4 = x3;
- y4 = y2;
- y3 = y1;
-
- for i := 0 step 1 until linecount - 1:
- draw_gridline (z1 - (1.5 * i * stemthick, 0),
- z2 - (1.5 * i * stemthick, 0), stemthick);
- draw_gridline (z3 + (1.5 * i * stemthick, 0),
- z4 + (1.5 * i * stemthick, 0), stemthick);
- endfor;
-enddef;
-
-
-fet_beginchar ("Brevis notehead", "sM1");
- draw_brevis (1);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Brevis notehead", "sM1");
- draw_brevis(1);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Double-lined brevis notehead", "sM1double");
- draw_brevis (2);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Double-lined brevis notehead", "sM1double");
- draw_brevis (2);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Whole notehead", "s0");
- draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0);
- undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
- 0.68, 2 stafflinethickness#);
-
- whole_notehead_width# := charwd;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Whole notehead", "s0");
- draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0,
- 0.707, 0);
- undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
- 0.68, 2 stafflinethickness#);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Half notehead", "s1");
- draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
- undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
-
- half_notehead_width# := charwd;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Half notehead", "s1");
- draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34,
- 0.66, 0.17);
- undraw_inside_ellipse (3.25, 33, 0.81,
- 2.5 stafflinethickness#);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Quart notehead", "s2");
- % used to have 32. With 31, they are slightly bolder.
- draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, 0.707, 0);
- black_notehead_width# := charwd;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Quart notehead", "s2");
- draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
- 0.707, 0);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-fet_beginchar ("Whole diamondhead", "s0diamond");
- draw_outside_ellipse (1.80, 0, 0.495, 0);
- undraw_inside_ellipse (1.30, 125, 0.6,
- .4 staff_space# + stafflinethickness#);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Whole diamondhead", "s0diamond");
- draw_outside_ellipse (1.80, 0, 0.495, 0);
- undraw_inside_ellipse (1.30, 125, 0.6,
- .4 staff_space# + stafflinethickness#);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Half diamondhead", "s1diamond");
- draw_outside_ellipse (1.50, 34, 0.49, 0.17);
- undraw_inside_ellipse (3.5, 33, 0.80,
- .3 staff_space# + 1.5 stafflinethickness#);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Half diamondhead", "s1diamond");
- draw_outside_ellipse (1.50, 34, 0.49, 0.17);
- undraw_inside_ellipse (3.5, 33, 0.80,
- .3 staff_space#
- + 1.5 stafflinethickness#);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Quart diamondhead", "s2diamond");
- draw_outside_ellipse (1.80, 35, 0.495, -0.25);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Quart diamondhead", "s2diamond");
- draw_outside_ellipse (1.80, 35, 0.495, -0.25);
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
-vardef penposx@# (expr d) =
-begingroup;
- save pat;
- path pat;
-
- pat = top z@#
- .. lft z@#
- .. bot z@#
- .. rt z@#
- .. cycle;
- z@#l = pat intersectionpoint (z@# -- infinity * dir (d + 180));
- z@#r = pat intersectionpoint (z@# -- infinity * dir (d));
-endgroup
-enddef;
-
-
-%
-% UGH: xs not declared as argument.
-%
-def define_triangle_shape (expr stemdir) =
- save triangle_a, triangle_b, triangle_c;
- save triangle_out_a, triangle_out_b, triangle_out_c;
- save triangle_in, triangle_out;
- save width, depth, height;
- save origin, left_up_dir;
- save exact_left_point, exact_right_point, exact_down_point;
-
- path triangle_a, triangle_b, triangle_c;
- path triangle_out_a, triangle_out_b, triangle_out_c;
- path triangle_in, triangle_out;
- pair origin, left_up_dir;
- pair exact_down_point, exact_left_point, exact_right_point;
-
- save pen_thick;
- pen_thick# = stafflinethickness# + .1 staff_space#;
- define_pixels (llap);
- define_blacker_pixels (pen_thick);
-
- left_up_dir = llap# * dir (90 + tilt);
-
- xpart (left_up_dir) * xs - (pen_thick# * xs) / 2 + xpart origin = 0;
- ypart origin = 0;
-
- exact_left_point := origin + (left_up_dir xscaled xs);
- exact_down_point := origin + (left_up_dir rotated 120 xscaled xs);
- exact_right_point := origin + (left_up_dir rotated 240 xscaled xs);
-
- height# = ypart (exact_left_point + origin) + pen_thick# / 2;
- depth# = -ypart (exact_down_point + origin) + pen_thick# / 2;
- width# = xpart (exact_right_point - exact_left_point)
- + pen_thick# * xs;
-
- set_char_box (0, width#, depth#, height#);
-
- % Formerly, the shape has simply been drawn with an elliptical pen
- % (`scaled pen_thick xscaled xs'), but the envelope of such a curve
- % is of 6th degree. For the sake of mf2pt1, we approximate it.
-
- pickup pencircle scaled pen_thick xscaled xs;
-
- z0 = (hround_pixels (xpart origin), 0);
-
- z1 = z1' = z0 + llap * dir (90 + tilt) xscaled xs;
- z2 = z2' = z0 + llap * dir (90 + tilt + 120) xscaled xs;
- z3 = z3' = z0 + llap * dir (90 + tilt + 240) xscaled xs;
-
- z12 = caveness [.5[z1, z2], z3];
- z23 = caveness [.5[z2, z3], z1];
- z31 = caveness [.5[z3, z1], z2];
-
- triangle_a = z1 .. z12 .. z2;
- triangle_b = z2 .. z23 .. z3;
- triangle_c = z3 .. z31 .. z1;
-
- penposx1 (angle (direction 0 of triangle_a) - 90);
- penposx2 (angle (direction 0 of triangle_b) - 90);
- penposx3 (angle (direction 0 of triangle_c) - 90);
-
- penposx1' (angle (direction infinity of triangle_c) + 90);
- penposx2' (angle (direction infinity of triangle_a) + 90);
- penposx3' (angle (direction infinity of triangle_b) + 90);
-
- penposx12 (angle (z12 - z0));
- penposx23 (angle (z23 - z0));
- penposx31 (angle (z31 - z0));
-
- z10 = (z0 -- z1) intersectionpoint (z1l .. z12l .. z2'r);
- z20 = (z0 -- z2) intersectionpoint (z2l .. z23l .. z3'r);
- z30 = (z0 -- z3) intersectionpoint (z3l .. z31l .. z1'r);
-
- triangle_in = z10
- .. z12l
- .. z20
- & z20
- .. z23l
- .. z30
- & z30
- .. z31l
- .. z10
- & cycle;
-
- triangle_out_a = z1r .. z12r .. z2'l;
- triangle_out_b = z2r .. z23r .. z3'l;
- triangle_out_c = z3r .. z31r .. z1'l;
-
- triangle_out = top z1
- .. lft z1
- .. z1r{direction 0 of triangle_out_a}
- & triangle_out_a
- & {direction infinity of triangle_out_a}z2'l
- .. lft z2
- .. bot z2
- .. z2r{direction 0 of triangle_out_b}
- & triangle_out_b
- & {direction infinity of triangle_out_b}z3'l
- .. rt z3
- .. top z3
- .. z3r{direction 0 of triangle_out_c}
- & triangle_out_c
- & {direction infinity of triangle_out_c}z1'l
- .. cycle;
-
- labels (0, 10, 20, 30);
- penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
-
- % attachment Y
- if stemdir = 1:
- charwy := ypart exact_right_point;
- charwx := xpart exact_right_point + .5 pen_thick# * xs;
- else:
- charwy := -ypart exact_down_point;
- charwx := width# - (xpart exact_down_point - .5 pen_thick# * xs);
- fi
-enddef;
-
-
-def draw_whole_triangle_head =
- save hei, xs;
- save llap;
- save tilt;
-
- tilt = 40;
- llap# = 3/4 noteheight#;
-
- xs = 1.5;
- caveness := 0.1;
- define_triangle_shape (1);
- fill triangle_out;
- unfill triangle_in;
-enddef;
-
-
-fet_beginchar ("Whole trianglehead", "s0triangle");
- draw_whole_triangle_head;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Whole trianglehead", "s0triangle");
- draw_whole_triangle_head;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-def draw_small_triangle_head (expr dir) =
- save hei, xs;
- save llap;
- save tilt;
-
- tilt = 40;
- llap# = 2/3 noteheight#;
- xs = 1.2;
- caveness := 0.1;
- define_triangle_shape (dir);
-
- pickup feta_fillpen;
-
- filldraw triangle_out;
- unfilldraw triangle_in;
-enddef;
-
-
-fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
- draw_small_triangle_head (-1);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
- draw_small_triangle_head (1);
-
- draw_staff (-2, 2, 0.5);
-fet_endchar;
-
-
-def draw_closed_triangle_head (expr dir) =
- save hei, xs;
- save llap;
- save tilt;
-
- tilt = 40;
- llap# = 2/3 noteheight#;
- xs = 1.0;
- caveness := 0.1;
- define_triangle_shape (dir);
- fill triangle_out;
-enddef;
-
-
-fet_beginchar ("Quart trianglehead (upstem)", "u2triangle");
- draw_closed_triangle_head (1);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Quart trianglehead (downstem)", "d2triangle");
- draw_closed_triangle_head (-1);
-
- draw_staff (-2, 2, 0.5);
-fet_endchar;
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Slash heads are for indicating improvisation. They are
-% twice as high as normal heads.
-%
-def draw_slash (expr hwid_hash) =
- save exact_height;
- save ne, nw_dist;
- pair ne, nw_dist;
- exact_height = staff_space# + stafflinethickness# / 2;
-
- set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
- exact_height, exact_height);
-
- charwx := charwd;
- charwy := charht;
-
- clearxy;
-
- d := d - feta_shift;
-
- pickup pencircle scaled blot_diameter;
-
- bot y1 = -d;
- top y2 = h;
- lft x1 = 0;
- lft x2 = 2 h / slash_slope;
-
- rt x3 = w;
- y3 = y2;
- y4 = y1;
- x3 - x2 = x4 - x1;
-
- ne = unitvector (z3 - z4);
- nw_dist = (ne rotated 90) * 0.5 blot_diameter;
-
- fill bot z1{left}
- .. (z1 + nw_dist){ne}
- -- (z2 + nw_dist){ne}
- .. top z2{right}
- -- top z3{right}
- .. (z3 - nw_dist){-ne}
- -- (z4 - nw_dist){-ne}
- .. bot z4{left}
- -- cycle;
-
- if hwid_hash > 2 slash_thick#:
- save th;
-
- th = slash_thick - blot_diameter;
- y6 = y7;
- y5 = y8;
- y3 - y7 = th;
- y5 - y1 = th;
- z6 - z5 = whatever * ne;
- z8 - z7 = whatever * ne;
-
- z5 = z1 + whatever * ne + th * (ne rotated -90);
- z8 = z4 + whatever * ne + th * (ne rotated 90);
-
- unfill z5
- -- z6
- -- z7
- -- z8
- -- cycle;
- fi
- labels (range 1 thru 10);
-enddef;
-
-
-fet_beginchar ("Whole slashhead", "s0slash");
- draw_slash (4 slash_thick# + 0.5 staff_space#);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Half slashhead", "s1slash");
- draw_slash (3.0 slash_thick# + 0.15 staff_space#);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Quart slashhead", "s2slash");
- draw_slash (1.5 slash_thick#);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% `thick' is the distance between the NE/SW parallel lines in the cross
-% (distance between centres of lines) in multiples of stafflinethickness
-%
-def draw_cross (expr thick) =
- save ne, nw;
- save ne_dist, nw_dist, rt_dist, up_dist;
- save crz_in, crz_out;
- save thickness;
- pair ne, nw;
- pair ne_dist, nw_dist, rt_dist, up_dist;
- path crz_in, crz_out;
-
- pen_thick# := 1.2 stafflinethickness#;
- thickness# := thick * stafflinethickness#;
- define_pixels (thickness);
- define_blacker_pixels (pen_thick);
-
- pickup pencircle scaled pen_thick;
-
- h := h - feta_shift;
-
- top y3 = h;
- ne = unitvector ((1, (2 h - pen_thick) / (w - pen_thick)));
- rt x4 = w / 2;
- y5 = 0;
- z4 - z5 = whatever * ne;
- x6 = 0;
- z6 - z3 = whatever * ne;
- z3 - z4 = whatever * (ne yscaled -1);
-
- z4 - z3 = whatever * (ne) + (ne rotated -90) * thickness;
-
-
- x1 = charwd / 2 - .5 pen_thick#;
- z1 = whatever * ne
- + thick / 2 * stafflinethickness# * (ne rotated -90);
-
- % labels (1, 2, 3, 4, 5, 6);
-
- nw = unitvector (z3 - z4);
-
- up_dist = up * 0.5 pen_thick / cosd (angle (ne));
- rt_dist = right * 0.5 pen_thick / sind (angle (ne));
- nw_dist = (ne rotated 90) * 0.5 pen_thick;
- ne_dist = (nw rotated -90) * 0.5 pen_thick;
-
- x4' := x4;
- x5' := x5;
- y6' := y6;
-
- x4 := hround (x4' + .5 pen_thick) - .5 pen_thick;
- x5 := hfloor (x5' + xpart rt_dist) - xpart rt_dist;
- y6 := vfloor (y6' + ypart up_dist) - ypart up_dist;
-
- crz_out = (z6 + up_dist)
- -- (z3 + nw_dist){ne}
- .. (top z3)
- .. (z3 + ne_dist){-nw}
- -- (z4 + ne_dist){-nw}
- .. (rt z4)
- .. (z4 - nw_dist){-ne}
- -- (z5 + rt_dist);
- crz_out := crz_out shifted (0, feta_shift)
- -- reverse crz_out yscaled -1 shifted (0, -feta_eps);
- fill crz_out
- -- reverse crz_out xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
-
- if (thick > 1):
- x4 := hround (x4' - xpart rt_dist) + xpart rt_dist;
- x5 := hceiling (x5' - .5 pen_thick) + .5 pen_thick;
- y6 := vfloor (y6' - .5 pen_thick) + .5 pen_thick;
-
- crz_in = (bot z6){right}
- .. (z6 - nw_dist){ne}
- -- (z3 - up_dist)
- -- (z4 - rt_dist)
- -- (z5 + nw_dist){-ne}
- .. {down}(lft z5);
- crz_in := crz_in shifted (0, feta_shift)
- -- reverse crz_in yscaled -1 shifted (0, -feta_eps);
- unfill crz_in
- -- reverse crz_in xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
- fi
-
- % ugh
- currentpicture := currentpicture shifted (hround (w / 2), 0);
-
- charwx := charwd;
- charwy := y1 + feta_shift;
-
- z12 = (charwx * hppp, y1 * vppp);
-
- labels (12);
-enddef;
-
-
-fet_beginchar ("Whole Crossed notehead", "s0cross");
- save wid, hei;
-
- wid# := black_notehead_width# + 4 stafflinethickness#;
- hei# := noteheight# + stafflinethickness#;
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- draw_cross (3.75);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Whole Crossed notehead", "s0cross");
- save wid, hei;
-
- wid# := black_notehead_width# + 4 stafflinethickness#;
- hei# := noteheight# + stafflinethickness#;
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- currentpicture := remember_pic;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Half Crossed notehead", "s1cross");
- save wid, hei;
-
- wid# := black_notehead_width# + 2 stafflinethickness#;
- hei# := noteheight# + stafflinethickness# / 2;
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- draw_cross (3.0);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Half Crossed notehead", "s1cross");
- save wid, hei;
-
- wid# := black_notehead_width# + 2 stafflinethickness#;
- hei# := noteheight# + stafflinethickness# / 2;
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- currentpicture := remember_pic;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("Crossed notehead", "s2cross");
- wid# := black_notehead_width#;
- hei# := noteheight#;
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- draw_cross (1.0);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("Crossed notehead", "s2cross");
- wid# := black_notehead_width#;
- hei# := noteheight#;
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- currentpicture := remember_pic;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-fet_beginchar ("X-Circled notehead", "s2xcircle");
- save wid, hei;
- save cthick, cxd, cyd, dy;
-
- wid# := black_notehead_width# * sqrt (sqrt2);
- hei# := noteheight# * sqrt (sqrt2);
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- d := d - feta_space_shift;
-
- cthick# := (1.2 + 1/4) * stafflinethickness#;
- define_blacker_pixels (cthick);
-
- cxd := w - cthick;
- cyd := h + d - cthick / 2;
-
- dy = .5 (h - d);
-
- pickup pencircle scaled cthick;
-
- fill fullcircle xscaled (cxd + cthick)
- yscaled (cyd + cthick)
- shifted (w / 2, dy);
- unfill fullcircle xscaled (cxd - cthick)
- yscaled (cyd - cthick)
- shifted (w / 2, dy);
-
- xpos := .5 cxd / sqrt2;
- ypos := .5 cyd / sqrt2;
-
- pickup penrazor scaled cthick rotated (angle (xpos, ypos) + 90);
- draw (-xpos + w / 2, -ypos + dy) -- (xpos + w / 2, ypos + dy);
-
- pickup penrazor scaled cthick rotated (angle (xpos, -ypos) + 90);
- draw (-xpos + w / 2, ypos + dy) -- (xpos + w / 2, -ypos + dy);
-
- charwx := charwd;
- charwy := 0;
-
- z12 = (charwx * hppp, charwy * vppp);
- labels (12);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-if test > 0:
- fet_beginchar ("X-Circled notehead", "s2xcircle");
- save wid, hei;
- save cthick, cxr, cyr;
-
- wid# := black_notehead_width# * sqrt (sqrt2);
- hei# := noteheight# * sqrt (sqrt2);
-
- set_char_box (0, wid#, hei# / 2, hei# / 2);
-
- currentpicture := remember_pic;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-
-
-%%%%%%%%
-%
-% SOLFA SHAPED NOTES
-%
-
-save solfa_pen_thick;
-solfa_pen_thick# = 1.75 stafflinethickness#;
-define_blacker_pixels (solfa_pen_thick);
-
-
-save solfa_base_notewidth;
-solfa_base_notewidth# := black_notehead_width#;
-
-solfa_whole_width := whole_notehead_width# / black_notehead_width#;
-solfa_half_width := half_notehead_width# / black_notehead_width#;
-solfa_quarter_width := 1.0;
-
-def draw_do_head (expr width_factor, dir) =
- save p_in, p_out;
- save left_dist, right_dist;
- path p_in, p_out;
- pair left_dist, right_dist;
-
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
-
- pickup pencircle scaled solfa_pen_thick;
-
- bot y1 = -d;
- y1 = y2;
- lft x1 = 0;
- rt x2 = w;
- top y3 = h;
- x3 =.5 [x1, x2];
-
- left_dist = (unitvector (z3 - z1) rotated 90) * 0.5 solfa_pen_thick;
- right_dist = (unitvector (z2 - z3) rotated 90) * 0.5 solfa_pen_thick;
-
- p_in := (((z1 - left_dist) -- (z3 - left_dist)) intersectionpoint
- (top z1 -- top z2))
- -- ((top z1 -- top z2) intersectionpoint
- ((z2 - right_dist) -- (z3 - right_dist)))
- -- (((z2 - right_dist) -- (z3 - right_dist)) intersectionpoint
- ((z1 - left_dist) -- (z3 - left_dist)))
- -- cycle;
-
- p_out := bot z1
- -- bot z2{right}
- .. rt z2{up}
- .. (z2 + right_dist){z3 - z2}
- -- (z3 + right_dist){z3 - z2}
- .. top z3{left}
- .. (z3 + left_dist){z1 - z3}
- -- (z1 + left_dist){z1 - z3}
- .. lft z1{down}
- .. {right}cycle;
-
-
- labels (1, 2, 3);
-
- charwx := charwd;
- charwy := -chardp + 0.5 stafflinethickness#;
- if dir = -1:
- charwy := -charwy;
- fi;
-enddef;
-
-
-fet_beginchar ("Whole dohead", "s0do");
- draw_do_head (solfa_whole_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half dohead", "d1do");
- draw_do_head (solfa_half_width, -1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half dohead", "u1do");
- draw_do_head (solfa_half_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Quart dohead", "d2do");
- draw_do_head (solfa_quarter_width, -1);
- fill p_out;
-fet_endchar;
-
-
-fet_beginchar ("Quart dohead", "u2do");
- draw_do_head (solfa_quarter_width, 1);
- fill p_out;
-fet_endchar;
-
-
-%
-% re - flat top, curved bottom:
-% (0,h/2) {dir -90} .. (w/2,-h/2) .. {dir 90} (w,h/2) -- cycle;
-% (broader along the base and with more vertical sides for half and
-% whole notes)
-% stem attachment: h/2
-%
-
-def draw_re_head (expr width_factor, dir) =
- save p_in, p_out;
- path p_in, p_out;
-
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
-
- pickup pencircle scaled solfa_pen_thick;
-
- save curve_start;
- curve_start = 0.7;
- lft x1 = 0;
- y1 = y5;
- x1 = x2;
- y2 = curve_start [y3, y1];
- bot y3 = -d;
- x3 = .5 [x2, x4];
- rt x4 = w;
- y4 = y2;
- top y5 = h;
- x5 = x4;
-
- labels (range 1 thru 5);
-
- p_in := (z1 + 0.5 solfa_pen_thick * (1, -1))
- -- rt z2{down}
- .. top z3
- .. lft z4{up}
- -- (z5 + 0.5 solfa_pen_thick * (-1, -1))
- -- cycle;
-
- p_out := lft z1
- -- lft z2{down}
- .. bot z3
- .. rt z4{up}
- -- rt z5{up}
- .. top z5{left}
- -- top z1{left}
- .. {down}cycle;
-
- charwx := charwd;
- charwy := curve_start [-chardp, charht];
-
- if dir = -1:
- charwy := -charwy;
- fi;
-enddef;
-
-
-fet_beginchar ("Whole rehead", "s0re");
- draw_re_head (solfa_whole_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half up rehead", "u1re");
- draw_re_head (solfa_half_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half down rehead", "d1re");
- draw_re_head (solfa_half_width, -1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Quart rehead", "u2re");
- draw_re_head (solfa_quarter_width, 1);
- fill p_out;
-fet_endchar;
-
-
-fet_beginchar ("Quart rehead", "d2re");
- draw_re_head (solfa_quarter_width, -1);
- fill p_out;
-fet_endchar;
-
-
-def draw_mi_head (expr width_factor) =
- save path_out, path_in;
- save ne_dist, se_dist, ne, se;
- path path_out, path_in;
- pair ne_dist, se_dist, ne, se;
-
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
-
- pickup pencircle scaled solfa_pen_thick;
-
- lft x1 = 0;
- y1 = 0;
- bot y2 = -d;
- x2 = .5 [x1, x3];
- rt x3 = w;
- x4 = x2;
- y3 = y1;
- top y4 = h;
-
- z6 - z5 = whatever * (z2 - z1);
- z8 - z7 = whatever * (z2 - z1);
- z8 - z5 = whatever * (z4 - z1);
- z6 - z7 = whatever * (z4 - z1);
-
- ne = unitvector (z4 - z1);
- se = unitvector (z1 - z2);
-
- ne_dist = (ne rotated 90) * 0.5 solfa_pen_thick;
- se_dist = (se rotated 90) * 0.5 solfa_pen_thick;
-
- z5 = whatever [z1, z4] - ne_dist;
- z5 = whatever [z1, z2] - 1.5 se_dist;
-
- z5 - z1 = -(z7 - z3);
-
- labels (range 1 thru 8);
-
- path_in := z5
- -- z6
- -- z7
- -- z8
- -- cycle;
-
- path_out := lft z1
- .. (z1 + se_dist){-se}
- -- (z2 + se_dist){-se}
- .. bot z2
- .. (z2 - ne_dist){ne}
- -- (z3 - ne_dist){ne}
- .. rt z3
- .. (z3 - se_dist){se}
- -- (z4 - se_dist){se}
- .. top z4
- .. (z4 + ne_dist){-ne}
- -- (z1 + ne_dist){-ne}
- .. cycle;
-enddef;
-
-
-fet_beginchar ("Whole mihead", "s0mi");
- draw_mi_head (solfa_whole_width);
- fill path_out;
- unfill path_in;
-fet_endchar;
-
-
-fet_beginchar ("Half mihead", "s1mi");
- draw_mi_head (solfa_quarter_width);
- fill path_out;
- unfill path_in;
-fet_endchar;
-
-
-fet_beginchar ("Quart mihead", "s2mi");
- draw_mi_head (solfa_quarter_width);
- fill path_out;
-fet_endchar;
-
-
-def draw_fa_head (expr width_factor) =
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
-
- save p_down_in, p_down_out, p_up_in, p_up_out, nw_dist, nw;
- path p_down_in, p_down_out, p_up_in, p_up_out;
- pair nw_dist, nw;
-
- pickup pencircle scaled solfa_pen_thick;
-
- lft x1 = 0;
- top y1 = h;
-
- rt x2 = w;
- y2 = y1;
- bot y3 = -d;
- x3 = x2;
-
- y4 = y3;
- x4 = x1;
-
- labels (1, 2, 3, 4);
-
- nw = unitvector (z1 - z3);
- nw_dist = (nw rotated 90) * 0.5 solfa_pen_thick;
-
- p_up_in := (((z1 - nw_dist) -- (z3 - nw_dist)) intersectionpoint
- (bot z1 -- bot z2))
- -- (((z1 - nw_dist) -- (z3 - nw_dist)) intersectionpoint
- (lft z3 -- lft z2))
- -- (z2 + 0.5 solfa_pen_thick * (-1, -1))
- -- cycle;
-
- p_up_out := lft z1{down}
- .. (z1 + nw_dist){-nw}
- -- (z3 + nw_dist){-nw}
- .. bot z3{right}
- .. rt z3{up}
- -- rt z2{up}
- .. top z2{left}
- -- top z1{left}
- .. {down}cycle;
-
- p_down_in := p_up_in rotated 180 shifted (w, 0);
- p_down_out := p_up_out rotated 180 shifted (w, 0);
-
- charwy := 0.0;
- charwx := charwd;
-enddef;
-
-
-fet_beginchar ("Whole fa up head", "u0fa");
- draw_fa_head (solfa_whole_width);
- fill p_up_out;
- unfill p_up_in;
-fet_endchar;
-
-
-fet_beginchar ("Whole fa down head", "d0fa");
- draw_fa_head (solfa_whole_width);
- fill p_down_out;
- unfill p_down_in;
-fet_endchar;
-
-
-fet_beginchar ("half fa up head", "u1fa");
- draw_fa_head (solfa_half_width);
- fill p_up_out;
- unfill p_up_in;
-fet_endchar;
-
-
-fet_beginchar ("Half fa down head", "d1fa");
- draw_fa_head (solfa_half_width);
- fill p_down_out;
- unfill p_down_in;
-fet_endchar;
-
-
-fet_beginchar ("Quarter fa up head", "u2fa");
- draw_fa_head (solfa_quarter_width);
- fill p_up_out;
-fet_endchar;
-
-
-fet_beginchar ("Quarter fa down head", "d2fa");
- draw_fa_head (solfa_quarter_width);
- fill p_down_out;
-fet_endchar;
-
-
-def draw_la_head (expr width_factor) =
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
- save p_in, p_out;
- path p_in, p_out;
-
- pickup pencircle scaled solfa_pen_thick;
-
- lft x1 = 0;
- top y1 = h;
-
- rt x2 = w;
- y2 = y1;
- bot y3 = -d;
- x3 = x2;
-
- y4 = y3;
- x4 = x1;
-
- labels (range 1 thru 4);
-
- p_in := (z1 + 0.5 solfa_pen_thick * (1, -1))
- -- (z2 + 0.5 solfa_pen_thick * (-1, -1))
- -- (z3 + 0.5 solfa_pen_thick * (-1, 1))
- -- (z4 + 0.5 solfa_pen_thick * (1, 1))
- -- cycle;
-
- p_out := top z1
- -- top z2{right}
- .. rt z2{down}
- -- rt z3{down}
- .. bot z3{left}
- -- bot z4{left}
- .. lft z4{up}
- -- lft z1{up}
- .. cycle;
-enddef;
-
-
-fet_beginchar ("Whole lahead", "s0la");
- draw_la_head (solfa_whole_width);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half lahead", "s1la");
- draw_la_head (solfa_half_width);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Quart lahead", "s2la");
- draw_la_head (solfa_quarter_width);
- fill p_out;
-fet_endchar;
-
-
-def draw_ti_head (expr width_factor, dir) =
- set_char_box (0, width_factor * solfa_base_notewidth#,
- 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
- save p_in, p_out, p_top;
- save nw_dist, sw_dist, nw, sw;
- path p_in, p_out, p_top;
- pair nw_dist, sw_dist, nw, sw;
- save cone_height;
- cone_height = 0.64;
-
- pickup pencircle scaled solfa_pen_thick;
-
- x1 = .5 [x2, x4];
- bot y1 = -d;
- lft x2 = 0;
- y2 = cone_height [y1, y3];
- rt x4 = w;
- y4 = y2;
- x3 = x1;
- top y3 = h;
-
- labels (range 1 thru 4);
-
- nw = unitvector (z2 - z1);
- sw = unitvector (z1 - z4);
-
- nw_dist = (nw rotated 90) * 0.5 solfa_pen_thick;
- sw_dist = (sw rotated 90) * 0.5 solfa_pen_thick;
-
- p_top := (z2 - sw_dist)
- .. (top z3){right}
- .. (z4 - nw_dist);
-
- p_in := (((z1 - nw_dist) -- (z2 - nw_dist)) intersectionpoint
- ((z1 - sw_dist) -- (z4 - sw_dist)))
- -- (((z1 - nw_dist) -- (z2 - nw_dist)) intersectionpoint
- ((z2 + sw_dist) .. {right}(bot z3)))
- .. bot z3
- .. (((bot z3){right} .. (z4 + nw_dist)) intersectionpoint
- ((z1 - sw_dist) -- (z4 - sw_dist)))
- -- cycle;
-
- p_out := bot z1
- .. (z1 + nw_dist)
- -- (z2 + nw_dist)
- .. lft z2
- .. (z2 - sw_dist){direction 0 of p_top}
- & p_top
- & {direction infinity of p_top}(z4 - nw_dist)
- .. rt z4
- .. (z4 + sw_dist)
- -- (z1 + sw_dist)
- .. cycle;
-
- charwx := charwd;
- charwy := cone_height [-chardp, charht];
- if dir = -1:
- charwy := -charwy;
- fi;
-enddef;
-
-
-fet_beginchar ("Whole up tihead", "s0ti");
- draw_ti_head (solfa_whole_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half up tihead", "u1ti");
- draw_ti_head (solfa_half_width, 1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Half down tihead", "d1ti");
- draw_ti_head (solfa_half_width, -1);
- fill p_out;
- unfill p_in;
-fet_endchar;
-
-
-fet_beginchar ("Quart up tihead", "u2ti");
- draw_ti_head (solfa_quarter_width, 1);
- fill p_out;
-fet_endchar;
-
-
-fet_beginchar ("Quart down tihead", "d2ti");
- draw_ti_head (solfa_quarter_width, -1);
- fill p_out;
-fet_endchar;
-
-
-fet_endgroup ("noteheads");
-
-
-%
-% we derive black_notehead_width# from the quarter head,
-% so we have to define black_notehead_width (pixel qty)
-% after the black_notehead_width# itself.
-%
-% Let's keep it outside the group as well.
-%
-
-define_pixels (black_notehead_width);
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 0;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 1;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 2;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 3;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 4;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 5;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 6;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 7;
-input feta-beugel;
+input feta-braces;
end.
% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
font_count := 8;
-input feta-beugel;
+input feta-braces;
end.
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- Staff braces
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+% Jan Nieuwenhuizen <janneke@gnu.org>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+% We have to reduce the pixel-per-point value to
+% support large brace glyphs in case we are using MetaPost
+% (which by default sets `hppp' to 49.80244, regardless of
+% the used `mag' value)
+
+if known miterlimit:
+ bpppix_ := 0.2; % ten times larger than original
+
+ numeric mm, pt, dd, bp, cm, pc, cc, in;
+
+ mm * bpppix_ = 2.83464;
+ pt * bpppix_ = 0.99626;
+ dd * bpppix_ = 1.06601;
+ bp * bpppix_ = 1;
+ cm * bpppix_ = 28.34645;
+ pc * bpppix_ = 11.95517;
+ cc * bpppix_ = 12.79213;
+ in * bpppix_ = 72;
+
+ hppp := pt;
+ vppp := pt;
+fi;
+
+
+input feta-autometric;
+input feta-macros;
+
+staffsize# := 20 pt#; %% arbitrary
+
+input feta-params;
+
+%
+% We must let the design increase for each font to make sure that mftrace
+% doesn't jack up the resolution too highly for the longer braces.
+%
+
+fet_beginfont ("feta-braces-" & char (97 + font_count),
+ (font_count + 1) * 20, "fetaBraces");
+
+mode_setup;
+
+
+save code, braces_per_font;
+code := 64;
+braces_per_font := 64;
+
+def draw_brace (expr height_sharp, width_sharp, slt_sharp, brace_number) =
+ save pendir, height, width, thin, thick, slt, pat;
+ save penangle;
+ pair pendir;
+ path pat;
+
+ height# := height_sharp;
+ width# := width_sharp;
+ slt# := slt_sharp;
+
+ fet_beginchar ("brace number " & decimal (brace_number),
+ "brace" & decimal (brace_number))
+ set_char_box (width#, 0, height# / 2, height# / 2);
+
+ define_pixels (height, width, slt);
+ thin = 2 slt;
+ thick = .5 width;
+
+ z2 = .5 [z1, z3];
+ y3l = y1 + height / 2;
+ x3 = x1 + width;
+ y1 = 0;
+ x1 = -b;
+ y0 = y1;
+ x0 = x1 - 2/6 thin;
+
+ pendir = unitvector (x3 - x1, y3l / 6 - y1);
+ penangle = angle pendir - 90;
+ penpos3 (thin, penangle);
+ penpos2 (thick, angle (z3 - z1) - 90);
+ penpos1 (2/3 thin, penangle);
+
+ penlabels (1, 2, 3);
+ labels (0);
+
+ pat := z2r
+ .. simple_serif (z3r, z3l, 90)
+ .. z2l
+ .. z1l{dir (angle (z1r - z1l) - 90)}
+ .. z0{down}
+ .. z1r{-dir (angle (z1l - z1r) + 90)}
+ .. cycle;
+ pat := subpath (0, 5) of pat
+ -- subpath (6, 7) of pat
+ .. cycle;
+
+ fill pat;
+ fill pat yscaled -1;
+ fet_endchar;
+enddef;
+
+
+save stafflinethickness;
+save increment;
+
+linethickness := 0.5 pt#;
+increment := 0.5 pt#;
+y := 10 pt#;
+
+for i := 0 step 1 until font_count:
+ save number;
+
+ number := braces_per_font * i;
+
+ for j := 0 step 1 until (braces_per_font - 1):
+ % message "l: "&decimal l;
+ % note: define_pixels (x) multiplies x by hppp,
+ % must never get bigger than infinity
+ y := y + increment;
+ if y > infinity / hppp:
+ message "Resolution and/or magnification is too high";
+ message "HPPP: "& decimal hppp &" Y: " & decimal y;
+ errmessage "please report to <bug-lilypond@gnu.org>";
+ fi;
+
+ % x should be about one staff space, taking brace to have
+ % default height of 3 staffs, this yields height / 3 / 4 = 12
+ % but 15 looks better
+ x := y / 15;
+
+ increment := x / 10;
+ linethickness := min (0.5 pt#, y / 150);
+ if i = font_count:
+ draw_brace (y, x, linethickness, number);
+ fi;
+
+ number := number + 1;
+ endfor;
+endfor;
+
+fet_endfont ("feta-braces");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- bracket tips -*-Fundamental-*-
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("brackettips");
+
+def draw_bracket (expr thick_sharp, width_sharp, updown) =
+begingroup;
+ save p, thin, thick, flattening, width, hair, flare;
+ path p;
+ pair tipdir;
+
+ flattening = 0.72;
+ thick# = thick_sharp;
+ flare# = flattening * width#;
+ width# = width_sharp;
+
+ define_pixels (thick, width, flare);
+ if updown = 1:
+ set_char_box (0, width#,
+ .5 thick#, flare#);
+ else:
+ set_char_box (0, width#,
+ flare#, .5 thick#);
+ fi;
+
+ thin = 2 linethickness;
+ hair = 1.25 linethickness;
+
+ pickup pencircle scaled thin;
+ y7 = y1;
+ x7 = x2;
+ z2 = z4r + (thin, 0);
+
+ penpos3 (thin, 0);
+ penpos4 (thin, 90);
+
+ z3 = z4;
+
+ top y3 = 0.5 thick;
+ lft x3 = 0.0;
+ x1 = x3l;
+ y1 = -0.5 thick;
+
+ z8 = .5 [z2, z7];
+ top y5 = flare;
+ rt x5 = width;
+
+ p := z8{right}
+ ..tension 1.2.. z5{curl 0};
+ tipdir := direction 1 of p;
+
+ penpos5 (hair, angle tipdir);
+ penpos6 (hair, 90 + angle tipdir);
+
+ z5 = z6;
+
+ pickup pencircle scaled 1;
+
+ fill (z1
+ -- z3l{up}
+ .. z4r{right}
+ -- z2{right}
+ .. z6r{tipdir}
+ .. z5r
+ .. z6l{-tipdir}
+ ..tension 1.1.. z7{left}
+ & z7
+ -- z1
+ & cycle) yscaled updown;
+
+ if updown = 1:
+ penlabels (1, 2, 3, 4, 5, 6, 7, 8);
+ fi;
+endgroup;
+enddef;
+
+
+fet_beginchar ("bracket tip up", "up");
+ draw_bracket (0.45 staff_space#, 1.9 staff_space#, 1);
+fet_endchar;
+
+
+fet_beginchar ("bracket tip down", "down");
+ draw_bracket (0.45 staff_space#, 1.9 staff_space#, -1);
+fet_endchar;
+
+fet_endgroup ("brackettips");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- implement Clefs -*-Fundamental-*-
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+% Jan Nieuwenhuizen <janneke@gnu.org>,
+% Juergen Reuter <reuter@ipd.uka.de>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+fet_begingroup ("clefs");
+
+%
+% [Wanske] says the bulbs should be positioned about 1/4 right of the
+% `arrow'.
+%
+% TODO: The hair-curve at z6r looks a little awkward.
+%
+
+def draw_c_clef (expr reduction) =
+ save hair, norm, reduced_ss, right_edge;
+ save xoff;
+
+ reduced_ss# = staff_space# * reduction;
+ norm# := 2/3 reduced_ss#;
+ hair# := 0.06 reduced_ss# + 0.5 linethickness#;
+ right_edge# = 15/4 norm# + 2 hair#;
+ define_pixels (norm, reduced_ss, right_edge);
+ define_whole_vertical_blacker_pixels (hair);
+
+ set_char_box (0, right_edge#, 2 reduced_ss#, 2 reduced_ss#);
+
+ % make unreduced glyph fit exactly into five staff lines
+ if reduction = 1:
+ h := d := 2 staff_space_rounded;
+ fi;
+
+ % assure that the gap between the left and right stem
+ % has the same number of pixels as the thickness of the right
+ % stem
+ draw_block ((0, -d + feta_shift),
+ (3/4 norm + 1/2 hair, h));
+ draw_block ((3/4 norm + 1/2 hair + hround (3/2 hair), -d + feta_shift),
+ (3/4 norm + 1/2 hair + 2 hround (3/2 hair), h));
+
+ % assure symmetry
+ h := h - feta_shift;
+
+ pickup feta_fillpen;
+
+ xoff = 3/4 norm + 1/2 hair + 2 hround (3/2 hair);
+ z5l = (xoff - 3/4 hair, 0);
+ z5r = (x4, 0);
+
+ penpos1 (hair - pen_top - pen_bot, -90);
+ top z1l = (xoff + norm + hair, h);
+
+ penpos2 (hround (norm - 3/2 hair) - pen_lft - pen_rt, 180);
+ rt z2l = (w, h / 2);
+
+ penpos3 (hair - pen_top - pen_bot, 90);
+ bot z3l = ((right_edge - xoff) / 2 + xoff,
+ vround (.5 norm - 1.5 hair));
+
+ penpos4 (hair - pen_lft - pen_rt, 0);
+ top z4 = (xoff + 1/2 norm + 1/2 hair,
+ vfloor (reduced_ss - linethickness - .2 hair));
+
+ bot z6 = (xoff + 3/4 norm, vround (.5 norm - .5 hair));
+
+ save t;
+ t = 0.833;
+
+ save pat;
+ path pat;
+
+ pat = z5l{curl 1}
+ .. z4l{up}
+ .. z4r{down}
+ .. z3r{right}
+ ..tension t.. z2r{up}
+ ..tension t.. flare_path (top z1l, 180, 90,
+ hair, hfloor (norm - 1/2 hair), -1)
+ ..tension t.. z2l{down}
+ .. z3l{left}
+ .. z6
+ .. z5r{down};
+
+ filldraw pat shifted (0, feta_shift)
+ -- reverse pat yscaled -1 shifted (0, -feta_eps)
+ -- cycle;
+
+ penlabels (1, 2, 3, 4, 5, 6);
+
+ % ugh, should be bulb, not flare?
+
+ draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("C clef", "C");
+ draw_c_clef (1.0);
+fet_endchar;
+
+
+fet_beginchar ("C clef", "C_change");
+ draw_c_clef (.8);
+fet_endchar;
+
+
+%
+% New bulb routine:
+%
+% Insert a brushed piece of the path, and draw the rest of the bulb
+% separately.
+%
+% The bulb has circular form. Neat merging of the bulb and brushed path
+% is done by playing with tension.
+%
+
+def new_bulb (expr start_point, start_angle,
+ outer_tangent_point,
+ end_point, end_angle,
+ big_radius, bulb_radius, flare,
+ direction, turning_dir) =
+begingroup;
+ save pat, before, after;
+ save center;
+ save u, v;
+ path pat, before, after;
+ pair center;
+
+ clearxy;
+
+ center = outer_tangent_point
+ + big_radius * dir (0);
+% + (big_radius - bulb_radius) * dir (-turning_dir * 90)
+
+ z1' = center + bulb_radius * dir (turning_dir * 180);
+ z2' = outer_tangent_point + flare * dir (0);
+ z3' = center + bulb_radius * dir (0);
+ z4' = center + bulb_radius * dir (turning_dir * 90);
+ z5' = center - 0.5 [big_radius, bulb_radius] * dir (turning_dir * 90);
+
+ labels (1', 2', 3', 4', 5');
+
+ before := z3'{dir (turning_dir * 90)}
+ .. z4'{-dir (0)}
+ ..tension 1.1.. z1'{-dir (turning_dir* 90)};
+ after := z2'{dir (turning_dir * 90)}
+ .. end_point{dir (end_angle)};
+ (u, v) = before intersectiontimes after;
+
+ pat := start_point{dir (start_angle)}
+ .. outer_tangent_point{dir (-turning_dir * 90)}
+ ..tension 1.02.. z5'{dir (0)}
+ .. subpath (0, u) of before
+ .. subpath (v, infinity) of after;
+
+ if direction = 0:
+ pat := reverse pat;
+ fi
+
+pat
+endgroup
+enddef;
+
+
+%
+% There is some variation in the shape of bass clefs.
+%
+% * In some clefs the size of the swoosh tip almost reaches the
+% bottom staff line; in some it crosses the 2nd line from the bottom
+% with a small overshoot.
+%
+% The most popular design is where the X part of the tip is aligned
+% with the left bulb boundary, and the Y part ends on the 2nd
+% staffline exactly. This is what we do.
+%
+% * The diameter of the bulb is the width of the open space.
+%
+% * The vertical center of the bulb can be on or slightly above the
+% staff line.
+%
+% * The vertical position of the dots can be symmetrical around the
+% staffline, centered in the staff space. The Baerenreiter SCS has
+% the bottom dot raised by approximately 0.1 staff space.
+%
+% * Uncarefully set music may have overshoots at the top. We have none.
+%
+% * It is not exactly clear where the vertical tangent at the right
+% of the swoosh should be.
+%
+
+def draw_bass_clef (expr exact_center, reduction) =
+ save reduced_ss, swoosh_width;
+ save right_thickness, right_offset, tip_protrude;
+ save dot_diam, bulb_y_offset, bulb_flare;
+ pair tip_protrude;
+
+ reduced_ss# = staff_space# * reduction;
+ 2.2 dot_diam# = reduction * (staff_space# - stafflinethickness#);
+ right_thickness# = 0.37 staff_space# + 1.2 linethickness#;
+ swoosh_width# = 2.1 reduced_ss#;
+ define_pixels (swoosh_width);
+ define_whole_pixels (reduced_ss);
+ define_whole_blacker_pixels (dot_diam, right_thickness);
+
+ right_offset = 0.05 staff_space;
+ bulb_y_offset := 0.075 staff_space;
+ bulb_flare := 2.5 linethickness;
+% tip_protrude := (-linethickness, -.2 staff_space);
+ tip_protrude := (0, 0);
+
+ set_char_box (-xpart exact_center,
+ xpart exact_center + swoosh_width# + 7/12 reduced_ss#,
+ -ypart exact_center + 2.5 reduced_ss#,
+ ypart exact_center + reduced_ss#);
+
+ y1 = bulb_y_offset;
+ x1 = 0;
+
+ x2 = .5 [x1, x3];
+ x2l = x2r = x2;
+
+ y2l := vround_pixels (reduced_ss# + 0.5 linethickness#);
+ y2l - y2r = linethickness;
+
+ x3l - x1 = swoosh_width;
+ x3l - x3r = right_thickness;
+
+ % optical correction: the top dot seems farther away if y3l = 0.
+ y3l = right_offset;
+
+ z4 = -(0, 2.0 reduced_ss) + tip_protrude;
+
+ penpos3 (whatever, 185);
+ penpos4 (linethickness, 135);
+
+ fill new_bulb (z2l, 180, z1, z2r, 0,
+ 0.45 reduced_ss, 0.4 reduced_ss,
+ bulb_flare, 1, 1)
+ .. z3r{down}
+ .. {curl 0}simple_serif (z4r, z4l, 90){curl 0}
+ .. z3l{up}
+ ..tension 0.9.. cycle;
+
+ pickup pencircle scaled dot_diam;
+
+ lft x5 = hround (x3l + 1/3 reduced_ss - dot_diam / 2);
+ bot y5 = vfloor (.5 reduced_ss - dot_diam / 2);
+ z6 = z5 yscaled -1;
+
+ % for symmetry
+ y5 := y5 + feta_shift;
+
+ drawdot z5;
+ drawdot z6;
+
+ penlabels (1, 2, 3, 4, 5, 6);
+
+ draw_staff (-3, 1, 0);
+enddef;
+
+
+fet_beginchar ("F clef ", "F");
+ draw_bass_clef ((0, 0), 1.0);
+fet_endchar;
+
+
+fet_beginchar ("F clef (reduced)", "F_change");
+ draw_bass_clef ((0, 0), 0.8);
+fet_endchar;
+
+
+
+%
+% Inspired by Baerenreiter
+%
+%
+% Beste lezers, kijk,
+%
+% Een bolletje hebben we bij toeval allemaal wel eens getekend, maar begint u
+% toch eenvoudig. Eerst een eenvoudig kruis of herstellingsteken
+% en via de dubbelslag naar een voorzichtig vlaggetje, en heb geduld!
+% Ikzelf heb bijvoorbeeld over mijn eerste gave G-sleutel
+% 35 kilobyte metafont, 12 patchlevels, 0 vriendinnen en 45 dagen gedaan
+%
+% -- vrij naar Van Kooten & De Bie
+%
+
+def debugfill = fill enddef;
+
+def draw_gclef (expr reduction) =
+ save reduced_ss, downstroke_dir, downstroke_angle, center;
+ save breapth_factor, inner_thick_end, thinness, thickness, thinnib;
+ save start_angle, inner_start_angle, thinness;
+ save upward_swoosh_angle, bot_angle;
+ save pat;
+ path pat;
+ pair downstroke_dir, center;
+
+ reduced_ss# = staff_space# * reduction;
+ define_pixels (reduced_ss);
+
+ thinness = 0.095 staff_space + 0.75 linethickness;
+ downstroke_dir = unitvector (14, -75);
+ downstroke_angle = angle downstroke_dir;
+ bot_angle = -180; % downstroke_angle - 87
+
+ upward_swoosh_angle = 132;
+ start_angle = -97;
+
+ breapth_factor = 21/14;
+ inner_thick_end = 45;
+ inner_start_angle = downstroke_angle - 43;
+ thickness = .32 reduced_ss + 1.1 linethickness;
+
+ thinnib = thinness;
+
+ set_char_box (0, 1.71 * breapth_factor * reduced_ss#,
+ 2.6 * reduced_ss#, 5 * reduced_ss#);
+
+ center := (breapth_factor * reduced_ss, 0);
+
+ z1 = center + whatever * dir (inner_start_angle);
+ x1 = xpart center - .28 reduced_ss;
+ penpos1 (thinnib, inner_start_angle);
+
+ x2r = xpart center;
+ y2r = vround_pixels (reduced_ss# + .5 stafflinethickness#);
+ penpos2 (thickness, 90);
+
+ z3 = (z4 - center) rotated inner_thick_end + center;
+ penpos3 (thinnib, -90 + inner_thick_end);
+
+ x4 = xpart center - .1 reduced_ss;
+ y4r = -y2r + feta_shift;
+ penpos4 (thinnib, -90);
+
+ x5r = -breapth_factor * reduced_ss + xpart center;
+ y5r = .37 reduced_ss + ypart center;
+ penpos5 (thickness, upward_swoosh_angle);
+
+ z6 = center + whatever * downstroke_dir;
+ y6 = ypart center + 2 reduced_ss;
+ % penpos6 is computed later
+
+ z7l - z6 = whatever * (z5 - z6) ;
+ y7l = 3.5 reduced_ss;
+ penpos7 (thickness, upward_swoosh_angle);
+
+ x9 = .7 [x10, x7r];
+ top y9l = 5 reduced_ss;
+ penpos9 (1.45 thickness, -70);
+
+ x11 - x13r = 1.5 reduced_ss + 0.5 thinnib;
+ y11 = ypart center - 47/28 reduced_ss;
+ y12 = ypart center - 71/28 reduced_ss;
+ y13 = .48 [y12, y4r];
+ x12r = xpart (.45 [z13r, z11] + .75 reduced_ss * downstroke_dir);
+
+% z10 = center + whatever * dir (downstroke_angle - 1.5);
+ x10 = x6 - 2 thinnib;
+ y10 = ypart center + 3.5 reduced_ss;
+ y10l - y10r = 1.0 thickness;
+ z10r - z10l = .7 thinnib * dir (downstroke_angle + 90)
+ + whatever * downstroke_dir;
+ z10 = .5 [z10l, z10r];
+ z11 = center + whatever * downstroke_dir + (-0.05 reduced_ss, 0);
+
+ penpos11 (thinnib, start_angle + 90);
+ penpos12 (thinnib, bot_angle + 90);
+ penpos13 (thinnib + 0.14 staff_space, 180);
+
+ % this auxiliary point ensures good contour overlapping
+ z8 = .5 [z9l, z9r] + .25 ((z9r - z9l) rotated -90);
+
+ z20 = z9l - (0, .25 blot_diameter);
+ penpos20 (blot_diameter, 0);
+
+ pat := z10{down}
+ .. z6
+ ..tension 1.1.. z11{dir (start_angle)};
+
+ penpos6 (thinnib, angle (direction 1 of pat) + 90);
+
+ % two auxiliary points to simulate `draw' with `penstroke'
+ z10' = point 0.3 of pat;
+ penpos10' (1.3 thinnib, angle (direction 0.3 of pat) + 50);
+
+ z11' = point 1.5 of pat;
+ penpos11' (thinnib, angle (direction 1.5 of pat) + 90);
+
+ z21l = z20l;
+ z21r = z9r;
+
+ pat := z21l
+ .. z10l{down}
+ .. z10'l;
+
+ fill z2l{right}
+ .. z3l
+ .. z4l{left}
+ ..tension 1.07.. z5l{up} % inside curve
+ .. z7l{up}
+ ..tension 1.2.. z20r{curl 1}
+ .. {direction 0 of pat}z20l
+ -- z8
+ -- z9r % {dir (downstroke_angle + 0)}
+ ..tension 0.8.. z7r{down}
+ .. z5r{down}
+ .. z4r{right}
+ .. z3r
+ .. z2r{left}
+ ..tension .95.. z1r
+ -- simple_serif (z1r, z1l, 80)
+ -- z1l
+ ..tension 0.85.. cycle;
+
+ penstroke z21e
+ .. z10e{down}
+ .. z10'e
+ .. z6e
+ .. z11'e
+ .. z11e{dir (-95)}
+ .. z12e{dir (bot_angle)};
+
+ fill new_bulb (z12r, bot_angle, z13r, z12l, bot_angle + 180,
+ 0.45 reduced_ss, 0.38 reduced_ss,
+ thinnib + .05 staff_space, 1, -1)
+ -- cycle;
+
+ penlabels (range 1 thru 21);
+ penlabels (10', 11');
+
+ draw_staff (-1, 3, 0);
+enddef;
+
+
+fet_beginchar ("G clef", "G");
+ draw_gclef (1.0);
+fet_endchar;
+
+
+fet_beginchar ("G clef", "G_change");
+ draw_gclef (0.8);
+fet_endchar;
+
+
+%%%%
+%
+% PERCUSSION
+%
+
+%
+% The percussion clef extent is not coincident with its bbox, since
+% the percussion clef needs more space in front than a normal clef.
+%
+
+def draw_percussion_clef (expr reduction) =
+ save reduced_ss, razt;
+
+ reduced_ss# = staff_space# * reduction;
+ define_pixels (reduced_ss);
+
+ set_char_box (-.67 reduced_ss#, 2.0 reduced_ss#,
+ reduced_ss#, reduced_ss#);
+
+ razt := hround (0.45 reduced_ss);
+
+ d := d - feta_shift;
+
+ draw_block ((-b, -d), (-b + razt, h));
+ draw_block ((w - razt, -d), (w, h));
+
+ draw_staff (-3, 1, 1);
+enddef;
+
+
+fet_beginchar ("percussion clef", "percussion");
+ draw_percussion_clef (1.0);
+fet_endchar;
+
+
+fet_beginchar ("percussion clef (reduced)", "percussion_change");
+ draw_percussion_clef (.8);
+fet_endchar;
+
+
+def draw_tab_T (expr pos, siz, slant) =
+begingroup;
+ save vx, vy;
+ pair vx, vy;
+
+ clearxy;
+
+ vx = (xpart siz) * dir 0;
+ vy = (ypart siz) * dir 90;
+
+ penpos1 (.75 penh, 100);
+ z1 = z2 + (1/6 * vx - .15 * vy);
+ penpos2 (hround (.9 penw), 0);
+ x2l = hround xpart (pos + .75 vy);
+ y2l = ypart (pos + .75 vy);
+ penpos3 (penh, -100);
+ z3l = pos + .4 vx + vy;
+ penpos4 (penh, -90);
+ z4 = -.1 vy + .5 [z3, z5];
+ penpos5 (.8 penh, -30);
+ x5r = xpart (pos + siz);
+ y5l = ypart (pos + siz);
+
+ penpos10 (penw, 170);
+ z10 = pos + .55 vx + .9 vy;
+ penpos11 (.75 [penh, penw], 170);
+ z11 = z10 - .5 vy + .025 vx;
+ penpos12 (penh, 100);
+ z12l = (xpart .5 [z13, z11], ypart (pos - .025 * siz));
+ penpos13 (.75 penh, 60);
+ z13 = pos + .2 vx + .15 vy;
+
+ % penlabels (range 1 thru 13);
+
+ soft_penstroke (z1e
+ ..tension 1.1.. z2e
+ .. z3e{right}
+ ..tension 1.5.. z4e
+ ..z5e)
+ slanted slant shifted (slant * -ypart pos, 0);
+
+ soft_end_penstroke (z10e
+ ..tension 1.5.. z11e
+ .. z12e
+ ..tension 1.1.. z13e{(z13r - z13l) rotated 90})
+ slanted slant shifted (slant * -ypart pos, 0);
+endgroup;
+enddef;
+
+
+def draw_tab_A (expr pos, siz, slant) =
+begingroup;
+ save vx, vy, pat;
+ pair vx, vy;
+ path pat;
+
+ clearxy;
+
+ vx = (xpart siz) * dir 0;
+ vy = (ypart siz) * dir 90;
+
+ penpos1 (.75 penh, -110);
+ z1r = pos + .07 vy;
+ penpos2 (penh, -75);
+ z2r = (.5 [x1, x3], ypart pos);
+ penpos3 (.25 [penh, penw], -30);
+ z3 = (.45 [x2, x4], .15 [y2, y4]);
+ penpos4 (1 [penh, penw], 0);
+ z4 = pos + .5 vx + .975 vy;
+
+ penpos5 (1 [penh, penw], -180);
+ z5 = z4;
+ penpos6 (.2 [penh, penw], -150);
+ z6l = (.8 [x5l, x7l], .9 [y5l, y7l]);
+ penpos7 (penh,-90);
+ z7r = (.5 [x6, x8], ypart pos);
+ penpos8 (.75 penh, -70);
+ z8r = (xpart (pos + siz), y7r + .075 ypart (siz));
+
+ pat := z2
+ .. z3
+ .. z4;
+
+ penpos10 (penh, angle (direction 1.2 of pat) - 180);
+ z10 = point 1.2 of pat;
+ penpos11 (.9 penh, -90);
+ z11 = .4 [z10, z6] - 0.05 vy;
+ penpos12 (.75 penh, -75);
+ z12 = .3 [z11, z6] + 0.02 vy;
+
+ % penlabels (range 1 thru 12);
+
+ soft_penstroke (z1e{(z1r - z1l) rotated 90}
+ .. z2e
+ .. z3e
+ .. z4e)
+ slanted slant shifted (slant * -ypart pos, 0);
+
+ soft_end_penstroke (z5e
+ .. z6e
+ .. z7e
+ .. z8e{(z8r - z8l) rotated 90})
+ slanted slant shifted (slant * -ypart pos, 0);
+
+ soft_end_penstroke (z10e
+ .. z11e
+ .. z12e)
+ slanted slant shifted (slant * -ypart pos, 0);
+endgroup;
+enddef;
+
+
+def draw_tab_B (expr pos, siz, slant) =
+begingroup;
+ save vx, vy;
+ pair vx, vy;
+
+ clearxy;
+
+ vx = (xpart siz) * dir 0;
+ vy = (ypart siz) * dir 90;
+
+ penpos1 (.75 penh, 100);
+ z1 = z2 + (.15 * vx - .1 * vy);
+ penpos2 (hround (.9 penw), 0);
+ x2l = hround xpart (pos + .75 vy);
+ y2l = ypart (pos + .75 vy);
+ penpos3 (penh, -100);
+ z3l = pos + .4 vx + 1.05 vy;
+ penpos4 (.8 [penh, penw], -180);
+ z4 = (xpart (pos + .75 siz), .5 [y3, y5]);
+ penpos5 (.8 penh, 90);
+ z5 = (.5 [x10, x4], ypart (pos + .55 siz));
+
+ penpos6 (.8 penh, 270);
+ z6 = z5;
+ penpos7 (penw, 180);
+ z7l = (xpart (pos + siz), .5 [y6, y8]);
+ penpos8 (.8 penh, 45);
+ z8 = .5 [z12l, z11l] + .15 vx - .05 vy;
+
+ penpos10 (.75 [penh, penw], 170);
+ z10 = pos + .375 vx + vy;
+ penpos11 (.8 [penh, penw], 150);
+ z11 = z10 - .5 vy + .04 vx;
+ penpos12 (penh, 100);
+ z12l = (xpart .5 [z13, z11], ypart pos);
+ penpos13 (.75 penh, 60);
+ z13 = pos + .1 vx + .15 vy;
+
+ % penlabels (range 1 thru 13);
+
+ soft_penstroke (z1e
+ ..tension 1.1.. z2e
+ .. z3e
+ .. z4e
+ ..z5e {left})
+ slanted slant shifted (slant * -ypart pos, 0);
+
+ soft_end_penstroke (z6e{right}
+ .. z7e
+ .. z8e{(z8r - z8l) rotated 90})
+ slanted slant shifted (slant * -ypart pos, 0);
+
+ soft_end_penstroke (z10e
+ ..tension 1.5.. z11e
+ .. z12e
+ ..tension 1.1.. z13e{(z13r - z13l) rotated 90})
+ slanted slant shifted (slant * -ypart pos, 0);
+endgroup;
+enddef;
+
+
+def draw_tab_clef (expr reduction) =
+ save reduced_ss, letterheight, penw, penh;
+
+ reduced_ss# = staff_space# * reduction;
+ letterheight# = 1.8 reduced_ss#;
+ define_pixels (reduced_ss, letterheight);
+
+ set_char_box (-.2 reduced_ss#, 2.8 reduced_ss#,
+ 1.6 letterheight#, 1.6 letterheight#);
+
+ penw = .45 reduced_ss;
+ penh = .2 reduced_ss;
+
+ draw_tab_T ((-b + .15 reduced_ss, h - letterheight),
+ (2.1 reduced_ss, letterheight), 0.2);
+ draw_tab_A ((-b - .05 reduced_ss, -.5 letterheight +.15 reduced_ss),
+ (2.2 reduced_ss, letterheight), 0.4);
+ draw_tab_B ((-b + .025 reduced_ss, -d),
+ (2.1 reduced_ss, letterheight), 0.25);
+
+ draw_staff (-3, 2, 0.5);
+enddef;
+
+
+fet_beginchar ("tab clef", "tab");
+ draw_tab_clef (1.0);
+fet_endchar;
+
+
+fet_beginchar ("tab clef (reduced)", "tab_change");
+ draw_tab_clef (.8);
+fet_endchar;
+
+fet_endgroup ("clefs");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- dynamic signs
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-ex# := (dynamic_design_size / 2.4) * pt#;
-descender# := 0.5 ex#;
-ascender# := 0.72 ex#;
-staffspace# := 1.75 / 2.0 * ex#;
-horizontal_space# := .66 ex#;
-
-font_x_height ex#;
-font_normal_space horizontal_space#;
-
-define_pixels (staffspace, linethickness, ex, descender, ascender);
-
-
-%
-% TODO: blot diameter should be fixed, not scalable.
-%
-
-save serif_thick, med_thick, bottom_blot;
-
-serif_thick# = 1.1 linethickness#;
-define_blacker_pixels (serif_thick);
-
-med_thick = round (1.5 linethickness);
-bottom_blot = 1.3 serif_thick;
-
-
-code := 32;
-
-fet_beginchar ("Space", "space");
- set_char_box (0, horizontal_space#, 0, ex#);
-fet_endchar;
-
-
-%
-% Couldn't find many z examples. This one is losely inspired
-% by a sfz from Mueller Etuden fuer Horn (Edition Hofmeister).
-%
-
-code := 121;
-
-fet_beginchar ("dynamic z", "z");
- save thin_thick, top_narrow, over_shoot;
- save bot_thick;
-
- set_char_box (0, .98 ex#, 0, 0.9 ex#);
-
- thin_thick = serif_thick;
- top_narrow = thin_thick;
- top_overshoot = .8 serif_thick;
- top_thick = .3 h;
- bot_thick = .2 ex;
- bot_overshoot = serif_thick;
-
- x0 = top_narrow;
- y0 = .9 [y1r, y1l];
-
- penpos1 (top_thick, 80);
- y1l = .72 h;
- x1r = .34 ex;
-
- x2 = .66 ex;
- y2 = y1r - top_overshoot;
-
- y3 = h - .7 thin_thick;
- x3 = w - .6 top_narrow - .5 thin_thick;
- y4 = .5 thin_thick;
- x4 = .5 thin_thick;
-
- penpos3 (thin_thick, angle (z3 - z4) + 90);
- penpos4 (thin_thick, angle (z3 - z4) + 90);
-
- penpos5 (bot_thick, 70);
- x5l =.25 ex;
- y5l = .4 bot_overshoot;
-
- penpos6 (3/2 bot_thick, 70);
- y6l = -bot_overshoot;
- x6 = w - 3 top_narrow;
-
- x7 = w;
- y7 = .82 [y8r, y6r];
-
- penpos8 (thin_thick, 20);
- x8r = w - .35 top_narrow;
- y8r = .45 h;
-
- penlabels (range 0 thru 8);
-
-% pickup pencircle scaled 1;
-
-% draw
- fill z0{down}
- .. z1l{dir (10)}
- .. simple_serif (z3l, z3r, 90)
- .. z2{left}
- .. z1r{left}
- ..tension 1.2.. cycle;
-
-% draw
- fill z3l
- -- z3r
- -- z4r
- -- z4l
- -- cycle;
-
-% draw
- fill simple_serif (z4r, z4l, 90)
- .. z5l{right}
- .. z6l{right}
- .. z7{up}
- .. simple_serif (z8r, z8l, 90)
- .. z6r{left}
- .. z5r{left}
- .. cycle;
-fet_endchar;
-
-
-% forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
-%
-% NOTES:
-%
-% * the bulbs are open
-%
-% * blotting around the serif
-%
-% TODO: insert blots around the serif
-%
-
-slant_angle = 20;
-code := 101;
-
-fet_beginchar ("dynamic f", "f");
- save left_angle, right_angle;
- save serif_length, serif_eccentricity;
- save f_thick;
- save bulb_thick, bulb_diam, fill_up;
- save slant;
- save p;
- path p;
-
- set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
-
- bulb_diam = 7.5 / 40 ex;
- bulb_thick = 8.5 / 40 ex;
- fill_up = 1.5 serif_thick;
- left_angle = slant_angle - 6;
- right_angle = slant_angle - 3;
- f_thick = 7/16 ex;
- serif_length = 0.96 ex;
- serif_eccentricity = 0.01 ex;
-
- % z1 is the `base point'
- z1 = (0.2 ex, -serif_thick);
-
- penpos2 (f_thick, 0);
- y2 = y1 + ex;
- z2l = z1 + whatever * dir (90 - left_angle);
-
- penpos3 (med_thick, -90);
- y3l = y1 + ex + ascender;
- x3l = x1 + ex;
-
- penpos4 (bulb_thick, -20);
- z3r = whatever [z4r, z4l];
-
- x4l - x3l = 1/10 ex;
-
- penpos5 (bulb_thick, -45);
- x5r = 0.1 [x4l, x4r];
- y5l = y4l - bulb_diam;
-
- z6 = z2r + whatever * dir (90 - right_angle);
- y6 = y1 + 3/8 ex;
-
- penpos7 (med_thick, -90);
- x7 = x1 - 1/4 ex;
- y7r = y1 -descender;
-
- penpos8 (bulb_thick, 160);
- x8l = x7l - 1/10 ex;
-
- z7l = whatever [z8r, z8l];
-
- penpos9 (bulb_thick, 135);
- x9r = 0.1 [x8l, x8r];
- y9l = y8l + bulb_diam;
-
- labels (1, 6, 9);
- penlabels (2, 3, 4, 5, 7, 8, 9);
-
-% pickup pencircle scaled 1;
-
-% draw
- fill z1
- -- z2l{z2l - z1}
- ..tension 1.1.. z3l{right}
- .. z4r{down}
- .. z5r{left}
- .. z5l{up}
- ..tension 0.8.. z4l{up}
- .. z3r{left}
- ..tension 1.1.. z2r{z6 - z2r}
- -- z6{z6 - z2r}
- ..tension 1.25.. z7r{left}
- .. z8r{up}
- .. z9r{right}
- .. z9l{down}
- ..tension 0.8.. z8l{down}
- .. z7l{right}
- .. {z2l - z1}cycle;
-
- x13 - x14 = serif_length;
- y13 = y14;
- y14 = y2;
- 0.5 [x13, x14] = x2 + serif_eccentricity;
-
- draw_rounded_block (z14 - (0, 0.7 serif_thick),
- z13 + (0, 0.7 serif_thick),
- 1.4 serif_thick);
-
- labels (13, 14);
-fet_endchar;
-
-
-%
-% Notes:
-%
-% - The `s' is trapezoidal (i.e., narrower at the top).
-%
-% - The white space is differently shaped at the top (the bulb's inner
-% curve is filled up).
-%
-% - Less heavy than the `f' and `p' signs.
-%
-
-code := 114;
-
-fet_beginchar ("dynamic s", "s");
- save left_angle, right_angle;
- save s_thick, s_thin;
- save bulb_diam, bulb_len;
- save over_shoot;
- save base_point;
- pair base_point;
-
- set_char_box (0, 17/24 ex#, 0, ex#);
-
- over_shoot = 0; % .2 serif_thick;
- bulb_diam = 11/70 ex;
- bulb_len = 1.0 bulb_diam;
- left_angle = slant_angle - 2;
- right_angle = slant_angle - 11;
- s_thick = 16/70 ex;
- s_thin = serif_thick;
-
- base_point = (0, 0);
-
- penpos1 (bulb_diam, -45);
- z1 = 0.35 [z2l, z2r] + bulb_len * dir (45);
-
- penpos2 (bulb_diam, -25);
- y2l = 0.845 [y7r, y3r];
- z2l = base_point + whatever * dir (90 - left_angle);
-
- penpos3 (s_thin, 100);
- x3l = 1/2 w;
- y3l = ypart base_point - over_shoot;
-
- penpos4 (s_thick, 25);
- y4l = y1r;
- z4r = base_point + (w, 0) + whatever * dir (90 - right_angle);
-
- penpos5 (s_thick, 40);
- z5 = z3l + whatever * dir (90 - right_angle);
- y5 = 0.48 [y7r, y3r];
-
- penpos6 (s_thick, 25);
- z6l = base_point + whatever * dir (90 - left_angle);
- y6r = y9l;
-
- penpos7 (.9 s_thin, 110);
- z7l = 0.45 [z6r, z8l] + whatever * dir (90 - left_angle);
- y7r = h + over_shoot;
-
- penpos8 (.9 bulb_diam, -25);
- z8 = .6 [z4l, z4r] + whatever * dir (90 - right_angle);
- y8r = 0.23 [y7r, y3r];
-
- penpos9 (.9 bulb_diam, -45);
- z9 = .4 [z8r, z8l] + .9 bulb_len * dir (-135);
-
- penlabels (range 1 thru 9);
-
-% pickup pencircle scaled 1;
-
-% draw
- fill z2l{down}
- .. z3l{right}
- .. z4r{up}
- .. z5r
- .. z6r{up}
- .. z7l{right}
- % .. z8l{down}
- .. z9l{dir (-125)}
- .. z9r{right}
- .. z7r{left}
- .. z6l{down}
- .. z5l
- .. z4l{down}
- .. z3r{left}
- .. z2r{up}
- .. z1r{up}
- .. z1l{left}
- .. cycle;
-fet_endchar;
-
-
-% for `p' and `m'
-
-save slant;
-slant := ypart (dir (slant_angle));
-
-
-%
-% Piano `p', grabbed from Ed Breitkopf Mozart horn concerto 3.
-%
-% Notes:
-%
-% * There is no dishing in the serif (but we do it anyway).
-%
-% * The cheek is a little fatter than the stem.
-%
-% * The slant is extreme: 20 degrees.
-%
-% * The twiddle (what's-it-called) is a slightly darker than the serif.
-%
-% * The hole in the cheek has a straight right side.
-%
-% * Corners are filled up.
-%
-
-code := 111;
-
-fet_beginchar ("dynamic p", "p")
- % TODO: w really is 13/12 ex
- % but should do kerning
-
- save twiddle_thick, stem_thick, cheek_thick, cheek_width;
- save fill_up, straigh_len;
- save serif, dishing_angle, p, tmp;
- save cheek_medium, left_serif_protrude, right_serif_protrude;
- save lower_overshoot;
- save blot_t, corner_t;
- path serif, p;
- pair tmp, updir;
-
- set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
-
- twiddle_thick = med_thick;
- cheek_medium = 1/6 ex;
-
- dishing_angle = 5;
- fill_up = 1.5 serif_thick;
- straigh_len = 0.5 ex;
- lower_overshoot = .3 serif_thick;
-
- stem_thick = 2/6 ex;
- cheek_thick = 13/32 ex;
- cheek_width = 0.72 ex;
- left_serif_protrude = 18/60 ex;
- right_serif_protrude = 15/60 ex;
-
- currenttransform := currenttransform slanted slant;
-
- penpos1 (twiddle_thick, -slant - 5);
- penpos2 (cheek_medium, 90 - slant);
- penpos3 (cheek_medium, 90 - slant);
-
- x4r - x4l = cheek_thick;
-
- penpos4 (whatever, 0);
- penpos5 (whatever, -38);
- penpos6 (stem_thick, 0);
- penpos17 (straigh_len, 90 - slant);
-
- whatever [z17l, z17r] = z4l;
- y17 = 7/16 ex;
- x6l = 0;
- y6l = -descender + serif_thick / 2;
- z1l = z6l - whatever * dir (110);
- y1r = 0.5 ex;
- y2r = ex;
- z7 = whatever * up + z6l;
- y7 = 43/60 ex;
- z2l = whatever * up + 0.3 [z7, z1r];
- y8 = 0.9 [y7, y2l];
- z8 = 2/3 [z6l, z6r] + whatever * up;
- y3r = ex;
- z3l = 0.58 [(stem_thick, -descender),
- (stem_thick + cheek_width - cheek_thick, -descender)]
- + whatever * up;
- y4r = .38 ex;
- z4r = whatever * up + (stem_thick + cheek_width, -descender);
- z5l = whatever * up + z3l;
- y5r = -lower_overshoot;
- y5l = y5r + cheek_medium * ypart dir (55);
- z9 = z6r + whatever * up;
- y9 = .2 [y5l, y5r];
-
- p := z2r{right}
- .. {dir (-60)}z8{dir 60}
- .. z3r{right}
- .. z4r{down}
- ..tension 1.1.. z5r{left}
- .. {curl 1}z9
- -- z6r
- -- z6l
- -- z7{up}
- .. z2l{left}
- ..tension 1.2.. simple_serif (z1r, z1l, -90)
- .. cycle;
-
- blot_t := 0.13;
- corner_t := xpart (p intersectiontimes z9);
-
-% pickup pencircle scaled 1;
-
-% draw
- fill subpath (0, corner_t - 2 blot_t) of p
- .. subpath (corner_t + blot_t, length p) of p
- .. cycle;
-
- y12 = 0.5 ex;
- z12 = z6r + whatever * up;
-
- unfill z17l
- ..tension 1.5.. z17r
- .. z3l{left}
- ..tension 1.05.. z12{down}
- ..tension 1.05.. z5l{right}
- .. cycle;
-
- penlabels (1, 2, 3, 4, 5, 6, 17);
- labels (7, 8, 9);
-
- pickup pencircle scaled serif_thick;
-
- lft x11 = -left_serif_protrude;
- rt x10 = stem_thick + right_serif_protrude;
- bot y10 = bot y11 = -descender;
-
- z15 = z6l + up * fill_up;
- z16 = z6r + up * 1.2 fill_up;
-
- % Since pens are not affected by currenttransform we directly
- % transform the necessary points, then simulating the pen with
- % an outline while using the identity transformation.
-
- forsuffixes $ = 7, 10, 11, 15, 16:
- tmp := z$ transformed currenttransform;
- x$ := xpart tmp;
- y$ := ypart tmp;
- endfor;
-
- currenttransform := identity;
-
- updir = z7 - z15;
-
- serif := simple_serif (z10, z11, dishing_angle);
-
- penpos10 (serif_thick, -dishing_angle - 90);
- penpos11 (serif_thick, dishing_angle - 90);
- penpos13 (serif_thick, angle (direction 0.05 of serif) + 90);
- penpos14 (serif_thick, angle (direction 0.85 of serif) + 90);
-
- z13 = point 0.05 of serif;
- z14 = point 0.85 of serif;
-
- penlabels (10, 11, 13, 14);
- labels (15, 16);
-
-% draw
- fill z15{-updir}
- .. z14l{direction 0.85 of serif}
- .. z11l{-dir (dishing_angle)}
- .. z11r{dir (dishing_angle)}
- .. z14r{-direction 0.85 of serif}
- .. z13r{-direction 0.05 of serif}
- .. z10r{dir (-dishing_angle)}
- .. z10l{-dir (-dishing_angle)}
- .. z13l{direction 0.05 of serif}
- .. z16{updir}
- -- cycle;
-fet_endchar;
-
-
-%
-% NOTES:
-%
-% * Right stem is fatter and more straight than the left two stems.
-%
-% * The twiddle at the left is similar to the `p' twiddle.
-%
-% * The bottoms of the stems are blotted.
-%
-%
-% This is cut & paste programming. Somehow three `i' shapes in two
-% characters (`p' and `m') -- doesn't seem worth the trouble of writing
-% a macro.
-%
-
-code := 108;
-
-fet_beginchar ("dynamic m", "m");
- save i_thick, i_angle, i_twiddle_thick;
- save i_twiddle_start_angle, i_twiddle_start_y;
- save i_twiddle_end_angle, i_left_space;
- save idir, center, right_ending;
- save overshoot;
- save p;
- pair center, idir, right_ending;
- path p;
-
- set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
-
- % should share code with p for twiddle.
-
- overshoot = .25 serif_thick;
- i_thick := 21/80 ex;
- i_twiddle_thick = 1.2 serif_thick;
- i_twiddle_start_y = 8/16 ex;
- i_twiddle_start_angle = 0;
- i_twiddle_end_angle := 35;
-
- center = (0, 0);
-
- currenttransform := currenttransform slanted slant;
-
- i_angle := 0;
- idir := dir (90 - i_angle);
- i_left_space = 16/80 ex;
-
- penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
- y1 = i_twiddle_start_y;
- z1r = center - (i_left_space, 0) + whatever * idir;
-
- y2l = ex + overshoot;
- z2l = .08 [z3l, z3r] + whatever * idir;
- z2r = 5/8 [z1r, z3l] + whatever * idir;
- y2r = y5l + 1/9 ex;
- z2 = 1/2 [z2l, z2r];
-
- penpos3 (i_thick, 0);
- y3 = 0.5 bottom_blot + ypart center;
- z3l = center + whatever * idir;
-
- penpos4 (i_thick - bottom_blot, 0);
- y4 = ypart center;
- z4 - z3 = whatever * idir;
-
- penpos5 (i_thick, 0);
- z5 = z4 + whatever * idir;
- y5 = 55/80 ex;
-
- fill simple_serif (z1l, z1r, 90)
- ..tension 1.2.. z2r{right}
- .. z5l{z3 - z5}
- -- z3l{z3 - z5}
- .. z4l{right}
- -- z4r{right}
- .. z3r{z5 - z3}
- -- z5r{z5 - z3}
- ..tension 1.2.. z2l{left}
- .. cycle;
-
- right_ending := z5r;
- penlabels (1, 2, 3, 4, 5);
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- clearxy;
-
- i_angle := -3.2;
- idir := dir (90 - i_angle);
- i_left_space := 14/80 ex;
-
- penpos1 (serif_thick, -i_twiddle_start_angle);
- z1r = right_ending;
-
- y2l = ex+ overshoot;
- z2l = .08 [z3l, z3r] + whatever * idir;
- z2r = 5/8 [z1r, z3l] + whatever * idir;
- y2r = y5l + 1/9 ex;
- z2 = 1/2 [z2l, z2r];
-
- penpos3 (i_thick, 0);
- y3 = 0.5 bottom_blot + ypart center;
- z3l = z5l + whatever * idir;
-
- penpos4 (i_thick - bottom_blot, 0);
- y4 = ypart center;
- z4 - z3 = whatever * idir;
-
- penpos5 (i_thick, 0);
- z5l = right_ending + (i_left_space, 0);
-
- fill simple_serif (z1l, z1r, 90)
- ..tension 1.05.. z2r{right}
- .. z5l{z3 - z5}
- -- z3l
- .. z4l{right}
- -- z4r{right}
- .. z3r{z5 - z3}
- -- z5r{z5 - z3}
- ..tension 1.2.. z2l{left}
- .. cycle;
-
- right_ending := z5r;
- penlabels (1, 2, 3, 4, 5);
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- clearxy;
-
- i_thick := 23/80 ex;
- i_angle := -6;
- idir := dir (90 - i_angle);
- i_left_space := 14/80 ex;
-
- penpos1 (serif_thick, -i_twiddle_start_angle);
- z1r = right_ending;
-
- y2l = ex + overshoot;
- z2l = .08 [z3l, z3r] + whatever * idir;
- z2r = 5/8 [z1r, z3l] + whatever * idir;
- y2r = y5l + 1/9 ex;
- z2 = 1/2 [z2l, z2r];
-
- penpos3 (whatever, 20);
- y3l = 1/8 ex + ypart center;
- z3l = z7l + whatever * idir;
- z3r = z7r + whatever * idir;
-
- penpos5 (whatever, 10);
- z5l = right_ending + (i_left_space, 0);
- z5r = z7r + whatever * idir;
-
- penpos6 (serif_thick, -i_twiddle_end_angle);
- y6l = 23/80 ex + ypart center;
- z6l = 1.6 [z3l, z3r] + whatever * idir;
-
- penpos7 (i_thick, 0);
- y7 = 0;
- z7l = z5l + whatever * idir;
-
- z8 = z7 - (0, overshoot);
-
- fill simple_serif (z1l, z1r, 90)
- ..tension 1.05.. z2r{right}
- .. z5l{z3 - z5}
- -- z3l{z3 - z5}
- .. z8{right}
- .. simple_serif (z6r, z6l, 90)
- ..tension 0.85.. z3r{z5 - z3}
- -- z5r{z5 - z3}
- ..tension 1.2.. z2l{left}
- .. cycle;
-
- penlabels (range 1 thru 8);
-fet_endchar;
-
-
-code := 113;
-
-fet_beginchar ("dynamic r", "r");
- save base_point, stem_thick, bulb_diam;
- save twiddle_thick, attach_len, overshoot, taille;
- pair base_point;
-
- set_char_box (0, .75 ex#, 0, ex#);
-
- stem_thick =.26 ex;
- bulb_diam = .30 ex;
- twiddle_thick = 1.1 serif_thick;
- overshoot = .5 serif_thick;
- taille = -0.3 serif_thick;
- attach_len + bulb_diam / 2 + stem_thick = w;
-
-
- base_point = (0, 0);
-
- currenttransform := identity slanted ypart (dir (15));
-
- penpos1 (stem_thick, 0);
- x1l = 0;
- y1l = .5 bottom_blot;
-
- penpos2 (stem_thick, 0);
- x2l = x1l;
- y2l - y1l = 36/47 ex;
-
- penpos3 (twiddle_thick, -20);
- x3r = x2l - .2 ex;
- y3 = .77 ex;
-
- x4l = -0.1 [x1l, x1r];
- y4l = ex + overshoot;
- x4r = 0.62 [x3r, x2l];
- y4r = 0.5 [y4l, y2l];
-
- penpos5 (whatever, -74);
- y5l - y5r = bulb_diam;
- y5l = ex + overshoot;
- x5 = x2r + attach_len;
-
- penpos6 (bulb_diam, 0);
- z6 = z5;
-
-% z7 = z6l + taille * dir (180);
- z7 = z6 + .4 * bulb_diam * dir (-125);
-
- z8 = 9/10 [z1r, z2r];
-
- x9 = 0.15 [x1r, x1l];
- y9 = y4l - .12 ex;
-
- penpos10 (stem_thick - bottom_blot, 0);
- x10 = x1;
- y10 = 0;
-
-% pickup pencircle scaled 1;
-
-% draw
- fill z1r{down}
- .. z10r{left}
- -- z10l{left}
- .. z1l{up}
- -- z2l{up}
- .. z4r{left}
- ..tension 1.2.. {down}simple_serif (z3r, z3l,-90){up}
- ..tension 0.95.. z4l
- .. {curl 1}z9{curl 1}
- .. z5l
- .. z6r{dir (-80)}
- .. z5r{left}
- .. z7
- .. z6l
- ..tension 1.2.. z8{down}
- -- cycle;
-
- penlabels (range 1 thru 10);
-fet_endchar;
-
-
-%%% KERNING
-
-ligtable "m":
- "p" kern 0.2 ex#,
- "f" kern -0.1 ex#;
-
-ligtable "f":
- "f" kern -0.13 ex#;
-
-ligtable "r":
- "f" kern 0.1 ex#;
-
-
-%% notes from old dyn code.
-
-% `f' obviously has a _lot_ bigger slant than `p' (see Wanske p.239).
-% However; perhaps we need two f symbols:
-% - a super-slanted one used in `f', `mf', `sfz', `sf'
-% - a more normal-slanted in `ff', `fff', `fp', `fp' (see Wanske p.241)
-%
-% Looking at professionally typeset music reveals that typesetters
-% are somewhat unsure about slanting in `mf', `fp', `sfz'
-%
-% `f' and `p' (in any combination) are a lot (factor two) fatter than
-% `s', `m', and `z'. Sometimes the `m' and `z' are a bit fatter than
-% `s'.
-%
-% Chester, Breitkopf suggest smaller sizes of these other glyphs,
-% using the x-height as reference point.
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- a duration dot
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("dots");
+
+save dot_diam;
+
+2 dot_diam# = staff_space# - stafflinethickness#;
+define_whole_blacker_pixels (dot_diam);
+
+fet_beginchar ("duration dot", "dot");
+ pickup pencircle scaled dot_diam;
+
+ lft x0 = 0;
+ top y0 = vround (.5 dot_diam);
+
+ drawdot z0;
+
+ set_char_box (0, dot_diam#, .5 dot_diam#, .5 dot_diam#);
+fet_endchar;
+
+fet_endgroup ("dots");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- dynamic signs
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+ex# := (dynamic_design_size / 2.4) * pt#;
+descender# := 0.5 ex#;
+ascender# := 0.72 ex#;
+staffspace# := 1.75 / 2.0 * ex#;
+horizontal_space# := .66 ex#;
+
+font_x_height ex#;
+font_normal_space horizontal_space#;
+
+define_pixels (staffspace, linethickness, ex, descender, ascender);
+
+
+%
+% TODO: blot diameter should be fixed, not scalable.
+%
+
+save serif_thick, med_thick, bottom_blot;
+
+serif_thick# = 1.1 linethickness#;
+define_blacker_pixels (serif_thick);
+
+med_thick = round (1.5 linethickness);
+bottom_blot = 1.3 serif_thick;
+
+
+code := 32;
+
+fet_beginchar ("Space", "space");
+ set_char_box (0, horizontal_space#, 0, ex#);
+fet_endchar;
+
+
+%
+% Couldn't find many z examples. This one is losely inspired
+% by a sfz from Mueller Etuden fuer Horn (Edition Hofmeister).
+%
+
+code := 121;
+
+fet_beginchar ("dynamic z", "z");
+ save thin_thick, top_narrow, over_shoot;
+ save bot_thick;
+
+ set_char_box (0, .98 ex#, 0, 0.9 ex#);
+
+ thin_thick = serif_thick;
+ top_narrow = thin_thick;
+ top_overshoot = .8 serif_thick;
+ top_thick = .3 h;
+ bot_thick = .2 ex;
+ bot_overshoot = serif_thick;
+
+ x0 = top_narrow;
+ y0 = .9 [y1r, y1l];
+
+ penpos1 (top_thick, 80);
+ y1l = .72 h;
+ x1r = .34 ex;
+
+ x2 = .66 ex;
+ y2 = y1r - top_overshoot;
+
+ y3 = h - .7 thin_thick;
+ x3 = w - .6 top_narrow - .5 thin_thick;
+ y4 = .5 thin_thick;
+ x4 = .5 thin_thick;
+
+ penpos3 (thin_thick, angle (z3 - z4) + 90);
+ penpos4 (thin_thick, angle (z3 - z4) + 90);
+
+ penpos5 (bot_thick, 70);
+ x5l =.25 ex;
+ y5l = .4 bot_overshoot;
+
+ penpos6 (3/2 bot_thick, 70);
+ y6l = -bot_overshoot;
+ x6 = w - 3 top_narrow;
+
+ x7 = w;
+ y7 = .82 [y8r, y6r];
+
+ penpos8 (thin_thick, 20);
+ x8r = w - .35 top_narrow;
+ y8r = .45 h;
+
+ penlabels (range 0 thru 8);
+
+% pickup pencircle scaled 1;
+
+% draw
+ fill z0{down}
+ .. z1l{dir (10)}
+ .. simple_serif (z3l, z3r, 90)
+ .. z2{left}
+ .. z1r{left}
+ ..tension 1.2.. cycle;
+
+% draw
+ fill z3l
+ -- z3r
+ -- z4r
+ -- z4l
+ -- cycle;
+
+% draw
+ fill simple_serif (z4r, z4l, 90)
+ .. z5l{right}
+ .. z6l{right}
+ .. z7{up}
+ .. simple_serif (z8r, z8l, 90)
+ .. z6r{left}
+ .. z5r{left}
+ .. cycle;
+fet_endchar;
+
+
+% forte f, grabbed from Ed Breitkopf Mozart horn concerto 3.
+%
+% NOTES:
+%
+% * the bulbs are open
+%
+% * blotting around the serif
+%
+% TODO: insert blots around the serif
+%
+
+slant_angle = 20;
+code := 101;
+
+fet_beginchar ("dynamic f", "f");
+ save left_angle, right_angle;
+ save serif_length, serif_eccentricity;
+ save f_thick;
+ save bulb_thick, bulb_diam, fill_up;
+ save slant;
+ save p;
+ path p;
+
+ set_char_box (0, 1.1 ex#, descender#, ex# + ascender#);
+
+ bulb_diam = 7.5 / 40 ex;
+ bulb_thick = 8.5 / 40 ex;
+ fill_up = 1.5 serif_thick;
+ left_angle = slant_angle - 6;
+ right_angle = slant_angle - 3;
+ f_thick = 7/16 ex;
+ serif_length = 0.96 ex;
+ serif_eccentricity = 0.01 ex;
+
+ % z1 is the `base point'
+ z1 = (0.2 ex, -serif_thick);
+
+ penpos2 (f_thick, 0);
+ y2 = y1 + ex;
+ z2l = z1 + whatever * dir (90 - left_angle);
+
+ penpos3 (med_thick, -90);
+ y3l = y1 + ex + ascender;
+ x3l = x1 + ex;
+
+ penpos4 (bulb_thick, -20);
+ z3r = whatever [z4r, z4l];
+
+ x4l - x3l = 1/10 ex;
+
+ penpos5 (bulb_thick, -45);
+ x5r = 0.1 [x4l, x4r];
+ y5l = y4l - bulb_diam;
+
+ z6 = z2r + whatever * dir (90 - right_angle);
+ y6 = y1 + 3/8 ex;
+
+ penpos7 (med_thick, -90);
+ x7 = x1 - 1/4 ex;
+ y7r = y1 -descender;
+
+ penpos8 (bulb_thick, 160);
+ x8l = x7l - 1/10 ex;
+
+ z7l = whatever [z8r, z8l];
+
+ penpos9 (bulb_thick, 135);
+ x9r = 0.1 [x8l, x8r];
+ y9l = y8l + bulb_diam;
+
+ labels (1, 6, 9);
+ penlabels (2, 3, 4, 5, 7, 8, 9);
+
+% pickup pencircle scaled 1;
+
+% draw
+ fill z1
+ -- z2l{z2l - z1}
+ ..tension 1.1.. z3l{right}
+ .. z4r{down}
+ .. z5r{left}
+ .. z5l{up}
+ ..tension 0.8.. z4l{up}
+ .. z3r{left}
+ ..tension 1.1.. z2r{z6 - z2r}
+ -- z6{z6 - z2r}
+ ..tension 1.25.. z7r{left}
+ .. z8r{up}
+ .. z9r{right}
+ .. z9l{down}
+ ..tension 0.8.. z8l{down}
+ .. z7l{right}
+ .. {z2l - z1}cycle;
+
+ x13 - x14 = serif_length;
+ y13 = y14;
+ y14 = y2;
+ 0.5 [x13, x14] = x2 + serif_eccentricity;
+
+ draw_rounded_block (z14 - (0, 0.7 serif_thick),
+ z13 + (0, 0.7 serif_thick),
+ 1.4 serif_thick);
+
+ labels (13, 14);
+fet_endchar;
+
+
+%
+% Notes:
+%
+% - The `s' is trapezoidal (i.e., narrower at the top).
+%
+% - The white space is differently shaped at the top (the bulb's inner
+% curve is filled up).
+%
+% - Less heavy than the `f' and `p' signs.
+%
+
+code := 114;
+
+fet_beginchar ("dynamic s", "s");
+ save left_angle, right_angle;
+ save s_thick, s_thin;
+ save bulb_diam, bulb_len;
+ save over_shoot;
+ save base_point;
+ pair base_point;
+
+ set_char_box (0, 17/24 ex#, 0, ex#);
+
+ over_shoot = 0; % .2 serif_thick;
+ bulb_diam = 11/70 ex;
+ bulb_len = 1.0 bulb_diam;
+ left_angle = slant_angle - 2;
+ right_angle = slant_angle - 11;
+ s_thick = 16/70 ex;
+ s_thin = serif_thick;
+
+ base_point = (0, 0);
+
+ penpos1 (bulb_diam, -45);
+ z1 = 0.35 [z2l, z2r] + bulb_len * dir (45);
+
+ penpos2 (bulb_diam, -25);
+ y2l = 0.845 [y7r, y3r];
+ z2l = base_point + whatever * dir (90 - left_angle);
+
+ penpos3 (s_thin, 100);
+ x3l = 1/2 w;
+ y3l = ypart base_point - over_shoot;
+
+ penpos4 (s_thick, 25);
+ y4l = y1r;
+ z4r = base_point + (w, 0) + whatever * dir (90 - right_angle);
+
+ penpos5 (s_thick, 40);
+ z5 = z3l + whatever * dir (90 - right_angle);
+ y5 = 0.48 [y7r, y3r];
+
+ penpos6 (s_thick, 25);
+ z6l = base_point + whatever * dir (90 - left_angle);
+ y6r = y9l;
+
+ penpos7 (.9 s_thin, 110);
+ z7l = 0.45 [z6r, z8l] + whatever * dir (90 - left_angle);
+ y7r = h + over_shoot;
+
+ penpos8 (.9 bulb_diam, -25);
+ z8 = .6 [z4l, z4r] + whatever * dir (90 - right_angle);
+ y8r = 0.23 [y7r, y3r];
+
+ penpos9 (.9 bulb_diam, -45);
+ z9 = .4 [z8r, z8l] + .9 bulb_len * dir (-135);
+
+ penlabels (range 1 thru 9);
+
+% pickup pencircle scaled 1;
+
+% draw
+ fill z2l{down}
+ .. z3l{right}
+ .. z4r{up}
+ .. z5r
+ .. z6r{up}
+ .. z7l{right}
+ % .. z8l{down}
+ .. z9l{dir (-125)}
+ .. z9r{right}
+ .. z7r{left}
+ .. z6l{down}
+ .. z5l
+ .. z4l{down}
+ .. z3r{left}
+ .. z2r{up}
+ .. z1r{up}
+ .. z1l{left}
+ .. cycle;
+fet_endchar;
+
+
+% for `p' and `m'
+
+save slant;
+slant := ypart (dir (slant_angle));
+
+
+%
+% Piano `p', grabbed from Ed Breitkopf Mozart horn concerto 3.
+%
+% Notes:
+%
+% * There is no dishing in the serif (but we do it anyway).
+%
+% * The cheek is a little fatter than the stem.
+%
+% * The slant is extreme: 20 degrees.
+%
+% * The twiddle (what's-it-called) is a slightly darker than the serif.
+%
+% * The hole in the cheek has a straight right side.
+%
+% * Corners are filled up.
+%
+
+code := 111;
+
+fet_beginchar ("dynamic p", "p")
+ % TODO: w really is 13/12 ex
+ % but should do kerning
+
+ save twiddle_thick, stem_thick, cheek_thick, cheek_width;
+ save fill_up, straigh_len;
+ save serif, dishing_angle, p, tmp;
+ save cheek_medium, left_serif_protrude, right_serif_protrude;
+ save lower_overshoot;
+ save blot_t, corner_t;
+ path serif, p;
+ pair tmp, updir;
+
+ set_char_box (0, 15/12 ex#, descender#, 1.0 ex#);
+
+ twiddle_thick = med_thick;
+ cheek_medium = 1/6 ex;
+
+ dishing_angle = 5;
+ fill_up = 1.5 serif_thick;
+ straigh_len = 0.5 ex;
+ lower_overshoot = .3 serif_thick;
+
+ stem_thick = 2/6 ex;
+ cheek_thick = 13/32 ex;
+ cheek_width = 0.72 ex;
+ left_serif_protrude = 18/60 ex;
+ right_serif_protrude = 15/60 ex;
+
+ currenttransform := currenttransform slanted slant;
+
+ penpos1 (twiddle_thick, -slant - 5);
+ penpos2 (cheek_medium, 90 - slant);
+ penpos3 (cheek_medium, 90 - slant);
+
+ x4r - x4l = cheek_thick;
+
+ penpos4 (whatever, 0);
+ penpos5 (whatever, -38);
+ penpos6 (stem_thick, 0);
+ penpos17 (straigh_len, 90 - slant);
+
+ whatever [z17l, z17r] = z4l;
+ y17 = 7/16 ex;
+ x6l = 0;
+ y6l = -descender + serif_thick / 2;
+ z1l = z6l - whatever * dir (110);
+ y1r = 0.5 ex;
+ y2r = ex;
+ z7 = whatever * up + z6l;
+ y7 = 43/60 ex;
+ z2l = whatever * up + 0.3 [z7, z1r];
+ y8 = 0.9 [y7, y2l];
+ z8 = 2/3 [z6l, z6r] + whatever * up;
+ y3r = ex;
+ z3l = 0.58 [(stem_thick, -descender),
+ (stem_thick + cheek_width - cheek_thick, -descender)]
+ + whatever * up;
+ y4r = .38 ex;
+ z4r = whatever * up + (stem_thick + cheek_width, -descender);
+ z5l = whatever * up + z3l;
+ y5r = -lower_overshoot;
+ y5l = y5r + cheek_medium * ypart dir (55);
+ z9 = z6r + whatever * up;
+ y9 = .2 [y5l, y5r];
+
+ p := z2r{right}
+ .. {dir (-60)}z8{dir 60}
+ .. z3r{right}
+ .. z4r{down}
+ ..tension 1.1.. z5r{left}
+ .. {curl 1}z9
+ -- z6r
+ -- z6l
+ -- z7{up}
+ .. z2l{left}
+ ..tension 1.2.. simple_serif (z1r, z1l, -90)
+ .. cycle;
+
+ blot_t := 0.13;
+ corner_t := xpart (p intersectiontimes z9);
+
+% pickup pencircle scaled 1;
+
+% draw
+ fill subpath (0, corner_t - 2 blot_t) of p
+ .. subpath (corner_t + blot_t, length p) of p
+ .. cycle;
+
+ y12 = 0.5 ex;
+ z12 = z6r + whatever * up;
+
+ unfill z17l
+ ..tension 1.5.. z17r
+ .. z3l{left}
+ ..tension 1.05.. z12{down}
+ ..tension 1.05.. z5l{right}
+ .. cycle;
+
+ penlabels (1, 2, 3, 4, 5, 6, 17);
+ labels (7, 8, 9);
+
+ pickup pencircle scaled serif_thick;
+
+ lft x11 = -left_serif_protrude;
+ rt x10 = stem_thick + right_serif_protrude;
+ bot y10 = bot y11 = -descender;
+
+ z15 = z6l + up * fill_up;
+ z16 = z6r + up * 1.2 fill_up;
+
+ % Since pens are not affected by currenttransform we directly
+ % transform the necessary points, then simulating the pen with
+ % an outline while using the identity transformation.
+
+ forsuffixes $ = 7, 10, 11, 15, 16:
+ tmp := z$ transformed currenttransform;
+ x$ := xpart tmp;
+ y$ := ypart tmp;
+ endfor;
+
+ currenttransform := identity;
+
+ updir = z7 - z15;
+
+ serif := simple_serif (z10, z11, dishing_angle);
+
+ penpos10 (serif_thick, -dishing_angle - 90);
+ penpos11 (serif_thick, dishing_angle - 90);
+ penpos13 (serif_thick, angle (direction 0.05 of serif) + 90);
+ penpos14 (serif_thick, angle (direction 0.85 of serif) + 90);
+
+ z13 = point 0.05 of serif;
+ z14 = point 0.85 of serif;
+
+ penlabels (10, 11, 13, 14);
+ labels (15, 16);
+
+% draw
+ fill z15{-updir}
+ .. z14l{direction 0.85 of serif}
+ .. z11l{-dir (dishing_angle)}
+ .. z11r{dir (dishing_angle)}
+ .. z14r{-direction 0.85 of serif}
+ .. z13r{-direction 0.05 of serif}
+ .. z10r{dir (-dishing_angle)}
+ .. z10l{-dir (-dishing_angle)}
+ .. z13l{direction 0.05 of serif}
+ .. z16{updir}
+ -- cycle;
+fet_endchar;
+
+
+%
+% NOTES:
+%
+% * Right stem is fatter and more straight than the left two stems.
+%
+% * The twiddle at the left is similar to the `p' twiddle.
+%
+% * The bottoms of the stems are blotted.
+%
+%
+% This is cut & paste programming. Somehow three `i' shapes in two
+% characters (`p' and `m') -- doesn't seem worth the trouble of writing
+% a macro.
+%
+
+code := 108;
+
+fet_beginchar ("dynamic m", "m");
+ save i_thick, i_angle, i_twiddle_thick;
+ save i_twiddle_start_angle, i_twiddle_start_y;
+ save i_twiddle_end_angle, i_left_space;
+ save idir, center, right_ending;
+ save overshoot;
+ save p;
+ pair center, idir, right_ending;
+ path p;
+
+ set_char_box (0, 1.5 ex#, 0, 1.0 ex#);
+
+ % should share code with p for twiddle.
+
+ overshoot = .25 serif_thick;
+ i_thick := 21/80 ex;
+ i_twiddle_thick = 1.2 serif_thick;
+ i_twiddle_start_y = 8/16 ex;
+ i_twiddle_start_angle = 0;
+ i_twiddle_end_angle := 35;
+
+ center = (0, 0);
+
+ currenttransform := currenttransform slanted slant;
+
+ i_angle := 0;
+ idir := dir (90 - i_angle);
+ i_left_space = 16/80 ex;
+
+ penpos1 (i_twiddle_thick, -i_twiddle_start_angle);
+ y1 = i_twiddle_start_y;
+ z1r = center - (i_left_space, 0) + whatever * idir;
+
+ y2l = ex + overshoot;
+ z2l = .08 [z3l, z3r] + whatever * idir;
+ z2r = 5/8 [z1r, z3l] + whatever * idir;
+ y2r = y5l + 1/9 ex;
+ z2 = 1/2 [z2l, z2r];
+
+ penpos3 (i_thick, 0);
+ y3 = 0.5 bottom_blot + ypart center;
+ z3l = center + whatever * idir;
+
+ penpos4 (i_thick - bottom_blot, 0);
+ y4 = ypart center;
+ z4 - z3 = whatever * idir;
+
+ penpos5 (i_thick, 0);
+ z5 = z4 + whatever * idir;
+ y5 = 55/80 ex;
+
+ fill simple_serif (z1l, z1r, 90)
+ ..tension 1.2.. z2r{right}
+ .. z5l{z3 - z5}
+ -- z3l{z3 - z5}
+ .. z4l{right}
+ -- z4r{right}
+ .. z3r{z5 - z3}
+ -- z5r{z5 - z3}
+ ..tension 1.2.. z2l{left}
+ .. cycle;
+
+ right_ending := z5r;
+ penlabels (1, 2, 3, 4, 5);
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ clearxy;
+
+ i_angle := -3.2;
+ idir := dir (90 - i_angle);
+ i_left_space := 14/80 ex;
+
+ penpos1 (serif_thick, -i_twiddle_start_angle);
+ z1r = right_ending;
+
+ y2l = ex+ overshoot;
+ z2l = .08 [z3l, z3r] + whatever * idir;
+ z2r = 5/8 [z1r, z3l] + whatever * idir;
+ y2r = y5l + 1/9 ex;
+ z2 = 1/2 [z2l, z2r];
+
+ penpos3 (i_thick, 0);
+ y3 = 0.5 bottom_blot + ypart center;
+ z3l = z5l + whatever * idir;
+
+ penpos4 (i_thick - bottom_blot, 0);
+ y4 = ypart center;
+ z4 - z3 = whatever * idir;
+
+ penpos5 (i_thick, 0);
+ z5l = right_ending + (i_left_space, 0);
+
+ fill simple_serif (z1l, z1r, 90)
+ ..tension 1.05.. z2r{right}
+ .. z5l{z3 - z5}
+ -- z3l
+ .. z4l{right}
+ -- z4r{right}
+ .. z3r{z5 - z3}
+ -- z5r{z5 - z3}
+ ..tension 1.2.. z2l{left}
+ .. cycle;
+
+ right_ending := z5r;
+ penlabels (1, 2, 3, 4, 5);
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ clearxy;
+
+ i_thick := 23/80 ex;
+ i_angle := -6;
+ idir := dir (90 - i_angle);
+ i_left_space := 14/80 ex;
+
+ penpos1 (serif_thick, -i_twiddle_start_angle);
+ z1r = right_ending;
+
+ y2l = ex + overshoot;
+ z2l = .08 [z3l, z3r] + whatever * idir;
+ z2r = 5/8 [z1r, z3l] + whatever * idir;
+ y2r = y5l + 1/9 ex;
+ z2 = 1/2 [z2l, z2r];
+
+ penpos3 (whatever, 20);
+ y3l = 1/8 ex + ypart center;
+ z3l = z7l + whatever * idir;
+ z3r = z7r + whatever * idir;
+
+ penpos5 (whatever, 10);
+ z5l = right_ending + (i_left_space, 0);
+ z5r = z7r + whatever * idir;
+
+ penpos6 (serif_thick, -i_twiddle_end_angle);
+ y6l = 23/80 ex + ypart center;
+ z6l = 1.6 [z3l, z3r] + whatever * idir;
+
+ penpos7 (i_thick, 0);
+ y7 = 0;
+ z7l = z5l + whatever * idir;
+
+ z8 = z7 - (0, overshoot);
+
+ fill simple_serif (z1l, z1r, 90)
+ ..tension 1.05.. z2r{right}
+ .. z5l{z3 - z5}
+ -- z3l{z3 - z5}
+ .. z8{right}
+ .. simple_serif (z6r, z6l, 90)
+ ..tension 0.85.. z3r{z5 - z3}
+ -- z5r{z5 - z3}
+ ..tension 1.2.. z2l{left}
+ .. cycle;
+
+ penlabels (range 1 thru 8);
+fet_endchar;
+
+
+code := 113;
+
+fet_beginchar ("dynamic r", "r");
+ save base_point, stem_thick, bulb_diam;
+ save twiddle_thick, attach_len, overshoot, taille;
+ pair base_point;
+
+ set_char_box (0, .75 ex#, 0, ex#);
+
+ stem_thick =.26 ex;
+ bulb_diam = .30 ex;
+ twiddle_thick = 1.1 serif_thick;
+ overshoot = .5 serif_thick;
+ taille = -0.3 serif_thick;
+ attach_len + bulb_diam / 2 + stem_thick = w;
+
+
+ base_point = (0, 0);
+
+ currenttransform := identity slanted ypart (dir (15));
+
+ penpos1 (stem_thick, 0);
+ x1l = 0;
+ y1l = .5 bottom_blot;
+
+ penpos2 (stem_thick, 0);
+ x2l = x1l;
+ y2l - y1l = 36/47 ex;
+
+ penpos3 (twiddle_thick, -20);
+ x3r = x2l - .2 ex;
+ y3 = .77 ex;
+
+ x4l = -0.1 [x1l, x1r];
+ y4l = ex + overshoot;
+ x4r = 0.62 [x3r, x2l];
+ y4r = 0.5 [y4l, y2l];
+
+ penpos5 (whatever, -74);
+ y5l - y5r = bulb_diam;
+ y5l = ex + overshoot;
+ x5 = x2r + attach_len;
+
+ penpos6 (bulb_diam, 0);
+ z6 = z5;
+
+% z7 = z6l + taille * dir (180);
+ z7 = z6 + .4 * bulb_diam * dir (-125);
+
+ z8 = 9/10 [z1r, z2r];
+
+ x9 = 0.15 [x1r, x1l];
+ y9 = y4l - .12 ex;
+
+ penpos10 (stem_thick - bottom_blot, 0);
+ x10 = x1;
+ y10 = 0;
+
+% pickup pencircle scaled 1;
+
+% draw
+ fill z1r{down}
+ .. z10r{left}
+ -- z10l{left}
+ .. z1l{up}
+ -- z2l{up}
+ .. z4r{left}
+ ..tension 1.2.. {down}simple_serif (z3r, z3l,-90){up}
+ ..tension 0.95.. z4l
+ .. {curl 1}z9{curl 1}
+ .. z5l
+ .. z6r{dir (-80)}
+ .. z5r{left}
+ .. z7
+ .. z6l
+ ..tension 1.2.. z8{down}
+ -- cycle;
+
+ penlabels (range 1 thru 10);
+fet_endchar;
+
+
+%%% KERNING
+
+ligtable "m":
+ "p" kern 0.2 ex#,
+ "f" kern -0.1 ex#;
+
+ligtable "f":
+ "f" kern -0.13 ex#;
+
+ligtable "r":
+ "f" kern 0.1 ex#;
+
+
+%% notes from old dyn code.
+
+% `f' obviously has a _lot_ bigger slant than `p' (see Wanske p.239).
+% However; perhaps we need two f symbols:
+% - a super-slanted one used in `f', `mf', `sfz', `sf'
+% - a more normal-slanted in `ff', `fff', `fp', `fp' (see Wanske p.241)
+%
+% Looking at professionally typeset music reveals that typesetters
+% are somewhat unsure about slanting in `mf', `fp', `sfz'
+%
+% `f' and `p' (in any combination) are a lot (factor two) fatter than
+% `s', `m', and `z'. Sometimes the `m' and `z' are a bit fatter than
+% `s'.
+%
+% Chester, Breitkopf suggest smaller sizes of these other glyphs,
+% using the x-height as reference point.
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- rest symbols -*-Fundamental-*-
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("rests");
-
-save block_rest_y, block_rest_x;
-save breve_rest_y, breve_rest_x;
-
-breve_rest_y# = staff_space#;
-breve_rest_x# = 3/5 staff_space#;
-block_rest_y# = 5/8 staff_space#;
-block_rest_x# = 3/2 staff_space#;
-
-define_whole_pixels (block_rest_y, block_rest_x);
-define_whole_pixels (breve_rest_y, breve_rest_x);
-
-
-def block_rest =
- draw_block ((0, 0), (block_rest_x, block_rest_y));
-enddef;
-
-
-fet_beginchar ("whole rest", "0");
- set_char_box (0, block_rest_x#,
- block_rest_y#, 0);
-
- block_rest;
- currentpicture := currentpicture
- shifted (0, -block_rest_y + feta_space_shift);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("half rest", "1");
- set_char_box (0, block_rest_x#, 0, block_rest_y#);
-
- block_rest;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-%
-% should use ledgerline thickness?
-%
-fet_beginchar ("whole rest (outside staff)", "0o");
- set_char_box (0, block_rest_x#,
- block_rest_y#, ledgerlinethickness# / 2);
-
- block_rest;
- currentpicture := currentpicture shifted (0, -block_rest_y);
-
- pickup pencircle scaled ledgerlinethickness;
-
- y5 = y6 = 0;
- lft x5 = -b - block_rest_y;
- rt x6 = w + block_rest_y;
- draw_gridline (z5, z6, ledgerlinethickness_rounded);
-
- draw_staff (-2, 2, -3);
-fet_endchar;
-
-
-fet_beginchar ("half rest (outside staff)", "1o");
- set_char_box (0, block_rest_x#,
- ledgerlinethickness# / 2, block_rest_y#);
-
- block_rest;
-
- pickup pencircle scaled ledgerlinethickness;
-
- y5 = y6 = 0;
- lft x5 = -b - block_rest_y;
- rt x6 = w + block_rest_y;
-
- draw_gridline (z5, z6, ledgerlinethickness_rounded);
-
- draw_staff (-2, 2, 3);
-fet_endchar;
-
-
-fet_beginchar ("maxima rest", "M3");
- set_char_box (0, 3 breve_rest_x#, breve_rest_y#, breve_rest_y#);
-
- draw_block ((0, -breve_rest_y + feta_shift),
- (breve_rest_x, breve_rest_y));
-
- addto currentpicture also currentpicture shifted (2 breve_rest_x, 0);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("longa rest", "M2");
- set_char_box (0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
-
- draw_block ((0, -breve_rest_y + feta_shift),
- (breve_rest_x, breve_rest_y));
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("breve rest", "M1");
- set_char_box (0, breve_rest_x#, 0, breve_rest_y#);
-
- draw_block ((0, 0), (breve_rest_x, breve_rest_y));
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Quarter rest", "2");
- save alpha, yshift, height;
- save xcenter;
-
- yshift# := -1.25 staff_space#;
- height# := 2.8125 staff_space#;
- define_pixels (yshift, height);
-
- alpha := -50;
- thick := 1/4 staff_space;
- rthin := 1.25 linethickness;
- xcenter := -0.1 staff_space;
- rthick := 2 thick + rthin;
-
- set_char_box (0, 0.95 staff_space#, -yshift#, yshift# + height#);
-
- save ne, nw, se, sw;
- pair ne, nw, se, sw;
-
- se = dir alpha;
- ne = dir (alpha + 90);
- nw = dir (alpha + 180);
- sw = dir (alpha + 270);
-
- penpos1 (rthin, alpha + 90);
- penpos2 (5/4 rthick, alpha);
- penpos4 (5/4 rthick, alpha);
- penpos5 (rthin, alpha + 90);
- penpos3 (3/4 rthick, alpha);
-% penpos6 (5/8 rthick, alpha);
- penpos6 (2/3 rthick, alpha);
- penpos7 (1/2 rthin, alpha + 90);
-
- z10 = z2l + 1/2 rthin * sw;
-% z11 = z4l + 1/2 rthin * sw;
- z11 = z4l + 1/2 rthin * sw + 1/2 rthin * se;
- z12 = z4r + 1/2 rthin * ne;
-% z13 = z2r + 1/2 rthin * ne;
- z13 = z2r + 1/2 rthin * ne + 1/2 rthin * nw;
-
- y1r = h;
- x1l = xcenter + 1/3 staff_space;
- z2r = z1 + staff_space * se;
- z3 = 1/2 [z2, z4];
- x4 = xcenter + 3/8 staff_space;
- y4 = 0;
- y4l := vround y4l;
- z5 = round (z4l + 1.3 staff_space * se) + feta_offset;
- x6l = x4l;
- y6l = vround y4r;
- x6r := hround x6r + xpart feta_offset;
- y6r := vround y6r + ypart feta_offset;
- x7 = hround (xcenter + 2/5 staff_space) + xpart feta_offset;
- y7 = -d;
-
- save before, after;
- path before, after;
- before = z11{se}
- .. {se}z5l;
- after = z5r{nw}
- ..tension1.4.. z6l;
- (u, v) = before intersectiontimes after;
-
- fill z1l{se}
- .. {se}z10
- .. z3l
- .. subpath (0, u) of before
- .. subpath (v, infinity) of after
- ..tension1.4.. {se}z7l
- .. z7r{nw}
- ..tension1.4.. z6r
- ..tension1.4.. {se}z5l
- .. z5r{nw}
- .. {nw}z12
- .. z3r
- .. z13{nw}
- .. {nw}z1r
- .. cycle;
-
- penlabels (1, 2, 3, 4, 5, 6, 7);
- penlabels (10, 11, 12, 13);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-%
-% Notes about 8th rest:
-%
-% * 8th rest should be no wider than the black note head
-%
-% * The inside corner of the horizontal portion is usually a little blotted.
-%
-% * The top of the crook chops off the vertical brush
-%
-% * The crook widens a little
-%
-% * The bottom of the brush is slightly flat, as it has to align with
-% stafflines if it is inside the staff.
-%
-% * The top of the brush usually is a little lower than the top of bulb.
-%
-% * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes
-% it is closed, or even a flare.
-%
-
-% from an email to Rune Zedeler:
-%
-%
-% For example, the 8th rest was vaguely based on a book with trumpet
-% studies by Duhem, and by Baerenreiters cello suites. I included my
-% findings in a comment in the mf file. One of the things that I tried
-% to do was make the rest a little lighter and narrower than the black
-% note head. I think this looks better in polyphonic music, when the
-% rest is below a head from a different voice.
-%
-
-save bulb_diam, thin, thick;
-
-bulb_diam# := 0.64 staff_space#;
-thin# := 1.4 linethickness# - 0.02 staff_space#;
-thick# := 2.2 linethickness#;
-
-crook_thin := 0.5 linethickness + 0.08 staff_space;
-lower_brush := 1.5 linethickness;
-
-define_pixels (bulb_diam);
-define_whole_blacker_pixels (thin, thick);
-
-
-%
-% PAT is a compact way to pass the brush shape to the routine.
-%
-
-def draw_rest_bulb (expr ycenter, ycut, pat, stretch, show_labels) =
-begingroup;
- save x, y, pt, res;
-
- z1l = point 0 of pat;
- z2l = point 1 of pat;
- z2r = point 3 of pat;
- z1r = point 4 of pat;
- z1 = 0.5 [z1l, z1r];
- z2 = 0.5 [z2l, z2r];
- y10 = ycenter;
- z10 = whatever [z2, z1] + left * bulb_diam * stretch;
-
- % this enforces similar bulb shapes for lower resolutions
- x10 := hround x10;
-
- z3 = z10 + bulb_diam / 2.15 * dir (-72);
- y3 := hround y3;
- z5 = z10 + up * bulb_diam / 2 + right * linethickness / 3;
- y5 := hround y5;
-
- z7 = 0.5 [z4, z5] + crook_thin * (0.45, 0.4) / 1.3;
- x8 = hround (x10 - 0.4 bulb_diam);
- y8 = y10 + 0.25 linethickness;
-
- z6 = whatever [z1l, z2l];
- z6 = z3 + whatever * dir (12);
-
- z4 = z3 + whatever * (z6 - z3)
- + 1.1 crook_thin * (unitvector (z6 - z3) rotated 90);
- x4 = x10 + bulb_diam * .62;
- y4 := vround y4;
-
- (pt, whatever) = pat intersectiontimes ((0, ycut) -- (w, ycut));
-
- path res;
- res = point pt of pat {-direction pt of pat}
- ..tension 2.. z4{left}
- ..tension 0.9.. z7
- .. z5{left}
- .. z8
- .. z3{right}
- .. {curl 0.2}z6;
-
- if show_labels = 1:
- labels (3, 4, 5, 6, 7, 8, 10);
- fi;
-
-res
-endgroup;
-enddef;
-
-
-def draw_eighth_rest (expr show_labels) =
- save ycenter;
- save pat, bulb;
- path pat, bulb;
-
- set_char_box (0, 1.0 staff_space#,
- 1.0 staff_space# + 0.5 linethickness#,
- 0.5 staff_space# + bulb_diam# / 2);
-
- penpos1 (thick, 0);
- penpos2 (thin, 10);
-
- y1 = -staff_space_rounded;
- y2 = h - vround lower_brush;
- x2r = w;
- z2 = z1 + whatever * dir (72);
- z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
- y9 := vround y9;
-
- x1l := hround x1l;
- x1r := hround x1r;
- x1 := .5 [x1l, x1r];
-
- if show_labels = 1:
- penlabels (1, 2);
- labels (9);
- fi;
-
- pat = z1l
- -- z2l
- .. z9
- .. z2r
- -- z1r
- .. cycle;
- bulb = draw_rest_bulb (0.5 staff_space, y2r, pat, 1.0, show_labels);
-
- fill simple_serif (z1l, z1r, 40)
- -- z2r
- .. z9
- .. bulb
- -- z1l
- .. cycle;
-
- draw_staff (-2, 2, 0);
-enddef;
-
-
-fet_beginchar ("Classical quarter rest", "2classical");
- draw_eighth_rest (0);
- currentpicture := currentpicture xscaled -1 shifted (w, 0);
-fet_endchar;
-
-
-fet_beginchar ("8th rest", "3");
- draw_eighth_rest (1);
-fet_endchar;
-
-
-%
-% TODO: the X dimensions of the rests are fucked up:
-% they can collide with augmentation dots.
-%
-
-fet_beginchar ("16th rest", "4");
- save ycenter;
- save pat, bulb_a, bulb_b;
- path pat, bulb_a, bulb_b;
-
- set_char_box (0, 1.2 staff_space#,
- 2.0 staff_space# + 0.5 linethickness#,
- 0.5 staff_space# + bulb_diam# / 2);
-
- penpos1 (thick, 0);
- penpos2 (thin, 10);
-
- y1 = -2 staff_space_rounded;
- y2 = h - vround lower_brush;
- x2r = w;
- z2 = z1 + whatever * dir (74);
- z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
- y9 := vround y9;
-
- x1l := hround x1l;
- x1r := hround x1r;
- x1 := .5 [x1l, x1r];
-
- pat = z1l
- -- z2l
- .. z9
- .. z2r
- -- z1r
- .. cycle;
- bulb_a = draw_rest_bulb (.5 staff_space,
- y2r, pat, 0.98, 1);
- bulb_b = draw_rest_bulb (.5 staff_space - staff_space_rounded,
- hround ((-0.5 + 0.2) * staff_space),
- pat, 1.02, 1);
-
- fill simple_serif (z1l, z1r, 40)
- -- z2r
- .. z9
- .. bulb_a
- -- bulb_b
- -- z1l
- .. cycle;
-
- penlabels (1, 2);
- labels (9);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("32th rest", "5");
- save ycenter;
- save pat, bulb_a, bulb_b, bulb_c;
- path pat, bulb_a, bulb_b, bulb_c;
-
- set_char_box (0, 1.3 staff_space#,
- 2.0 staff_space# + 0.5 linethickness#,
- 1.5 staff_space# + bulb_diam# / 2);
-
- penpos1 (thick, 0);
- penpos2 (thin, 10);
-
- y1 = -2 staff_space_rounded;
- y2 = h - vround lower_brush;
- x2r = w;
- z2 = z1 + whatever * dir (76);
- z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
- y9 := vround y9;
-
- x1l := hround x1l;
- x1r := hround x1r;
- x1 := .5 [x1l, x1r];
-
- pat = z1l
- -- z2l
- .. z9
- .. z2r
- -- z1r
- .. cycle;
- bulb_a = draw_rest_bulb (.5 staff_space + staff_space_rounded,
- y2r, pat, 0.96, 1);
- bulb_b = draw_rest_bulb (.5 staff_space,
- hround ((0.5 + 0.2) * staff_space),
- pat, 1.00, 1);
- bulb_c = draw_rest_bulb (.5 staff_space - staff_space_rounded,
- hround ((-0.5 + 0.21) * staff_space),
- pat, 1.04, 1);
-
- fill simple_serif (z1l, z1r, 40)
- -- z2r
- .. z9
- .. bulb_a
- -- bulb_b
- -- bulb_c
- -- z1l
- .. cycle;
-
- penlabels (1, 2);
- labels (9);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("64th rest", "6");
- save ycenter;
- save pat, bulb_a, bulb_b, bulb_c, bulb_d;
- path pat, bulb_a, bulb_b, bulb_c, bulb_d;
-
- set_char_box (0, 1.4 staff_space#,
- 3.0 staff_space# + 0.5 linethickness#,
- 1.5 staff_space# + bulb_diam# / 2);
-
- penpos1 (thick, 0);
- penpos2 (thin, 10);
-
- y1 = -3 staff_space_rounded;
- y2 = h - vround lower_brush;
- x2r = w;
- z2 = z1 + whatever * dir (78);
- z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
- y9 := vround y9;
-
- x1l := hround x1l;
- x1r := hround x1r;
- x1 := .5 [x1l, x1r];
-
- pat = z1l
- -- z2l
- .. z9
- .. z2r
- -- z1r
- .. cycle;
- bulb_a = draw_rest_bulb (.5 staff_space + staff_space_rounded,
- y2r, pat, 0.94, 1);
- bulb_b = draw_rest_bulb (.5 staff_space,
- hround ((0.5 + 0.20) * staff_space),
- pat, 0.98, 1);
- bulb_c = draw_rest_bulb (.5 staff_space - staff_space_rounded,
- hround ((-0.5 + 0.21) * staff_space),
- pat, 1.02, 1);
- bulb_d = draw_rest_bulb (.5 staff_space - 2 staff_space_rounded,
- hround ((-1.5 + 0.22) * staff_space),
- pat, 1.06, 1);
-
- fill simple_serif (z1l, z1r, 40)
- -- z2r
- .. z9
- .. bulb_a
- -- bulb_b
- -- bulb_c
- -- bulb_d
- -- z1l
- .. cycle;
-
- penlabels (1, 2);
- labels (9);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("128th rest", "7");
- save ycenter;
- save pat, bulb_a, bulb_b, bulb_c, bulb_d, bulb_e;
- path pat, bulb_a, bulb_b, bulb_c, bulb_d, bulb_e;
-
- set_char_box (0, 1.5 staff_space#,
- 3.0 staff_space# + 0.5 linethickness#,
- 2.5 staff_space# + bulb_diam# / 2);
-
- penpos1 (thick, 0);
- penpos2 (thin, 10);
-
- y1 = -3 staff_space_rounded;
- y2 = h - vround lower_brush;
- x2r = w;
- z2 = z1 + whatever * dir (80);
- z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1)- 10);
- y9 := vround y9;
-
- x1l := hround x1l;
- x1r := hround x1r;
- x1 := .5 [x1l, x1r];
-
- pat = z1l
- -- z2l
- .. z9
- .. z2r
- -- z1r
- .. cycle;
- bulb_a = draw_rest_bulb (.5 staff_space + 2 staff_space_rounded,
- y2r, pat, 0.92, 1);
- bulb_b = draw_rest_bulb (.5 staff_space + staff_space_rounded,
- hround ((1.5 + 0.20) * staff_space),
- pat, 0.96, 1);
- bulb_c = draw_rest_bulb (.5 staff_space,
- hround ((0.5 + 0.21) * staff_space),
- pat, 1.0, 1);
- bulb_d = draw_rest_bulb (.5 staff_space - staff_space_rounded,
- hround ((-0.5 + 0.22) * staff_space),
- pat, 1.04, 1);
- bulb_e = draw_rest_bulb (.5 staff_space - 2 staff_space_rounded,
- hround ((-1.5 + 0.23) * staff_space),
- pat, 1.08, 1);
-
- fill simple_serif (z1l, z1r, 40)
- -- z2r
- .. z9
- .. bulb_a
- -- bulb_b
- -- bulb_c
- -- bulb_d
- -- bulb_e
- -- z1l
- .. cycle;
-
- penlabels (1, 2);
- labels (9);
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_endgroup ("rests");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- draw flags
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("flags");
+
+save outer_path;
+path outer_path;
+
+%
+% Flags pointing down overlap with the notehead (in x-direction), so
+% the down-flag can be bigger.
+%
+
+upflag_width# = .65 black_notehead_width# + stemthickness# / 2;
+downflag_width# = .833 black_notehead_width# + stemthickness# / 2;
+
+right_upflag_space# = .0 upflag_width#;
+right_downflag_space# = .0 downflag_width#;
+
+%
+% Flags pointing down cannot overlap with the notehead in y-direction,
+% so they have less slant.
+%
+% Because of optical illusion, the utmost flag (bottom for
+% down-pointing, top for up-pointing) should be smaller than the other
+% flags. Adobe Sonata doesn't do this correctly. (Instead they have
+% an extension flag, which looks less elegant.)
+%
+
+save hip_thickness, foot_thickness;
+
+hip_thickness# = 1.0 linethickness# + 0.069 staff_space#;
+foot_thickness# = 1.2055 linethickness# + 0.06 staff_space#;
+
+define_pixels (hip_thickness, foot_thickness);
+
+%
+% Inspired by Adobe Sonata and [Wanske].
+% For example, see POSTSCRIPT Language -- program design,
+% page 119, and [Wanske], p 41, 42.
+%
+
+def draw_flag (expr center, flare, dims, hip_depth, foot_wid,
+ hip_thickness, foot_thickness, show_labels) =
+ save c;
+
+ clearxy;
+
+ c = 0.7;
+
+ penpos1 (flare, 90);
+ penpos2 (whatever, 0);
+
+ x2r - x2l = hround (hip_thickness);
+
+ penpos3 (foot_thickness, -20.0);
+
+ z1r = center;
+ z2r = center + (xpart (dims), -ypart (dims) * hip_depth);
+ z3r = center + (xpart (dims) * foot_wid, -ypart (dims));
+
+ x2r := hround x2r;
+ y2r := vround y2r;
+
+ outer_path := z3r{curl c}
+ .. z2r{up}
+ .. {up}z1r;
+
+ if show_labels = 1:
+ penlabels (1, 2, 3);
+ fi;
+
+ fill z1l{curl 0}
+ ..tension 1.1.. z2l{down}
+ .. {curl c}simple_serif (z3l, z3r, 80)
+ & outer_path
+ & z1r
+ -- cycle;
+enddef;
+
+%
+% TODO: calculate intersectpoint (see TeX book, p. 137)
+% TODO: calculate incision_depth
+%
+
+def add_flag (expr yoff, flare, hip_wid_multiplier, hip_dep_multiplier,
+ intersectpoint, hip_thickness, foot_thickness) =
+begingroup
+ save prev_center, prev_xextreme, prev_yextreme;
+ save rel_foot, ip, center, incision_depth;
+ save prev_hipwid, prev_footdep, prev_hipdep, wid, dep, hip_dep;
+ save hip_dep_ratio, foot_wid_ratio;
+ pair prev_center, center, foot, prev_xextreme, prev_yextreme;
+ pair ip, rel_foot;
+
+ incision_depth = 1.013;
+ prev_center = point 2 of outer_path;
+ prev_xextreme = point 1 of outer_path;
+ prev_yextreme = point 0 of outer_path;
+ prev_hipwid = xpart (prev_xextreme - prev_center);
+ prev_footdep = -ypart (prev_yextreme - prev_center);
+ prev_hipdep = -ypart (prev_xextreme - prev_center);
+ ip = point intersectpoint of outer_path;
+
+ wid = prev_hipwid * hip_wid_multiplier;
+ hip_dep = prev_hipdep * hip_dep_multiplier;
+
+ center = prev_center + (0, yoff);
+ rel_foot = incision_depth [(wid, hip_dep), ip - center];
+ dep = -ypart (rel_foot);
+ foot_wid_ratio = xpart (rel_foot) / wid;
+ hip_dep_ratio = hip_dep / dep;
+
+ draw_flag (center, flare, (wid, dep),
+ hip_dep_ratio, foot_wid_ratio,
+ hip_thickness, foot_thickness, 0);
+endgroup
+enddef;
+
+
+fet_beginchar ("8th Flag (up)", "u3");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+
+ flare = staff_space;
+ hip_depth_ratio = .72;
+ foot_width_ratio = .8;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ foot_depth# = 3 staff_space# - blot_diameter# / 2;
+ define_pixels (hip_width, foot_depth);
+
+ set_char_box (0,
+ hip_width# + stemthickness# / 2 + right_upflag_space#,
+ foot_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0,0), flare, (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 1);
+
+ draw_square_block ((-0.5 stemthickness_rounded, -staff_space_rounded),
+ (0, 0));
+fet_endchar;
+
+
+fet_beginchar ("16th Flag (up)", "u4");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ total_depth# = 3.5 staff_space# - blot_diameter# / 2;
+ flag_count = 2;
+ flare = .85 staff_space;
+ flagspace# = .85 staff_space#;
+ hip_depth_ratio = .72;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ flagspace# + foot_depth# = total_depth#;
+ foot_width_ratio = .8;
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0,
+ hip_width# + stemthickness# / 2 + right_upflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -flagspace), flare, (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 1);
+
+ add_flag (flagspace, flare, .97, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -2 staff_space_rounded));
+fet_endchar;
+
+
+fet_beginchar ("32nd Flag (up)", "u5");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 3;
+ total_depth# = 4.25 staff_space#;
+ flare = .85 staff_space;
+ flagspace# = .87 staff_space#;
+ hip_depth_ratio = .72;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_upflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -2 flagspace), flare, (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 1);
+
+ add_flag (flagspace, flare, .97, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, .95, 1.05, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -3 staff_space_rounded));
+fet_endchar;
+
+
+fet_beginchar ("64th Flag (up)", "u6");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 4;
+ flare = .85 staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .72;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ total_depth# = 5.25 staff_space#;
+ foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_upflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 1);
+
+ add_flag (flagspace, flare, .97, 1.00, 1.3,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, 1.00, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, .95, 1.05, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -4 staff_space_rounded));
+fet_endchar;
+
+
+fet_beginchar ("128th Flag (up)", "u7");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 5;
+ flare = .85 staff_space;
+ flagspace# = .93 staff_space#;
+ hip_depth_ratio = .72;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ total_depth# = 6.25 staff_space#;
+ foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_upflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 1);
+
+ add_flag (flagspace, flare, .97, 1.00, 1.3,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, 1.00, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, 1.00, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, 0.95, 1.05, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -5 staff_space_rounded));
+fet_endchar;
+
+
+fet_beginchar ("8th (down)", "d3");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 1;
+ flare = staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .72;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 2.85 staff_space#;
+ foot_width_ratio = .8;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, flagspace, foot_depth);
+
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2)
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 0);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -staff_space_rounded));
+
+ y_mirror_char;
+fet_endchar;
+
+
+%%%%%%%%
+%
+% Single Stroke for Short Appogiatura
+%
+
+fet_beginchar ("grace dash (up)", "ugrace");
+ save flare, hip_depth_ratio, hip_width, foot_depth;
+
+ hip_depth_ratio = .72;
+ flare# = staff_space#;
+ hip_width# = upflag_width# - hip_thickness# / 2;
+ foot_depth# = 3 staff_space#;
+
+ define_pixels (hip_width, foot_depth);
+
+ set_char_box (hip_width# * hip_depth_ratio,
+ hip_width# + right_upflag_space#,
+ foot_depth# * hip_depth_ratio, -flare#)
+
+ pickup pencircle scaled 1.5 stemthickness;
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
+ penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
+
+ fill z1l
+ -- z2l
+ .. top z2
+ .. rt z2
+ .. z2r
+ -- z1r
+ .. bot z1
+ .. lft z1
+ .. cycle;
+
+ penlabels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("grace dash (down)", "dgrace");
+ save flare, hip_depth_ratio, hip_width, foot_depth;
+ save total_depth;
+
+ hip_depth_ratio = .72 ;
+ flare# = .99 staff_space#;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 2.85 staff_space#;
+ foot_depth# = total_depth#;
+ foot_width_ratio = .8;
+
+ define_pixels (hip_width, foot_depth);
+
+ set_char_box (hip_width# * hip_depth_ratio,
+ hip_width# + right_downflag_space#,
+ foot_depth# * hip_depth_ratio, -flare#)
+
+ pickup pencircle scaled 1.5 stemthickness;
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ penpos1 (1.5 stemthickness, angle (z2 - z1) - 90);
+ penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
+
+ fill z1l
+ -- z2l
+ .. top z2
+ .. rt z2
+ .. z2r
+ -- z1r
+ .. bot z1
+ .. lft z1
+ .. cycle;
+
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("16th (down)", "d4");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 2;
+ flare = .8 staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .85;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 3.0 staff_space# - blot_diameter# / 2;
+ foot_width_ratio = .95;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 0);
+
+ add_flag (flagspace, flare, .95, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -2 staff_space_rounded));
+
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("32nd (down)", "d5");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 3;
+ flare = .84 staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .85;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 3.85 staff_space#;
+ foot_width_ratio = .95;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 0);
+
+ add_flag (flagspace, flare, .97, 1.00, 1.25,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, .95, 1.05, 1.25,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -3 staff_space_rounded));
+
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("64th (down)", "d6");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 4;
+ flare = .8 staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .85;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 4.35 staff_space#;
+ foot_width_ratio = .98;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 0);
+
+ add_flag (flagspace, flare, .97, 1.20, 1.175,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, .97, 1.10, 1.175,
+ hip_thickness, foot_thickness);
+ add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -4 staff_space_rounded));
+
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("128th (down)", "d7");
+ save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
+ save flagspace, total_depth, flag_count;
+
+ flag_count = 5;
+ flare = .8 staff_space;
+ flagspace# = .9 staff_space#;
+ hip_depth_ratio = .85;
+ hip_width# = downflag_width# - hip_thickness# / 2;
+ total_depth# = 5.25 staff_space#;
+ foot_width_ratio = .98;
+
+ (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
+ define_pixels (hip_width, foot_depth);
+ define_whole_vertical_pixels (flagspace);
+
+ set_char_box (0, hip_width# + right_downflag_space#,
+ total_depth# + foot_thickness# / 2, stemthickness# / 2);
+
+ draw_flag ((0, -(flag_count - 1) * flagspace), flare,
+ (hip_width, foot_depth),
+ hip_depth_ratio, foot_width_ratio,
+ hip_thickness, foot_thickness, 0);
+
+ add_flag (flagspace, flare, .97, 1.20, 1.175,
+ hip_thickness, foot_thickness);
+ add_flag (flagspace, flare, .97, 1.10, 1.175,
+ hip_thickness, foot_thickness);
+ add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ hip_thickness, foot_thickness);
+ add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
+ hip_thickness, foot_thickness);
+
+ draw_square_block ((-0.5 stemthickness_rounded, 0),
+ (0, -5 staff_space_rounded));
+
+ y_mirror_char;
+fet_endchar;
+
+fet_endgroup ("flags");
font_x_height staff_space#;
-%% this is a fallback so we can run the font without including feta-bolletjes.
+%% this is a fallback so we can run the font without including feta-noteheads.
black_notehead_width# := 1.0 staff_space#;
fet_beginfont ("feta", design_size, "fetaMusic");
if test = 0:
- input feta-eindelijk;
- input feta-toevallig;
- input feta-arrow;
- input feta-puntje;
- input feta-bolletjes;
- input feta-schrift;
- input feta-banier;
- input feta-klef;
- input feta-timesig;
- input feta-pendaal;
- input feta-haak;
+ input feta-rests;
+ input feta-accidentals;
+ input feta-arrowheads;
+ input feta-dots;
+ input feta-noteheads;
+ input feta-scripts;
+ input feta-flags;
+ input feta-clefs;
+ input feta-timesignatures;
+ input feta-pedals;
+ input feta-brackettips;
input feta-accordion;
else:
input feta-test-generic.mf;
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- bracket tips -*-Fundamental-*-
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("brackettips");
-
-def draw_bracket (expr thick_sharp, width_sharp, updown) =
-begingroup;
- save p, thin, thick, flattening, width, hair, flare;
- path p;
- pair tipdir;
-
- flattening = 0.72;
- thick# = thick_sharp;
- flare# = flattening * width#;
- width# = width_sharp;
-
- define_pixels (thick, width, flare);
- if updown = 1:
- set_char_box (0, width#,
- .5 thick#, flare#);
- else:
- set_char_box (0, width#,
- flare#, .5 thick#);
- fi;
-
- thin = 2 linethickness;
- hair = 1.25 linethickness;
-
- pickup pencircle scaled thin;
- y7 = y1;
- x7 = x2;
- z2 = z4r + (thin, 0);
-
- penpos3 (thin, 0);
- penpos4 (thin, 90);
-
- z3 = z4;
-
- top y3 = 0.5 thick;
- lft x3 = 0.0;
- x1 = x3l;
- y1 = -0.5 thick;
-
- z8 = .5 [z2, z7];
- top y5 = flare;
- rt x5 = width;
-
- p := z8{right}
- ..tension 1.2.. z5{curl 0};
- tipdir := direction 1 of p;
-
- penpos5 (hair, angle tipdir);
- penpos6 (hair, 90 + angle tipdir);
-
- z5 = z6;
-
- pickup pencircle scaled 1;
-
- fill (z1
- -- z3l{up}
- .. z4r{right}
- -- z2{right}
- .. z6r{tipdir}
- .. z5r
- .. z6l{-tipdir}
- ..tension 1.1.. z7{left}
- & z7
- -- z1
- & cycle) yscaled updown;
-
- if updown = 1:
- penlabels (1, 2, 3, 4, 5, 6, 7, 8);
- fi;
-endgroup;
-enddef;
-
-
-fet_beginchar ("bracket tip up", "up");
- draw_bracket (0.45 staff_space#, 1.9 staff_space#, 1);
-fet_endchar;
-
-
-fet_beginchar ("bracket tip down", "down");
- draw_bracket (0.45 staff_space#, 1.9 staff_space#, -1);
-fet_endchar;
-
-fet_endgroup ("brackettips");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- implement Clefs -*-Fundamental-*-
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
-% Jan Nieuwenhuizen <janneke@gnu.org>,
-% Juergen Reuter <reuter@ipd.uka.de>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-fet_begingroup ("clefs");
-
-%
-% [Wanske] says the bulbs should be positioned about 1/4 right of the
-% `arrow'.
-%
-% TODO: The hair-curve at z6r looks a little awkward.
-%
-
-def draw_c_clef (expr reduction) =
- save hair, norm, reduced_ss, right_edge;
- save xoff;
-
- reduced_ss# = staff_space# * reduction;
- norm# := 2/3 reduced_ss#;
- hair# := 0.06 reduced_ss# + 0.5 linethickness#;
- right_edge# = 15/4 norm# + 2 hair#;
- define_pixels (norm, reduced_ss, right_edge);
- define_whole_vertical_blacker_pixels (hair);
-
- set_char_box (0, right_edge#, 2 reduced_ss#, 2 reduced_ss#);
-
- % make unreduced glyph fit exactly into five staff lines
- if reduction = 1:
- h := d := 2 staff_space_rounded;
- fi;
-
- % assure that the gap between the left and right stem
- % has the same number of pixels as the thickness of the right
- % stem
- draw_block ((0, -d + feta_shift),
- (3/4 norm + 1/2 hair, h));
- draw_block ((3/4 norm + 1/2 hair + hround (3/2 hair), -d + feta_shift),
- (3/4 norm + 1/2 hair + 2 hround (3/2 hair), h));
-
- % assure symmetry
- h := h - feta_shift;
-
- pickup feta_fillpen;
-
- xoff = 3/4 norm + 1/2 hair + 2 hround (3/2 hair);
- z5l = (xoff - 3/4 hair, 0);
- z5r = (x4, 0);
-
- penpos1 (hair - pen_top - pen_bot, -90);
- top z1l = (xoff + norm + hair, h);
-
- penpos2 (hround (norm - 3/2 hair) - pen_lft - pen_rt, 180);
- rt z2l = (w, h / 2);
-
- penpos3 (hair - pen_top - pen_bot, 90);
- bot z3l = ((right_edge - xoff) / 2 + xoff,
- vround (.5 norm - 1.5 hair));
-
- penpos4 (hair - pen_lft - pen_rt, 0);
- top z4 = (xoff + 1/2 norm + 1/2 hair,
- vfloor (reduced_ss - linethickness - .2 hair));
-
- bot z6 = (xoff + 3/4 norm, vround (.5 norm - .5 hair));
-
- save t;
- t = 0.833;
-
- save pat;
- path pat;
-
- pat = z5l{curl 1}
- .. z4l{up}
- .. z4r{down}
- .. z3r{right}
- ..tension t.. z2r{up}
- ..tension t.. flare_path (top z1l, 180, 90,
- hair, hfloor (norm - 1/2 hair), -1)
- ..tension t.. z2l{down}
- .. z3l{left}
- .. z6
- .. z5r{down};
-
- filldraw pat shifted (0, feta_shift)
- -- reverse pat yscaled -1 shifted (0, -feta_eps)
- -- cycle;
-
- penlabels (1, 2, 3, 4, 5, 6);
-
- % ugh, should be bulb, not flare?
-
- draw_staff (-2, 2, 0);
-enddef;
-
-
-fet_beginchar ("C clef", "C");
- draw_c_clef (1.0);
-fet_endchar;
-
-
-fet_beginchar ("C clef", "C_change");
- draw_c_clef (.8);
-fet_endchar;
-
-
-%
-% New bulb routine:
-%
-% Insert a brushed piece of the path, and draw the rest of the bulb
-% separately.
-%
-% The bulb has circular form. Neat merging of the bulb and brushed path
-% is done by playing with tension.
-%
-
-def new_bulb (expr start_point, start_angle,
- outer_tangent_point,
- end_point, end_angle,
- big_radius, bulb_radius, flare,
- direction, turning_dir) =
-begingroup;
- save pat, before, after;
- save center;
- save u, v;
- path pat, before, after;
- pair center;
-
- clearxy;
-
- center = outer_tangent_point
- + big_radius * dir (0);
-% + (big_radius - bulb_radius) * dir (-turning_dir * 90)
-
- z1' = center + bulb_radius * dir (turning_dir * 180);
- z2' = outer_tangent_point + flare * dir (0);
- z3' = center + bulb_radius * dir (0);
- z4' = center + bulb_radius * dir (turning_dir * 90);
- z5' = center - 0.5 [big_radius, bulb_radius] * dir (turning_dir * 90);
-
- labels (1', 2', 3', 4', 5');
-
- before := z3'{dir (turning_dir * 90)}
- .. z4'{-dir (0)}
- ..tension 1.1.. z1'{-dir (turning_dir* 90)};
- after := z2'{dir (turning_dir * 90)}
- .. end_point{dir (end_angle)};
- (u, v) = before intersectiontimes after;
-
- pat := start_point{dir (start_angle)}
- .. outer_tangent_point{dir (-turning_dir * 90)}
- ..tension 1.02.. z5'{dir (0)}
- .. subpath (0, u) of before
- .. subpath (v, infinity) of after;
-
- if direction = 0:
- pat := reverse pat;
- fi
-
-pat
-endgroup
-enddef;
-
-
-%
-% There is some variation in the shape of bass clefs.
-%
-% * In some clefs the size of the swoosh tip almost reaches the
-% bottom staff line; in some it crosses the 2nd line from the bottom
-% with a small overshoot.
-%
-% The most popular design is where the X part of the tip is aligned
-% with the left bulb boundary, and the Y part ends on the 2nd
-% staffline exactly. This is what we do.
-%
-% * The diameter of the bulb is the width of the open space.
-%
-% * The vertical center of the bulb can be on or slightly above the
-% staff line.
-%
-% * The vertical position of the dots can be symmetrical around the
-% staffline, centered in the staff space. The Baerenreiter SCS has
-% the bottom dot raised by approximately 0.1 staff space.
-%
-% * Uncarefully set music may have overshoots at the top. We have none.
-%
-% * It is not exactly clear where the vertical tangent at the right
-% of the swoosh should be.
-%
-
-def draw_bass_clef (expr exact_center, reduction) =
- save reduced_ss, swoosh_width;
- save right_thickness, right_offset, tip_protrude;
- save dot_diam, bulb_y_offset, bulb_flare;
- pair tip_protrude;
-
- reduced_ss# = staff_space# * reduction;
- 2.2 dot_diam# = reduction * (staff_space# - stafflinethickness#);
- right_thickness# = 0.37 staff_space# + 1.2 linethickness#;
- swoosh_width# = 2.1 reduced_ss#;
- define_pixels (swoosh_width);
- define_whole_pixels (reduced_ss);
- define_whole_blacker_pixels (dot_diam, right_thickness);
-
- right_offset = 0.05 staff_space;
- bulb_y_offset := 0.075 staff_space;
- bulb_flare := 2.5 linethickness;
-% tip_protrude := (-linethickness, -.2 staff_space);
- tip_protrude := (0, 0);
-
- set_char_box (-xpart exact_center,
- xpart exact_center + swoosh_width# + 7/12 reduced_ss#,
- -ypart exact_center + 2.5 reduced_ss#,
- ypart exact_center + reduced_ss#);
-
- y1 = bulb_y_offset;
- x1 = 0;
-
- x2 = .5 [x1, x3];
- x2l = x2r = x2;
-
- y2l := vround_pixels (reduced_ss# + 0.5 linethickness#);
- y2l - y2r = linethickness;
-
- x3l - x1 = swoosh_width;
- x3l - x3r = right_thickness;
-
- % optical correction: the top dot seems farther away if y3l = 0.
- y3l = right_offset;
-
- z4 = -(0, 2.0 reduced_ss) + tip_protrude;
-
- penpos3 (whatever, 185);
- penpos4 (linethickness, 135);
-
- fill new_bulb (z2l, 180, z1, z2r, 0,
- 0.45 reduced_ss, 0.4 reduced_ss,
- bulb_flare, 1, 1)
- .. z3r{down}
- .. {curl 0}simple_serif (z4r, z4l, 90){curl 0}
- .. z3l{up}
- ..tension 0.9.. cycle;
-
- pickup pencircle scaled dot_diam;
-
- lft x5 = hround (x3l + 1/3 reduced_ss - dot_diam / 2);
- bot y5 = vfloor (.5 reduced_ss - dot_diam / 2);
- z6 = z5 yscaled -1;
-
- % for symmetry
- y5 := y5 + feta_shift;
-
- drawdot z5;
- drawdot z6;
-
- penlabels (1, 2, 3, 4, 5, 6);
-
- draw_staff (-3, 1, 0);
-enddef;
-
-
-fet_beginchar ("F clef ", "F");
- draw_bass_clef ((0, 0), 1.0);
-fet_endchar;
-
-
-fet_beginchar ("F clef (reduced)", "F_change");
- draw_bass_clef ((0, 0), 0.8);
-fet_endchar;
-
-
-
-%
-% Inspired by Baerenreiter
-%
-%
-% Beste lezers, kijk,
-%
-% Een bolletje hebben we bij toeval allemaal wel eens getekend, maar begint u
-% toch eenvoudig. Eerst een eenvoudig kruis of herstellingsteken
-% en via de dubbelslag naar een voorzichtig vlaggetje, en heb geduld!
-% Ikzelf heb bijvoorbeeld over mijn eerste gave G-sleutel
-% 35 kilobyte metafont, 12 patchlevels, 0 vriendinnen en 45 dagen gedaan
-%
-% -- vrij naar Van Kooten & De Bie
-%
-
-def debugfill = fill enddef;
-
-def draw_gclef (expr reduction) =
- save reduced_ss, downstroke_dir, downstroke_angle, center;
- save breapth_factor, inner_thick_end, thinness, thickness, thinnib;
- save start_angle, inner_start_angle, thinness;
- save upward_swoosh_angle, bot_angle;
- save pat;
- path pat;
- pair downstroke_dir, center;
-
- reduced_ss# = staff_space# * reduction;
- define_pixels (reduced_ss);
-
- thinness = 0.095 staff_space + 0.75 linethickness;
- downstroke_dir = unitvector (14, -75);
- downstroke_angle = angle downstroke_dir;
- bot_angle = -180; % downstroke_angle - 87
-
- upward_swoosh_angle = 132;
- start_angle = -97;
-
- breapth_factor = 21/14;
- inner_thick_end = 45;
- inner_start_angle = downstroke_angle - 43;
- thickness = .32 reduced_ss + 1.1 linethickness;
-
- thinnib = thinness;
-
- set_char_box (0, 1.71 * breapth_factor * reduced_ss#,
- 2.6 * reduced_ss#, 5 * reduced_ss#);
-
- center := (breapth_factor * reduced_ss, 0);
-
- z1 = center + whatever * dir (inner_start_angle);
- x1 = xpart center - .28 reduced_ss;
- penpos1 (thinnib, inner_start_angle);
-
- x2r = xpart center;
- y2r = vround_pixels (reduced_ss# + .5 stafflinethickness#);
- penpos2 (thickness, 90);
-
- z3 = (z4 - center) rotated inner_thick_end + center;
- penpos3 (thinnib, -90 + inner_thick_end);
-
- x4 = xpart center - .1 reduced_ss;
- y4r = -y2r + feta_shift;
- penpos4 (thinnib, -90);
-
- x5r = -breapth_factor * reduced_ss + xpart center;
- y5r = .37 reduced_ss + ypart center;
- penpos5 (thickness, upward_swoosh_angle);
-
- z6 = center + whatever * downstroke_dir;
- y6 = ypart center + 2 reduced_ss;
- % penpos6 is computed later
-
- z7l - z6 = whatever * (z5 - z6) ;
- y7l = 3.5 reduced_ss;
- penpos7 (thickness, upward_swoosh_angle);
-
- x9 = .7 [x10, x7r];
- top y9l = 5 reduced_ss;
- penpos9 (1.45 thickness, -70);
-
- x11 - x13r = 1.5 reduced_ss + 0.5 thinnib;
- y11 = ypart center - 47/28 reduced_ss;
- y12 = ypart center - 71/28 reduced_ss;
- y13 = .48 [y12, y4r];
- x12r = xpart (.45 [z13r, z11] + .75 reduced_ss * downstroke_dir);
-
-% z10 = center + whatever * dir (downstroke_angle - 1.5);
- x10 = x6 - 2 thinnib;
- y10 = ypart center + 3.5 reduced_ss;
- y10l - y10r = 1.0 thickness;
- z10r - z10l = .7 thinnib * dir (downstroke_angle + 90)
- + whatever * downstroke_dir;
- z10 = .5 [z10l, z10r];
- z11 = center + whatever * downstroke_dir + (-0.05 reduced_ss, 0);
-
- penpos11 (thinnib, start_angle + 90);
- penpos12 (thinnib, bot_angle + 90);
- penpos13 (thinnib + 0.14 staff_space, 180);
-
- % this auxiliary point ensures good contour overlapping
- z8 = .5 [z9l, z9r] + .25 ((z9r - z9l) rotated -90);
-
- z20 = z9l - (0, .25 blot_diameter);
- penpos20 (blot_diameter, 0);
-
- pat := z10{down}
- .. z6
- ..tension 1.1.. z11{dir (start_angle)};
-
- penpos6 (thinnib, angle (direction 1 of pat) + 90);
-
- % two auxiliary points to simulate `draw' with `penstroke'
- z10' = point 0.3 of pat;
- penpos10' (1.3 thinnib, angle (direction 0.3 of pat) + 50);
-
- z11' = point 1.5 of pat;
- penpos11' (thinnib, angle (direction 1.5 of pat) + 90);
-
- z21l = z20l;
- z21r = z9r;
-
- pat := z21l
- .. z10l{down}
- .. z10'l;
-
- fill z2l{right}
- .. z3l
- .. z4l{left}
- ..tension 1.07.. z5l{up} % inside curve
- .. z7l{up}
- ..tension 1.2.. z20r{curl 1}
- .. {direction 0 of pat}z20l
- -- z8
- -- z9r % {dir (downstroke_angle + 0)}
- ..tension 0.8.. z7r{down}
- .. z5r{down}
- .. z4r{right}
- .. z3r
- .. z2r{left}
- ..tension .95.. z1r
- -- simple_serif (z1r, z1l, 80)
- -- z1l
- ..tension 0.85.. cycle;
-
- penstroke z21e
- .. z10e{down}
- .. z10'e
- .. z6e
- .. z11'e
- .. z11e{dir (-95)}
- .. z12e{dir (bot_angle)};
-
- fill new_bulb (z12r, bot_angle, z13r, z12l, bot_angle + 180,
- 0.45 reduced_ss, 0.38 reduced_ss,
- thinnib + .05 staff_space, 1, -1)
- -- cycle;
-
- penlabels (range 1 thru 21);
- penlabels (10', 11');
-
- draw_staff (-1, 3, 0);
-enddef;
-
-
-fet_beginchar ("G clef", "G");
- draw_gclef (1.0);
-fet_endchar;
-
-
-fet_beginchar ("G clef", "G_change");
- draw_gclef (0.8);
-fet_endchar;
-
-
-%%%%
-%
-% PERCUSSION
-%
-
-%
-% The percussion clef extent is not coincident with its bbox, since
-% the percussion clef needs more space in front than a normal clef.
-%
-
-def draw_percussion_clef (expr reduction) =
- save reduced_ss, razt;
-
- reduced_ss# = staff_space# * reduction;
- define_pixels (reduced_ss);
-
- set_char_box (-.67 reduced_ss#, 2.0 reduced_ss#,
- reduced_ss#, reduced_ss#);
-
- razt := hround (0.45 reduced_ss);
-
- d := d - feta_shift;
-
- draw_block ((-b, -d), (-b + razt, h));
- draw_block ((w - razt, -d), (w, h));
-
- draw_staff (-3, 1, 1);
-enddef;
-
-
-fet_beginchar ("percussion clef", "percussion");
- draw_percussion_clef (1.0);
-fet_endchar;
-
-
-fet_beginchar ("percussion clef (reduced)", "percussion_change");
- draw_percussion_clef (.8);
-fet_endchar;
-
-
-def draw_tab_T (expr pos, siz, slant) =
-begingroup;
- save vx, vy;
- pair vx, vy;
-
- clearxy;
-
- vx = (xpart siz) * dir 0;
- vy = (ypart siz) * dir 90;
-
- penpos1 (.75 penh, 100);
- z1 = z2 + (1/6 * vx - .15 * vy);
- penpos2 (hround (.9 penw), 0);
- x2l = hround xpart (pos + .75 vy);
- y2l = ypart (pos + .75 vy);
- penpos3 (penh, -100);
- z3l = pos + .4 vx + vy;
- penpos4 (penh, -90);
- z4 = -.1 vy + .5 [z3, z5];
- penpos5 (.8 penh, -30);
- x5r = xpart (pos + siz);
- y5l = ypart (pos + siz);
-
- penpos10 (penw, 170);
- z10 = pos + .55 vx + .9 vy;
- penpos11 (.75 [penh, penw], 170);
- z11 = z10 - .5 vy + .025 vx;
- penpos12 (penh, 100);
- z12l = (xpart .5 [z13, z11], ypart (pos - .025 * siz));
- penpos13 (.75 penh, 60);
- z13 = pos + .2 vx + .15 vy;
-
- % penlabels (range 1 thru 13);
-
- soft_penstroke (z1e
- ..tension 1.1.. z2e
- .. z3e{right}
- ..tension 1.5.. z4e
- ..z5e)
- slanted slant shifted (slant * -ypart pos, 0);
-
- soft_end_penstroke (z10e
- ..tension 1.5.. z11e
- .. z12e
- ..tension 1.1.. z13e{(z13r - z13l) rotated 90})
- slanted slant shifted (slant * -ypart pos, 0);
-endgroup;
-enddef;
-
-
-def draw_tab_A (expr pos, siz, slant) =
-begingroup;
- save vx, vy, pat;
- pair vx, vy;
- path pat;
-
- clearxy;
-
- vx = (xpart siz) * dir 0;
- vy = (ypart siz) * dir 90;
-
- penpos1 (.75 penh, -110);
- z1r = pos + .07 vy;
- penpos2 (penh, -75);
- z2r = (.5 [x1, x3], ypart pos);
- penpos3 (.25 [penh, penw], -30);
- z3 = (.45 [x2, x4], .15 [y2, y4]);
- penpos4 (1 [penh, penw], 0);
- z4 = pos + .5 vx + .975 vy;
-
- penpos5 (1 [penh, penw], -180);
- z5 = z4;
- penpos6 (.2 [penh, penw], -150);
- z6l = (.8 [x5l, x7l], .9 [y5l, y7l]);
- penpos7 (penh,-90);
- z7r = (.5 [x6, x8], ypart pos);
- penpos8 (.75 penh, -70);
- z8r = (xpart (pos + siz), y7r + .075 ypart (siz));
-
- pat := z2
- .. z3
- .. z4;
-
- penpos10 (penh, angle (direction 1.2 of pat) - 180);
- z10 = point 1.2 of pat;
- penpos11 (.9 penh, -90);
- z11 = .4 [z10, z6] - 0.05 vy;
- penpos12 (.75 penh, -75);
- z12 = .3 [z11, z6] + 0.02 vy;
-
- % penlabels (range 1 thru 12);
-
- soft_penstroke (z1e{(z1r - z1l) rotated 90}
- .. z2e
- .. z3e
- .. z4e)
- slanted slant shifted (slant * -ypart pos, 0);
-
- soft_end_penstroke (z5e
- .. z6e
- .. z7e
- .. z8e{(z8r - z8l) rotated 90})
- slanted slant shifted (slant * -ypart pos, 0);
-
- soft_end_penstroke (z10e
- .. z11e
- .. z12e)
- slanted slant shifted (slant * -ypart pos, 0);
-endgroup;
-enddef;
-
-
-def draw_tab_B (expr pos, siz, slant) =
-begingroup;
- save vx, vy;
- pair vx, vy;
-
- clearxy;
-
- vx = (xpart siz) * dir 0;
- vy = (ypart siz) * dir 90;
-
- penpos1 (.75 penh, 100);
- z1 = z2 + (.15 * vx - .1 * vy);
- penpos2 (hround (.9 penw), 0);
- x2l = hround xpart (pos + .75 vy);
- y2l = ypart (pos + .75 vy);
- penpos3 (penh, -100);
- z3l = pos + .4 vx + 1.05 vy;
- penpos4 (.8 [penh, penw], -180);
- z4 = (xpart (pos + .75 siz), .5 [y3, y5]);
- penpos5 (.8 penh, 90);
- z5 = (.5 [x10, x4], ypart (pos + .55 siz));
-
- penpos6 (.8 penh, 270);
- z6 = z5;
- penpos7 (penw, 180);
- z7l = (xpart (pos + siz), .5 [y6, y8]);
- penpos8 (.8 penh, 45);
- z8 = .5 [z12l, z11l] + .15 vx - .05 vy;
-
- penpos10 (.75 [penh, penw], 170);
- z10 = pos + .375 vx + vy;
- penpos11 (.8 [penh, penw], 150);
- z11 = z10 - .5 vy + .04 vx;
- penpos12 (penh, 100);
- z12l = (xpart .5 [z13, z11], ypart pos);
- penpos13 (.75 penh, 60);
- z13 = pos + .1 vx + .15 vy;
-
- % penlabels (range 1 thru 13);
-
- soft_penstroke (z1e
- ..tension 1.1.. z2e
- .. z3e
- .. z4e
- ..z5e {left})
- slanted slant shifted (slant * -ypart pos, 0);
-
- soft_end_penstroke (z6e{right}
- .. z7e
- .. z8e{(z8r - z8l) rotated 90})
- slanted slant shifted (slant * -ypart pos, 0);
-
- soft_end_penstroke (z10e
- ..tension 1.5.. z11e
- .. z12e
- ..tension 1.1.. z13e{(z13r - z13l) rotated 90})
- slanted slant shifted (slant * -ypart pos, 0);
-endgroup;
-enddef;
-
-
-def draw_tab_clef (expr reduction) =
- save reduced_ss, letterheight, penw, penh;
-
- reduced_ss# = staff_space# * reduction;
- letterheight# = 1.8 reduced_ss#;
- define_pixels (reduced_ss, letterheight);
-
- set_char_box (-.2 reduced_ss#, 2.8 reduced_ss#,
- 1.6 letterheight#, 1.6 letterheight#);
-
- penw = .45 reduced_ss;
- penh = .2 reduced_ss;
-
- draw_tab_T ((-b + .15 reduced_ss, h - letterheight),
- (2.1 reduced_ss, letterheight), 0.2);
- draw_tab_A ((-b - .05 reduced_ss, -.5 letterheight +.15 reduced_ss),
- (2.2 reduced_ss, letterheight), 0.4);
- draw_tab_B ((-b + .025 reduced_ss, -d),
- (2.1 reduced_ss, letterheight), 0.25);
-
- draw_staff (-3, 2, 0.5);
-enddef;
-
-
-fet_beginchar ("tab clef", "tab");
- draw_tab_clef (1.0);
-fet_endchar;
-
-
-fet_beginchar ("tab clef (reduced)", "tab_change");
- draw_tab_clef (.8);
-fet_endchar;
-
-fet_endgroup ("clefs");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- implement noteheads
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+% & Han-Wen Nienhuys <hanwen@xs4all.nl>
+% & Juergen Reuter <reuter@ipd.uka.de>
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+test_outlines := 0;
+
+
+save remember_pic;
+picture remember_pic;
+
+
+% Most beautiful noteheads are pronounced, not circular,
+% and not even symmetric.
+% These examples are inspired by [Wanske]; see literature list.
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% NOTE HEAD VARIABLES
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+save black_notehead_width, noteheight;
+save half_notehead_width, whole_notehead_width, slash_thick;
+save slash_slope, overdone_heads, solfa_noteheight;
+
+numeric noteheight;
+numeric slash_thick;
+numeric black_notehead_width;
+numeric whole_notehead_width;
+numeric half_notehead_width;
+
+
+fet_begingroup ("noteheads");
+
+
+% Slope of slash. From scm/grob-description.scm. How to auto-copy?
+slash_slope := 1.7;
+
+% Thickness of slash lines. Quarter notes get 1.5slt width.
+slash_thick# := 2/3 * 0.48 staff_space#;
+
+
+%
+% Hand-engraved music often has balls extending above and below
+% the lines. If you like that, modify overdone heads (unit:
+% stafflinethickness).
+%
+overdone_heads = 0.0;
+noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
+
+
+%
+% solfa heads should not overlap on chords.
+%
+solfa_noteheight# := staff_space# - stafflinethickness#;
+
+define_pixels (slash_thick);
+define_whole_vertical_pixels (noteheight);
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% SLANT moves both extrema on the long axis (by SLANT * ELLIPTICITY,
+% so SLANT = -1, puts the extreme on the long axis next to the short
+% axis one).
+%
+
+def draw_outside_ellipse (expr ellipticity, tilt, superness, slant) =
+ save attachment_y;
+ save pat;
+ path pat;
+
+ pat := superellipse ((ellipticity, 0), (-slant * ellipticity, 1.0),
+ (-ellipticity, 0), (slant * ellipticity, -1.0),
+ superness);
+ pat := pat rotated tilt;
+
+ save top_point, right_point;
+ pair top_point, right_point;
+
+ top_point := directionpoint left of pat;
+ right_point := directionpoint up of pat;
+
+ save scaling, width;
+
+ scaling# = noteheight# / (2 ypart (top_point));
+ width# := 2 xpart (right_point) * scaling#;
+ define_pixels (scaling, width);
+
+ set_char_box (0, width#, noteheight# / 2, noteheight# / 2);
+
+ d := d - feta_space_shift;
+
+ % attachment Y
+ charwy := ypart (right_point) * scaling#;
+ charwx := width#;
+
+ pat := pat scaled scaling shifted (w / 2, .5 (h - d));
+
+ width := hround width;
+
+ if test_outlines = 1:
+ draw pat;
+ else:
+ fill pat;
+ fi;
+enddef;
+
+
+def undraw_inside_ellipse (expr ellipticity, tilt, superness, clearance) =
+begingroup
+ save pat;
+ path pat;
+
+ pat := superellipse ((ellipticity, 0), (0, 1.0),
+ (-ellipticity, 0), (0, -1.0),
+ superness);
+ pat := pat rotated tilt;
+
+ save top_point, right_point;
+ pair top_point, right_point;
+
+ top_point := directionpoint left of pat;
+ right_point := directionpoint up of pat;
+
+ save height, scaling;
+
+ height# = staff_space# + stafflinethickness# - clearance;
+ scaling# = height# / (2 ypart (top_point));
+ define_pixels (scaling);
+ pat := pat scaled scaling shifted (w / 2, .5 (h - d));
+
+ if test_outlines = 1:
+ draw pat;
+ else:
+ unfill pat;
+ fi
+endgroup;
+enddef;
+
+
+%
+% dimensions aren't entirely right.
+%
+def draw_longa (expr up) =
+ save stemthick, fudge;
+
+ stemthick# = 2 stafflinethickness#;
+ define_whole_blacker_pixels (stemthick);
+
+ fudge = hround (blot_diameter / 2);
+
+ draw_outside_ellipse (1.80, 0, 0.707, 0);
+ undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
+
+ pickup pencircle scaled stemthick;
+
+ if up:
+ bot y1 = -d;
+ top y2 = h;
+ rt x1 - fudge = 0;
+ x1 = x2;
+
+ fudge + lft x3 = w;
+ x4 = x3;
+ top y4 = h + 3.0 staff_space;
+ y3 = y1;
+ else:
+ bot y1 = -d - 3.0 staff_space;
+ top y2 = h;
+ rt x1 - fudge = 0;
+ x1 = x2;
+
+ fudge + lft x3 = w;
+ x4 = x3;
+ y4 = y2;
+ bot y3 = -d;
+ fi;
+
+ draw_gridline (z1, z2, stemthick);
+ draw_gridline (z3, z4, stemthick);
+
+ labels (1, 2, 3, 4);
+enddef;
+
+
+fet_beginchar ("Longa notehead", "uM2");
+ draw_longa (true);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+fet_beginchar ("Longa notehead", "dM2");
+ draw_longa (false);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Longa notehead", "uM2");
+ draw_longa (true);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+
+ fet_beginchar ("Longa notehead", "dM2");
+ draw_longa (false);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+%
+% dimensions aren't entirely right.
+%
+def draw_brevis (expr linecount) =
+ save stemthick, fudge;
+
+ stemthick# = 2 stafflinethickness#;
+ define_whole_blacker_pixels (stemthick);
+
+ fudge = hround (blot_diameter / 2);
+
+ draw_outside_ellipse (1.80, 0, 0.707, 0);
+ undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#);
+
+ pickup pencircle scaled stemthick;
+
+ bot y1 = -d;
+ top y2 = h;
+ rt x1 - fudge = 0;
+ x1 = x2;
+
+ fudge + lft x3 = w;
+ x4 = x3;
+ y4 = y2;
+ y3 = y1;
+
+ for i := 0 step 1 until linecount - 1:
+ draw_gridline (z1 - (1.5 * i * stemthick, 0),
+ z2 - (1.5 * i * stemthick, 0), stemthick);
+ draw_gridline (z3 + (1.5 * i * stemthick, 0),
+ z4 + (1.5 * i * stemthick, 0), stemthick);
+ endfor;
+enddef;
+
+
+fet_beginchar ("Brevis notehead", "sM1");
+ draw_brevis (1);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Brevis notehead", "sM1");
+ draw_brevis(1);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Double-lined brevis notehead", "sM1double");
+ draw_brevis (2);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Double-lined brevis notehead", "sM1double");
+ draw_brevis (2);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Whole notehead", "s0");
+ draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0);
+ undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
+ 0.68, 2 stafflinethickness#);
+
+ whole_notehead_width# := charwd;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Whole notehead", "s0");
+ draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0,
+ 0.707, 0);
+ undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
+ 0.68, 2 stafflinethickness#);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Half notehead", "s1");
+ draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
+ undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
+
+ half_notehead_width# := charwd;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Half notehead", "s1");
+ draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34,
+ 0.66, 0.17);
+ undraw_inside_ellipse (3.25, 33, 0.81,
+ 2.5 stafflinethickness#);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Quart notehead", "s2");
+ % used to have 32. With 31, they are slightly bolder.
+ draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, 0.707, 0);
+ black_notehead_width# := charwd;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Quart notehead", "s2");
+ draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
+ 0.707, 0);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+fet_beginchar ("Whole diamondhead", "s0diamond");
+ draw_outside_ellipse (1.80, 0, 0.495, 0);
+ undraw_inside_ellipse (1.30, 125, 0.6,
+ .4 staff_space# + stafflinethickness#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Whole diamondhead", "s0diamond");
+ draw_outside_ellipse (1.80, 0, 0.495, 0);
+ undraw_inside_ellipse (1.30, 125, 0.6,
+ .4 staff_space# + stafflinethickness#);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Half diamondhead", "s1diamond");
+ draw_outside_ellipse (1.50, 34, 0.49, 0.17);
+ undraw_inside_ellipse (3.5, 33, 0.80,
+ .3 staff_space# + 1.5 stafflinethickness#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Half diamondhead", "s1diamond");
+ draw_outside_ellipse (1.50, 34, 0.49, 0.17);
+ undraw_inside_ellipse (3.5, 33, 0.80,
+ .3 staff_space#
+ + 1.5 stafflinethickness#);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Quart diamondhead", "s2diamond");
+ draw_outside_ellipse (1.80, 35, 0.495, -0.25);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Quart diamondhead", "s2diamond");
+ draw_outside_ellipse (1.80, 35, 0.495, -0.25);
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+vardef penposx@# (expr d) =
+begingroup;
+ save pat;
+ path pat;
+
+ pat = top z@#
+ .. lft z@#
+ .. bot z@#
+ .. rt z@#
+ .. cycle;
+ z@#l = pat intersectionpoint (z@# -- infinity * dir (d + 180));
+ z@#r = pat intersectionpoint (z@# -- infinity * dir (d));
+endgroup
+enddef;
+
+
+%
+% UGH: xs not declared as argument.
+%
+def define_triangle_shape (expr stemdir) =
+ save triangle_a, triangle_b, triangle_c;
+ save triangle_out_a, triangle_out_b, triangle_out_c;
+ save triangle_in, triangle_out;
+ save width, depth, height;
+ save origin, left_up_dir;
+ save exact_left_point, exact_right_point, exact_down_point;
+
+ path triangle_a, triangle_b, triangle_c;
+ path triangle_out_a, triangle_out_b, triangle_out_c;
+ path triangle_in, triangle_out;
+ pair origin, left_up_dir;
+ pair exact_down_point, exact_left_point, exact_right_point;
+
+ save pen_thick;
+ pen_thick# = stafflinethickness# + .1 staff_space#;
+ define_pixels (llap);
+ define_blacker_pixels (pen_thick);
+
+ left_up_dir = llap# * dir (90 + tilt);
+
+ xpart (left_up_dir) * xs - (pen_thick# * xs) / 2 + xpart origin = 0;
+ ypart origin = 0;
+
+ exact_left_point := origin + (left_up_dir xscaled xs);
+ exact_down_point := origin + (left_up_dir rotated 120 xscaled xs);
+ exact_right_point := origin + (left_up_dir rotated 240 xscaled xs);
+
+ height# = ypart (exact_left_point + origin) + pen_thick# / 2;
+ depth# = -ypart (exact_down_point + origin) + pen_thick# / 2;
+ width# = xpart (exact_right_point - exact_left_point)
+ + pen_thick# * xs;
+
+ set_char_box (0, width#, depth#, height#);
+
+ % Formerly, the shape has simply been drawn with an elliptical pen
+ % (`scaled pen_thick xscaled xs'), but the envelope of such a curve
+ % is of 6th degree. For the sake of mf2pt1, we approximate it.
+
+ pickup pencircle scaled pen_thick xscaled xs;
+
+ z0 = (hround_pixels (xpart origin), 0);
+
+ z1 = z1' = z0 + llap * dir (90 + tilt) xscaled xs;
+ z2 = z2' = z0 + llap * dir (90 + tilt + 120) xscaled xs;
+ z3 = z3' = z0 + llap * dir (90 + tilt + 240) xscaled xs;
+
+ z12 = caveness [.5[z1, z2], z3];
+ z23 = caveness [.5[z2, z3], z1];
+ z31 = caveness [.5[z3, z1], z2];
+
+ triangle_a = z1 .. z12 .. z2;
+ triangle_b = z2 .. z23 .. z3;
+ triangle_c = z3 .. z31 .. z1;
+
+ penposx1 (angle (direction 0 of triangle_a) - 90);
+ penposx2 (angle (direction 0 of triangle_b) - 90);
+ penposx3 (angle (direction 0 of triangle_c) - 90);
+
+ penposx1' (angle (direction infinity of triangle_c) + 90);
+ penposx2' (angle (direction infinity of triangle_a) + 90);
+ penposx3' (angle (direction infinity of triangle_b) + 90);
+
+ penposx12 (angle (z12 - z0));
+ penposx23 (angle (z23 - z0));
+ penposx31 (angle (z31 - z0));
+
+ z10 = (z0 -- z1) intersectionpoint (z1l .. z12l .. z2'r);
+ z20 = (z0 -- z2) intersectionpoint (z2l .. z23l .. z3'r);
+ z30 = (z0 -- z3) intersectionpoint (z3l .. z31l .. z1'r);
+
+ triangle_in = z10
+ .. z12l
+ .. z20
+ & z20
+ .. z23l
+ .. z30
+ & z30
+ .. z31l
+ .. z10
+ & cycle;
+
+ triangle_out_a = z1r .. z12r .. z2'l;
+ triangle_out_b = z2r .. z23r .. z3'l;
+ triangle_out_c = z3r .. z31r .. z1'l;
+
+ triangle_out = top z1
+ .. lft z1
+ .. z1r{direction 0 of triangle_out_a}
+ & triangle_out_a
+ & {direction infinity of triangle_out_a}z2'l
+ .. lft z2
+ .. bot z2
+ .. z2r{direction 0 of triangle_out_b}
+ & triangle_out_b
+ & {direction infinity of triangle_out_b}z3'l
+ .. rt z3
+ .. top z3
+ .. z3r{direction 0 of triangle_out_c}
+ & triangle_out_c
+ & {direction infinity of triangle_out_c}z1'l
+ .. cycle;
+
+ labels (0, 10, 20, 30);
+ penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
+
+ % attachment Y
+ if stemdir = 1:
+ charwy := ypart exact_right_point;
+ charwx := xpart exact_right_point + .5 pen_thick# * xs;
+ else:
+ charwy := -ypart exact_down_point;
+ charwx := width# - (xpart exact_down_point - .5 pen_thick# * xs);
+ fi
+enddef;
+
+
+def draw_whole_triangle_head =
+ save hei, xs;
+ save llap;
+ save tilt;
+
+ tilt = 40;
+ llap# = 3/4 noteheight#;
+
+ xs = 1.5;
+ caveness := 0.1;
+ define_triangle_shape (1);
+ fill triangle_out;
+ unfill triangle_in;
+enddef;
+
+
+fet_beginchar ("Whole trianglehead", "s0triangle");
+ draw_whole_triangle_head;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Whole trianglehead", "s0triangle");
+ draw_whole_triangle_head;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+def draw_small_triangle_head (expr dir) =
+ save hei, xs;
+ save llap;
+ save tilt;
+
+ tilt = 40;
+ llap# = 2/3 noteheight#;
+ xs = 1.2;
+ caveness := 0.1;
+ define_triangle_shape (dir);
+
+ pickup feta_fillpen;
+
+ filldraw triangle_out;
+ unfilldraw triangle_in;
+enddef;
+
+
+fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
+ draw_small_triangle_head (-1);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
+ draw_small_triangle_head (1);
+
+ draw_staff (-2, 2, 0.5);
+fet_endchar;
+
+
+def draw_closed_triangle_head (expr dir) =
+ save hei, xs;
+ save llap;
+ save tilt;
+
+ tilt = 40;
+ llap# = 2/3 noteheight#;
+ xs = 1.0;
+ caveness := 0.1;
+ define_triangle_shape (dir);
+ fill triangle_out;
+enddef;
+
+
+fet_beginchar ("Quart trianglehead (upstem)", "u2triangle");
+ draw_closed_triangle_head (1);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Quart trianglehead (downstem)", "d2triangle");
+ draw_closed_triangle_head (-1);
+
+ draw_staff (-2, 2, 0.5);
+fet_endchar;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Slash heads are for indicating improvisation. They are
+% twice as high as normal heads.
+%
+def draw_slash (expr hwid_hash) =
+ save exact_height;
+ save ne, nw_dist;
+ pair ne, nw_dist;
+ exact_height = staff_space# + stafflinethickness# / 2;
+
+ set_char_box (0, 2 exact_height / slash_slope + hwid_hash,
+ exact_height, exact_height);
+
+ charwx := charwd;
+ charwy := charht;
+
+ clearxy;
+
+ d := d - feta_shift;
+
+ pickup pencircle scaled blot_diameter;
+
+ bot y1 = -d;
+ top y2 = h;
+ lft x1 = 0;
+ lft x2 = 2 h / slash_slope;
+
+ rt x3 = w;
+ y3 = y2;
+ y4 = y1;
+ x3 - x2 = x4 - x1;
+
+ ne = unitvector (z3 - z4);
+ nw_dist = (ne rotated 90) * 0.5 blot_diameter;
+
+ fill bot z1{left}
+ .. (z1 + nw_dist){ne}
+ -- (z2 + nw_dist){ne}
+ .. top z2{right}
+ -- top z3{right}
+ .. (z3 - nw_dist){-ne}
+ -- (z4 - nw_dist){-ne}
+ .. bot z4{left}
+ -- cycle;
+
+ if hwid_hash > 2 slash_thick#:
+ save th;
+
+ th = slash_thick - blot_diameter;
+ y6 = y7;
+ y5 = y8;
+ y3 - y7 = th;
+ y5 - y1 = th;
+ z6 - z5 = whatever * ne;
+ z8 - z7 = whatever * ne;
+
+ z5 = z1 + whatever * ne + th * (ne rotated -90);
+ z8 = z4 + whatever * ne + th * (ne rotated 90);
+
+ unfill z5
+ -- z6
+ -- z7
+ -- z8
+ -- cycle;
+ fi
+ labels (range 1 thru 10);
+enddef;
+
+
+fet_beginchar ("Whole slashhead", "s0slash");
+ draw_slash (4 slash_thick# + 0.5 staff_space#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Half slashhead", "s1slash");
+ draw_slash (3.0 slash_thick# + 0.15 staff_space#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Quart slashhead", "s2slash");
+ draw_slash (1.5 slash_thick#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% `thick' is the distance between the NE/SW parallel lines in the cross
+% (distance between centres of lines) in multiples of stafflinethickness
+%
+def draw_cross (expr thick) =
+ save ne, nw;
+ save ne_dist, nw_dist, rt_dist, up_dist;
+ save crz_in, crz_out;
+ save thickness;
+ pair ne, nw;
+ pair ne_dist, nw_dist, rt_dist, up_dist;
+ path crz_in, crz_out;
+
+ pen_thick# := 1.2 stafflinethickness#;
+ thickness# := thick * stafflinethickness#;
+ define_pixels (thickness);
+ define_blacker_pixels (pen_thick);
+
+ pickup pencircle scaled pen_thick;
+
+ h := h - feta_shift;
+
+ top y3 = h;
+ ne = unitvector ((1, (2 h - pen_thick) / (w - pen_thick)));
+ rt x4 = w / 2;
+ y5 = 0;
+ z4 - z5 = whatever * ne;
+ x6 = 0;
+ z6 - z3 = whatever * ne;
+ z3 - z4 = whatever * (ne yscaled -1);
+
+ z4 - z3 = whatever * (ne) + (ne rotated -90) * thickness;
+
+
+ x1 = charwd / 2 - .5 pen_thick#;
+ z1 = whatever * ne
+ + thick / 2 * stafflinethickness# * (ne rotated -90);
+
+ % labels (1, 2, 3, 4, 5, 6);
+
+ nw = unitvector (z3 - z4);
+
+ up_dist = up * 0.5 pen_thick / cosd (angle (ne));
+ rt_dist = right * 0.5 pen_thick / sind (angle (ne));
+ nw_dist = (ne rotated 90) * 0.5 pen_thick;
+ ne_dist = (nw rotated -90) * 0.5 pen_thick;
+
+ x4' := x4;
+ x5' := x5;
+ y6' := y6;
+
+ x4 := hround (x4' + .5 pen_thick) - .5 pen_thick;
+ x5 := hfloor (x5' + xpart rt_dist) - xpart rt_dist;
+ y6 := vfloor (y6' + ypart up_dist) - ypart up_dist;
+
+ crz_out = (z6 + up_dist)
+ -- (z3 + nw_dist){ne}
+ .. (top z3)
+ .. (z3 + ne_dist){-nw}
+ -- (z4 + ne_dist){-nw}
+ .. (rt z4)
+ .. (z4 - nw_dist){-ne}
+ -- (z5 + rt_dist);
+ crz_out := crz_out shifted (0, feta_shift)
+ -- reverse crz_out yscaled -1 shifted (0, -feta_eps);
+ fill crz_out
+ -- reverse crz_out xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+
+ if (thick > 1):
+ x4 := hround (x4' - xpart rt_dist) + xpart rt_dist;
+ x5 := hceiling (x5' - .5 pen_thick) + .5 pen_thick;
+ y6 := vfloor (y6' - .5 pen_thick) + .5 pen_thick;
+
+ crz_in = (bot z6){right}
+ .. (z6 - nw_dist){ne}
+ -- (z3 - up_dist)
+ -- (z4 - rt_dist)
+ -- (z5 + nw_dist){-ne}
+ .. {down}(lft z5);
+ crz_in := crz_in shifted (0, feta_shift)
+ -- reverse crz_in yscaled -1 shifted (0, -feta_eps);
+ unfill crz_in
+ -- reverse crz_in xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+ fi
+
+ % ugh
+ currentpicture := currentpicture shifted (hround (w / 2), 0);
+
+ charwx := charwd;
+ charwy := y1 + feta_shift;
+
+ z12 = (charwx * hppp, y1 * vppp);
+
+ labels (12);
+enddef;
+
+
+fet_beginchar ("Whole Crossed notehead", "s0cross");
+ save wid, hei;
+
+ wid# := black_notehead_width# + 4 stafflinethickness#;
+ hei# := noteheight# + stafflinethickness#;
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ draw_cross (3.75);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Whole Crossed notehead", "s0cross");
+ save wid, hei;
+
+ wid# := black_notehead_width# + 4 stafflinethickness#;
+ hei# := noteheight# + stafflinethickness#;
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ currentpicture := remember_pic;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Half Crossed notehead", "s1cross");
+ save wid, hei;
+
+ wid# := black_notehead_width# + 2 stafflinethickness#;
+ hei# := noteheight# + stafflinethickness# / 2;
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ draw_cross (3.0);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Half Crossed notehead", "s1cross");
+ save wid, hei;
+
+ wid# := black_notehead_width# + 2 stafflinethickness#;
+ hei# := noteheight# + stafflinethickness# / 2;
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ currentpicture := remember_pic;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("Crossed notehead", "s2cross");
+ wid# := black_notehead_width#;
+ hei# := noteheight#;
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ draw_cross (1.0);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("Crossed notehead", "s2cross");
+ wid# := black_notehead_width#;
+ hei# := noteheight#;
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ currentpicture := remember_pic;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+fet_beginchar ("X-Circled notehead", "s2xcircle");
+ save wid, hei;
+ save cthick, cxd, cyd, dy;
+
+ wid# := black_notehead_width# * sqrt (sqrt2);
+ hei# := noteheight# * sqrt (sqrt2);
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ d := d - feta_space_shift;
+
+ cthick# := (1.2 + 1/4) * stafflinethickness#;
+ define_blacker_pixels (cthick);
+
+ cxd := w - cthick;
+ cyd := h + d - cthick / 2;
+
+ dy = .5 (h - d);
+
+ pickup pencircle scaled cthick;
+
+ fill fullcircle xscaled (cxd + cthick)
+ yscaled (cyd + cthick)
+ shifted (w / 2, dy);
+ unfill fullcircle xscaled (cxd - cthick)
+ yscaled (cyd - cthick)
+ shifted (w / 2, dy);
+
+ xpos := .5 cxd / sqrt2;
+ ypos := .5 cyd / sqrt2;
+
+ pickup penrazor scaled cthick rotated (angle (xpos, ypos) + 90);
+ draw (-xpos + w / 2, -ypos + dy) -- (xpos + w / 2, ypos + dy);
+
+ pickup penrazor scaled cthick rotated (angle (xpos, -ypos) + 90);
+ draw (-xpos + w / 2, ypos + dy) -- (xpos + w / 2, -ypos + dy);
+
+ charwx := charwd;
+ charwy := 0;
+
+ z12 = (charwx * hppp, charwy * vppp);
+ labels (12);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+if test > 0:
+ fet_beginchar ("X-Circled notehead", "s2xcircle");
+ save wid, hei;
+ save cthick, cxr, cyr;
+
+ wid# := black_notehead_width# * sqrt (sqrt2);
+ hei# := noteheight# * sqrt (sqrt2);
+
+ set_char_box (0, wid#, hei# / 2, hei# / 2);
+
+ currentpicture := remember_pic;
+
+ draw_staff (-2, 2, 0.5);
+ fet_endchar;
+fi;
+
+
+%%%%%%%%
+%
+% SOLFA SHAPED NOTES
+%
+
+save solfa_pen_thick;
+solfa_pen_thick# = 1.75 stafflinethickness#;
+define_blacker_pixels (solfa_pen_thick);
+
+
+save solfa_base_notewidth;
+solfa_base_notewidth# := black_notehead_width#;
+
+solfa_whole_width := whole_notehead_width# / black_notehead_width#;
+solfa_half_width := half_notehead_width# / black_notehead_width#;
+solfa_quarter_width := 1.0;
+
+def draw_do_head (expr width_factor, dir) =
+ save p_in, p_out;
+ save left_dist, right_dist;
+ path p_in, p_out;
+ pair left_dist, right_dist;
+
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ bot y1 = -d;
+ y1 = y2;
+ lft x1 = 0;
+ rt x2 = w;
+ top y3 = h;
+ x3 =.5 [x1, x2];
+
+ left_dist = (unitvector (z3 - z1) rotated 90) * 0.5 solfa_pen_thick;
+ right_dist = (unitvector (z2 - z3) rotated 90) * 0.5 solfa_pen_thick;
+
+ p_in := (((z1 - left_dist) -- (z3 - left_dist)) intersectionpoint
+ (top z1 -- top z2))
+ -- ((top z1 -- top z2) intersectionpoint
+ ((z2 - right_dist) -- (z3 - right_dist)))
+ -- (((z2 - right_dist) -- (z3 - right_dist)) intersectionpoint
+ ((z1 - left_dist) -- (z3 - left_dist)))
+ -- cycle;
+
+ p_out := bot z1
+ -- bot z2{right}
+ .. rt z2{up}
+ .. (z2 + right_dist){z3 - z2}
+ -- (z3 + right_dist){z3 - z2}
+ .. top z3{left}
+ .. (z3 + left_dist){z1 - z3}
+ -- (z1 + left_dist){z1 - z3}
+ .. lft z1{down}
+ .. {right}cycle;
+
+
+ labels (1, 2, 3);
+
+ charwx := charwd;
+ charwy := -chardp + 0.5 stafflinethickness#;
+ if dir = -1:
+ charwy := -charwy;
+ fi;
+enddef;
+
+
+fet_beginchar ("Whole dohead", "s0do");
+ draw_do_head (solfa_whole_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half dohead", "d1do");
+ draw_do_head (solfa_half_width, -1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half dohead", "u1do");
+ draw_do_head (solfa_half_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Quart dohead", "d2do");
+ draw_do_head (solfa_quarter_width, -1);
+ fill p_out;
+fet_endchar;
+
+
+fet_beginchar ("Quart dohead", "u2do");
+ draw_do_head (solfa_quarter_width, 1);
+ fill p_out;
+fet_endchar;
+
+
+%
+% re - flat top, curved bottom:
+% (0,h/2) {dir -90} .. (w/2,-h/2) .. {dir 90} (w,h/2) -- cycle;
+% (broader along the base and with more vertical sides for half and
+% whole notes)
+% stem attachment: h/2
+%
+
+def draw_re_head (expr width_factor, dir) =
+ save p_in, p_out;
+ path p_in, p_out;
+
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ save curve_start;
+ curve_start = 0.7;
+ lft x1 = 0;
+ y1 = y5;
+ x1 = x2;
+ y2 = curve_start [y3, y1];
+ bot y3 = -d;
+ x3 = .5 [x2, x4];
+ rt x4 = w;
+ y4 = y2;
+ top y5 = h;
+ x5 = x4;
+
+ labels (range 1 thru 5);
+
+ p_in := (z1 + 0.5 solfa_pen_thick * (1, -1))
+ -- rt z2{down}
+ .. top z3
+ .. lft z4{up}
+ -- (z5 + 0.5 solfa_pen_thick * (-1, -1))
+ -- cycle;
+
+ p_out := lft z1
+ -- lft z2{down}
+ .. bot z3
+ .. rt z4{up}
+ -- rt z5{up}
+ .. top z5{left}
+ -- top z1{left}
+ .. {down}cycle;
+
+ charwx := charwd;
+ charwy := curve_start [-chardp, charht];
+
+ if dir = -1:
+ charwy := -charwy;
+ fi;
+enddef;
+
+
+fet_beginchar ("Whole rehead", "s0re");
+ draw_re_head (solfa_whole_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half up rehead", "u1re");
+ draw_re_head (solfa_half_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half down rehead", "d1re");
+ draw_re_head (solfa_half_width, -1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Quart rehead", "u2re");
+ draw_re_head (solfa_quarter_width, 1);
+ fill p_out;
+fet_endchar;
+
+
+fet_beginchar ("Quart rehead", "d2re");
+ draw_re_head (solfa_quarter_width, -1);
+ fill p_out;
+fet_endchar;
+
+
+def draw_mi_head (expr width_factor) =
+ save path_out, path_in;
+ save ne_dist, se_dist, ne, se;
+ path path_out, path_in;
+ pair ne_dist, se_dist, ne, se;
+
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ lft x1 = 0;
+ y1 = 0;
+ bot y2 = -d;
+ x2 = .5 [x1, x3];
+ rt x3 = w;
+ x4 = x2;
+ y3 = y1;
+ top y4 = h;
+
+ z6 - z5 = whatever * (z2 - z1);
+ z8 - z7 = whatever * (z2 - z1);
+ z8 - z5 = whatever * (z4 - z1);
+ z6 - z7 = whatever * (z4 - z1);
+
+ ne = unitvector (z4 - z1);
+ se = unitvector (z1 - z2);
+
+ ne_dist = (ne rotated 90) * 0.5 solfa_pen_thick;
+ se_dist = (se rotated 90) * 0.5 solfa_pen_thick;
+
+ z5 = whatever [z1, z4] - ne_dist;
+ z5 = whatever [z1, z2] - 1.5 se_dist;
+
+ z5 - z1 = -(z7 - z3);
+
+ labels (range 1 thru 8);
+
+ path_in := z5
+ -- z6
+ -- z7
+ -- z8
+ -- cycle;
+
+ path_out := lft z1
+ .. (z1 + se_dist){-se}
+ -- (z2 + se_dist){-se}
+ .. bot z2
+ .. (z2 - ne_dist){ne}
+ -- (z3 - ne_dist){ne}
+ .. rt z3
+ .. (z3 - se_dist){se}
+ -- (z4 - se_dist){se}
+ .. top z4
+ .. (z4 + ne_dist){-ne}
+ -- (z1 + ne_dist){-ne}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Whole mihead", "s0mi");
+ draw_mi_head (solfa_whole_width);
+ fill path_out;
+ unfill path_in;
+fet_endchar;
+
+
+fet_beginchar ("Half mihead", "s1mi");
+ draw_mi_head (solfa_quarter_width);
+ fill path_out;
+ unfill path_in;
+fet_endchar;
+
+
+fet_beginchar ("Quart mihead", "s2mi");
+ draw_mi_head (solfa_quarter_width);
+ fill path_out;
+fet_endchar;
+
+
+def draw_fa_head (expr width_factor) =
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+
+ save p_down_in, p_down_out, p_up_in, p_up_out, nw_dist, nw;
+ path p_down_in, p_down_out, p_up_in, p_up_out;
+ pair nw_dist, nw;
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ lft x1 = 0;
+ top y1 = h;
+
+ rt x2 = w;
+ y2 = y1;
+ bot y3 = -d;
+ x3 = x2;
+
+ y4 = y3;
+ x4 = x1;
+
+ labels (1, 2, 3, 4);
+
+ nw = unitvector (z1 - z3);
+ nw_dist = (nw rotated 90) * 0.5 solfa_pen_thick;
+
+ p_up_in := (((z1 - nw_dist) -- (z3 - nw_dist)) intersectionpoint
+ (bot z1 -- bot z2))
+ -- (((z1 - nw_dist) -- (z3 - nw_dist)) intersectionpoint
+ (lft z3 -- lft z2))
+ -- (z2 + 0.5 solfa_pen_thick * (-1, -1))
+ -- cycle;
+
+ p_up_out := lft z1{down}
+ .. (z1 + nw_dist){-nw}
+ -- (z3 + nw_dist){-nw}
+ .. bot z3{right}
+ .. rt z3{up}
+ -- rt z2{up}
+ .. top z2{left}
+ -- top z1{left}
+ .. {down}cycle;
+
+ p_down_in := p_up_in rotated 180 shifted (w, 0);
+ p_down_out := p_up_out rotated 180 shifted (w, 0);
+
+ charwy := 0.0;
+ charwx := charwd;
+enddef;
+
+
+fet_beginchar ("Whole fa up head", "u0fa");
+ draw_fa_head (solfa_whole_width);
+ fill p_up_out;
+ unfill p_up_in;
+fet_endchar;
+
+
+fet_beginchar ("Whole fa down head", "d0fa");
+ draw_fa_head (solfa_whole_width);
+ fill p_down_out;
+ unfill p_down_in;
+fet_endchar;
+
+
+fet_beginchar ("half fa up head", "u1fa");
+ draw_fa_head (solfa_half_width);
+ fill p_up_out;
+ unfill p_up_in;
+fet_endchar;
+
+
+fet_beginchar ("Half fa down head", "d1fa");
+ draw_fa_head (solfa_half_width);
+ fill p_down_out;
+ unfill p_down_in;
+fet_endchar;
+
+
+fet_beginchar ("Quarter fa up head", "u2fa");
+ draw_fa_head (solfa_quarter_width);
+ fill p_up_out;
+fet_endchar;
+
+
+fet_beginchar ("Quarter fa down head", "d2fa");
+ draw_fa_head (solfa_quarter_width);
+ fill p_down_out;
+fet_endchar;
+
+
+def draw_la_head (expr width_factor) =
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+ save p_in, p_out;
+ path p_in, p_out;
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ lft x1 = 0;
+ top y1 = h;
+
+ rt x2 = w;
+ y2 = y1;
+ bot y3 = -d;
+ x3 = x2;
+
+ y4 = y3;
+ x4 = x1;
+
+ labels (range 1 thru 4);
+
+ p_in := (z1 + 0.5 solfa_pen_thick * (1, -1))
+ -- (z2 + 0.5 solfa_pen_thick * (-1, -1))
+ -- (z3 + 0.5 solfa_pen_thick * (-1, 1))
+ -- (z4 + 0.5 solfa_pen_thick * (1, 1))
+ -- cycle;
+
+ p_out := top z1
+ -- top z2{right}
+ .. rt z2{down}
+ -- rt z3{down}
+ .. bot z3{left}
+ -- bot z4{left}
+ .. lft z4{up}
+ -- lft z1{up}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Whole lahead", "s0la");
+ draw_la_head (solfa_whole_width);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half lahead", "s1la");
+ draw_la_head (solfa_half_width);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Quart lahead", "s2la");
+ draw_la_head (solfa_quarter_width);
+ fill p_out;
+fet_endchar;
+
+
+def draw_ti_head (expr width_factor, dir) =
+ set_char_box (0, width_factor * solfa_base_notewidth#,
+ 0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
+ save p_in, p_out, p_top;
+ save nw_dist, sw_dist, nw, sw;
+ path p_in, p_out, p_top;
+ pair nw_dist, sw_dist, nw, sw;
+ save cone_height;
+ cone_height = 0.64;
+
+ pickup pencircle scaled solfa_pen_thick;
+
+ x1 = .5 [x2, x4];
+ bot y1 = -d;
+ lft x2 = 0;
+ y2 = cone_height [y1, y3];
+ rt x4 = w;
+ y4 = y2;
+ x3 = x1;
+ top y3 = h;
+
+ labels (range 1 thru 4);
+
+ nw = unitvector (z2 - z1);
+ sw = unitvector (z1 - z4);
+
+ nw_dist = (nw rotated 90) * 0.5 solfa_pen_thick;
+ sw_dist = (sw rotated 90) * 0.5 solfa_pen_thick;
+
+ p_top := (z2 - sw_dist)
+ .. (top z3){right}
+ .. (z4 - nw_dist);
+
+ p_in := (((z1 - nw_dist) -- (z2 - nw_dist)) intersectionpoint
+ ((z1 - sw_dist) -- (z4 - sw_dist)))
+ -- (((z1 - nw_dist) -- (z2 - nw_dist)) intersectionpoint
+ ((z2 + sw_dist) .. {right}(bot z3)))
+ .. bot z3
+ .. (((bot z3){right} .. (z4 + nw_dist)) intersectionpoint
+ ((z1 - sw_dist) -- (z4 - sw_dist)))
+ -- cycle;
+
+ p_out := bot z1
+ .. (z1 + nw_dist)
+ -- (z2 + nw_dist)
+ .. lft z2
+ .. (z2 - sw_dist){direction 0 of p_top}
+ & p_top
+ & {direction infinity of p_top}(z4 - nw_dist)
+ .. rt z4
+ .. (z4 + sw_dist)
+ -- (z1 + sw_dist)
+ .. cycle;
+
+ charwx := charwd;
+ charwy := cone_height [-chardp, charht];
+ if dir = -1:
+ charwy := -charwy;
+ fi;
+enddef;
+
+
+fet_beginchar ("Whole up tihead", "s0ti");
+ draw_ti_head (solfa_whole_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half up tihead", "u1ti");
+ draw_ti_head (solfa_half_width, 1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Half down tihead", "d1ti");
+ draw_ti_head (solfa_half_width, -1);
+ fill p_out;
+ unfill p_in;
+fet_endchar;
+
+
+fet_beginchar ("Quart up tihead", "u2ti");
+ draw_ti_head (solfa_quarter_width, 1);
+ fill p_out;
+fet_endchar;
+
+
+fet_beginchar ("Quart down tihead", "d2ti");
+ draw_ti_head (solfa_quarter_width, -1);
+ fill p_out;
+fet_endchar;
+
+
+fet_endgroup ("noteheads");
+
+
+%
+% we derive black_notehead_width# from the quarter head,
+% so we have to define black_notehead_width (pixel qty)
+% after the black_notehead_width# itself.
+%
+% Let's keep it outside the group as well.
+%
+
+define_pixels (black_notehead_width);
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- bold Orator numerals
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+height# := number_design_size;
+space# := number_design_size / 2;
+
+font_x_height height#;
+font_normal_space space#;
+
+
+%
+% DOCME!
+%
+% ugh. b and h are reused.
+%
+
+save b, h;
+4 h + b = 1.15;
+10 h + b = 1;
+fatten := number_design_size * h + b;
+
+save b, h;
+4 h + b = 1.05;
+10 h + b = 1;
+widen := number_design_size * h + b;
+
+tense = 0.85;
+thick# := 7/30 height# * fatten;
+thin# := thick# / 4 * fatten + max (.1 (height# / 10 - 1), 0);
+
+%% sqrt (.8 * blot_diameter# * thin#);
+hair# := thin# * .8;
+
+flare# := 9/8 thick# + .75 (height# / 10 - 1);
+
+save b, h;
+4h + b = 1/8;
+10h + b = 1/6;
+kuulleke# := thick# * number_design_size * h + b;
+foot_top# := thick#;
+foot_width# := 9/4 thick#;
+
+
+%
+% These numbers were taken from a part that that the EJE violas played
+% 1997 -- Probably Mendelssohn's ouverture `Heimkehr aus der Fremde'.
+%
+
+
+%
+% TODO all the invocation of flare_path are weird --
+% the horizontal tangents should be more at the center of the
+% glyph.
+%
+
+define_pixels (height, thick, thick, thin, hair, flare);
+define_pixels (foot_top, foot_width);
+define_pixels (kuulleke);
+
+
+%
+% Yet Another Bulb Routine with smooth inside curve.
+%
+% alpha = start direction.
+% beta = which side to turn to
+% flare = diameter of the bulb
+% line = diameter of line attachment
+% direction = is ink on left or right side (1 or -1)
+%
+%
+% move_away_to = amount left (for 2)
+% turn_to = amount down (for 2)
+%
+
+def number_flare_path (expr pos, alpha, beta, line, flare,
+ move_away_to, turn_to, taille, taille_ratio,
+ direction) =
+begingroup;
+ save res;
+ path res;
+
+ clearxy;
+
+% z5 = z2 + 0.43 * flare * dir (alpha - 1.5 beta);
+
+ z4 = (0.75 - taille) [z2r, z2l] + whatever * dir (alpha - beta);
+ z4 = (taille_ratio * taille) [z3l, z3r] + whatever * dir (alpha);
+
+ z1r = pos;
+ z2r = z1r + move_away_to * dir (alpha)
+ + (line + turn_to) * dir (alpha + beta);
+ z3r = 0.5 [z2l, z2r] + 0.5 * flare * dir (alpha + beta);
+
+ penpos1 (line, 180 + beta + alpha);
+ penpos2 (flare, alpha);
+ penpos3 (flare, alpha + beta);
+
+ penlabels (1, 2, 3, 4, 5);
+
+ res := z1r{dir (alpha)}
+ .. z2r{dir (180 + alpha - beta)}
+ .. z3r{dir (alpha + 180)}
+ .. z2l{dir (alpha - beta)}
+
+%%% Two versions of the curve: one with z4, the other with z5.
+% .. z5{dir (alpha - beta / 2)}
+
+ .. z4{dir (180 + alpha + beta)}
+ .. z1l{dir (alpha + 180)};
+
+% pickup pencircle;
+% draw res;
+
+ if direction <> 1:
+ res := reverse res;
+ fi;
+
+res
+endgroup
+enddef;
+
+
+def calc_kuulleke (expr w, alpha) =
+begingroup;
+ save beta, gamma;
+
+ beta = (alpha - 90) / 2;
+ gamma = (90 + alpha) / 2;
+
+ penpos1 (w / cosd (alpha), alpha);
+ penpos2 (hair, 90 + beta);
+ penpos3 (hair, gamma - 90);
+
+ z2 = z1l + (1/2 hair / tand ((alpha + 90) / 2)) * dir (beta);
+ z3 = z1r - (1/2 hair / tand ((90 - alpha) / 2)) * dir (gamma);
+ z4 = z1 + kuulleke * dir (alpha - 90);
+endgroup;
+enddef;
+
+
+% should make generic macro?
+%
+def draw_foot (expr xpos) =
+begingroup;
+ clearxy;
+
+ penpos1 (thick, 0);
+ penpos2 (foot_width, 0);
+ penpos3 (hair, -90);
+ penpos4 (hair, 90);
+
+ z1= (xpos, foot_top);
+ z2= (x1, 0);
+ z3r = z2r;
+ z4l = z2l;
+ z5 = (x1, kuulleke);
+
+ penlabels (1, 2, 3, 4);
+
+ fill z1
+ .. {right}z1r{down}
+ .. {right}z3l
+ .. z3r{left}
+ .. z5
+ .. {left}z4l
+ .. z4r{right}
+ .. {up}z1l{right}
+ .. z1
+ .. cycle;
+endgroup;
+enddef;
+
+
+def draw_six =
+ save outer_t, t;
+ save before, after, u, v;
+ path before, after;
+
+ set_char_box (0, .68 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ penpos2 (hair, 90);
+ z2 = (w / 2, h / 2 + thin - hair / 2);
+
+ penpos3 (15/16 thick, 0);
+ x3r = w;
+ y3r = .5 [y4r, y2r];
+
+ penpos4 (hair, -90);
+ z4r = (x2, 0);
+
+ penpos6 (hair, 90);
+ x6r = .56 w;
+ y6r = h;
+
+ penpos7 (thick, 180);
+ x7r = 0;
+ y7r = .50 h;
+
+ penpos10 (thick, 180);
+ z10r = (0, y3);
+
+ penlabels (range 1 thru 10);
+
+ outer_t = 0.88;
+ t := tense;
+
+ before := z7{right}
+ .. z2r{right};
+ after := z7r{up}
+ .. number_flare_path (z6r, 0, -90, hair, flare,
+ w - x6r - hair / 2, .16 h,
+ 0.05, 2.5, 1)
+ .. z7l{down};
+ (u, v) = before intersectiontimes after;
+
+% draw
+ fill subpath (u, infinity) of before
+ ..tension outer_t.. z3r{down}
+ ..tension outer_t.. z4r{left}
+ .. subpath (0, v) of after
+ .. cycle;
+
+ unfill z2l{right}
+ ..tension t.. z3l{down}
+ ..tension t.. z4l{left}
+ ..tension t.. z10l{up}
+ ..tension t.. cycle;
+enddef;
+
+
+save dot_diam;
+dot_diam# = 7/8 flare#;
+define_pixels (dot_diam);
+
+
+code := 42; % , 43
+
+fet_beginchar ("Plus", "plus");
+ set_char_box (0, .5 height#, -0.25 height#, 0.75 height#);
+
+ save hthick, vthick, size, outer_hsize, outer_vsize;
+
+ hthick# = vthick# = 2 linethickness#;
+ size# = 1.1 staff_space#;
+ define_whole_blacker_pixels (vthick);
+ define_whole_vertical_blacker_pixels (hthick);
+
+ outer_hsize = hround ((b + w - vthick) / 2);
+ outer_vsize = vround ((h + d - hthick) / 2);
+
+ centerx := hround (w / 2);
+ centery := vround ((h - d) / 2);
+
+ z1 = (centerx - hthick / 2, -d);
+ z2 = (centerx + hthick / 2, h);
+
+ labels (1, 2);
+
+ draw_rounded_block (z1, z2, hthick);
+ draw_rounded_block ((0, centery - vthick / 2),
+ (w, (centery + vthick / 2)),
+ vthick);
+fet_endchar;
+
+
+code := 43; % , = 44
+
+fet_beginchar ("Numeral comma", "comma");
+ save pat, pos;
+ path pat;
+
+ set_char_box (0, dot_diam#, 3/2 dot_diam#, dot_diam#);
+
+ pat := (dot_diam / 2, 0)
+ .. (dot_diam, dot_diam / 2)
+ .. (dot_diam / 2, dot_diam)
+ .. (0, dot_diam / 2)
+ .. cycle;
+
+ pos = ypart (((w / 3, 0) -- (w / 3, dot_diam / 2))
+ intersectiontimes pat);
+ z0 = point pos of pat;
+
+ alpha = 65;
+ penpos1 (thin, alpha + 90);
+
+ z1l = (w / 2, -1.5 h + hair);
+ z2 = (w, h / 2);
+
+ pickup feta_fillpen;
+
+ % include z0 to assist removal of overlaps
+ fill subpath (0,3) of pat
+ .. z0
+ .. cycle;
+ filldraw z1l{dir (alpha)}
+ .. {up}z2
+ -- z0{direction pos of pat}
+ ..tension 0.95.. {dir (180 + alpha)}z1r
+ .. cycle;
+
+ labels (0, 2);
+ penlabels (1);
+fet_endchar;
+
+
+fet_beginchar ("Numeral dash", "hyphen");
+ set_char_box (0, height# / 3, 0, height#);
+
+ draw_rounded_block ((-b, h / 3 - thin / 2),
+ (w, h / 3 + thin / 2), thin);
+fet_endchar;
+
+
+fet_beginchar ("Numeral dot", "period");
+ set_char_box (0, dot_diam#, 0, dot_diam#);
+
+ pickup pencircle scaled dot_diam;
+
+ drawdot (dot_diam / 2, dot_diam / 2);
+fet_endchar;
+
+
+% skip slash
+
+code := 47; % 0 = 48
+
+fet_beginchar ("Numeral 0", "zero");
+ set_char_box (0, 11/15 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ penpos1 (thin, 90);
+ penpos2 (thick, 180);
+ penpos3 (thin,- 90);
+ penpos4 (thick, 0);
+
+ z1r = (w / 2, h);
+ z2r = (0, h / 2);
+ z3r = (w / 2, 0);
+ z4r = (w, h / 2);
+
+ fill z1r
+ .. z2r
+ .. z3r
+ .. z4r
+ .. cycle;
+
+ save t;
+ t = 1 / tense;
+
+ penlabels (1, 2, 3, 4);
+
+ unfill z1l
+ ..tension t.. z2l
+ ..tension t.. z3l
+ ..tension t.. z4l
+ ..tension t.. cycle;
+fet_endchar;
+
+
+fet_beginchar ("Numeral 1", "one");
+ save alpha, beta, gamma;
+
+% set_char_box (0, 19/30 height# * widen, 0, height#);
+ set_char_box (0, 1/2 foot_width# + 3/2 thick# + 1/2 hair#,
+ 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = 0;
+ calc_kuulleke (thick, alpha);
+ z1 = (3/2 thick, height);
+
+ penpos5 (thick, 0);
+ z5 = (x1, foot_top);
+
+ z6 = (0, h / 2);
+ beta = angle (z1l - z6);
+
+ penpos7 (thin, beta - 90);
+ z7l = z6;
+
+ penpos8 (thin / cosd (beta), -90);
+ z8l = z1l;
+
+ penpos9 (thin, beta - 90);
+ z9r = z8r + (thin / cosd (beta)) * down;
+
+ penlabels (range 1 thru 9);
+
+ gamma = angle (length (z1r - z1), 2 kuulleke);
+
+ fill z2r{dir (alpha - gamma)}
+ .. z4
+ .. {dir (alpha + gamma)}z3l
+ .. z3r{down}
+ -- z5r
+ -- z5l
+ -- z2l{up}
+ .. cycle;
+
+ fill z7l
+ -- z1l{dir (beta)}
+ .. {dir (alpha - gamma)}z2r
+ -- z9r{up}
+ .. {dir (180 + beta)}z9l
+ -- z7r{dir (180 + beta)}
+ .. {dir (beta)}cycle;
+
+ draw_foot (x1);
+fet_endchar;
+
+
+fet_beginchar ("Numeral 2", "two");
+ save tolerance;
+ save alpha, beta, gamma, theta;
+ save flare_start_distance;
+ save t, pat, bow;
+ path pat, bow;
+
+ set_char_box (0, 22/30 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = -45 * widen;
+ beta = 85;
+ gamma = beta - 10;
+ theta = 20 / widen;
+
+ flare_start = 0.25;
+
+ penpos1 (hair, 90 + beta);
+ z1 = (0, 0) + (1/2 sqrt (2) * hair) * dir (45);
+
+ penpos3 (hair,90 + gamma);
+ z3 = (w, thick) + (1/2 sqrt (2) * hair) * dir (-135);
+
+ penpos2 (thick, 90 + alpha - 15);
+ x2 - x1 = x3 - x2;
+ y2 = 10/16 thick / widen;
+
+ tolerance := epsilon;
+
+ % Find proper tension to exactly touch the x axis.
+ % Later on we directly use `bow'.
+ vardef f (expr t) =
+ bow := z3l{dir (180 + gamma)}
+ ..tension t.. {dir (180 + alpha -5)}z2l;
+ ypart (directionpoint left of bow) < 0
+ enddef;
+
+ % the return value of `solve' is stored in a dummy variable
+ t = solve f (0.8, 1.2);
+
+ fill z1r{dir (beta)}
+ ..tension 0.9.. {dir (alpha + 10)}z2r
+ .. {dir (gamma)}z3r
+ .. bow
+ .. {dir (180 + beta)}z1l
+ .. cycle;
+
+ penpos4 (thick, 0);
+ z4r = (w - thin / 2, .71 h);
+
+ penpos5 (hair, 90);
+ y5r = h;
+ x5r = 9/20 w;
+
+ penlabels (range 1 thru 6);
+
+ t := tense;
+
+ pat := z1l{dir (beta)}
+ ..tension t.. z4r{up}
+ .. number_flare_path (z5r, 180, 90, hair, 1.05 flare,
+ x5r - 1/2 hair, .21 h, 0.006, 0.4, 1)
+ .. z4l{down}
+ ..tension t.. {dir (180 + beta)}z1r
+ -- cycle;
+
+% pickup pencircle scaled 1;
+% draw pat;
+
+ fill pat;
+fet_endchar;
+
+
+%%
+% TODO: should widen a bit. The right edge of the 3 bumps into next glyph in
+% combinations
+%
+fet_beginchar ("Numeral 3", "three");
+ set_char_box (0, 2/3 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ penpos1 (hair, -90);
+
+% flare_start = 0.25;
+
+ x1l = 36/80 w;
+ y1l = h;
+
+% z1l = (17/16 thick, h);
+
+ penpos2 (7/8 thick, 180);
+ x2l = w - thick / 8;
+ y2l = 3/4 h + thick * 3/32;
+
+ penpos3 (thin, 90);
+ z3 = (w / 2, h / 2 + 1/8 thick);
+
+ penpos4 (thin, 90);
+ z4 = (5/8 thick + 1/2 thin, y3);
+
+ penpos5 (thick, 0);
+ x5r = w;
+ y5r = 17/64 h + thick / 16;
+
+ penpos6 (hair, -90);
+ x6r = 37/80 w;
+ y6r = 0;
+
+ penpos7 (3/2 thin, 90);
+ x7 = .83 w;
+ y7 = y3;
+
+ penlabels (range 1 thru 7);
+
+ save alpha, t, outer_t;
+ alpha = 25;
+ t = tense;
+ outer_t := 0.93;
+
+% pickup pencircle scaled 1;
+% draw
+ fill number_flare_path (z1l, 180, 90, hair, 7/8 flare, x1l - .5 hair,
+ .16 h, 0.06, 1.5, -1)
+ ..tension outer_t.. z2l{down}
+ ..tension outer_t.. z7r{dir (180 + alpha)}
+ .. z7l{dir (-alpha)}
+ ..tension outer_t.. z5r{down}
+ ..tension outer_t.. number_flare_path (z6r, 180, -90, hair,
+ flare, x6l, .18 h, 0.06,
+ 1.5, 1)
+ .. z5l{up}
+ ..tension t.. z3l{left}
+ .. z4l{left}
+ .. z4r{right}
+ .. z3r{right}
+ ..tension t.. z2r{up}
+ ..tension t.. cycle;
+fet_endchar;
+
+
+fet_beginchar ("Numeral 4", "four");
+ save alpha, beta, gamma;
+
+ set_char_box (0, 4/5 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = 0;
+ calc_kuulleke (3/2 thick, alpha);
+
+ z1r = (w - 3/4 thick, height);
+ z5 = (thin, 1/4 height + thin);
+
+ beta = angle (z3r - z5);
+
+ penpos6 (thin, -90);
+ z6l = z5;
+
+ penpos7 (thin, -90);
+ y7 = y6;
+ x7 = w - 1/2 thin;
+
+ penpos8 (thin, -alpha);
+ z8r = z5;
+
+ penlabels (range 1 thru 8);
+
+ gamma = angle (length (z1r - z1), 2 kuulleke);
+
+ fill z2r{dir (alpha - gamma)}
+ .. z4
+ .. {dir (alpha + gamma)}z3l
+ .. {dir (180 + beta)}z3r
+ -- z8r
+ -- z7l{right}
+ .. {left}z7r
+ -- z6r{left}
+ ..tension 0.8 and 2.. z8l{dir (beta)}
+ .. {up}z2l
+ .. cycle;
+
+ clearxy;
+
+ alpha := beta;
+ calc_kuulleke (thick, alpha);
+
+ z1r = (w - 3/4 thick, height - (3/2 thin) / cosd (alpha));
+
+ penpos5 (thick, 0);
+ z5 = (x1, foot_top);
+
+ gamma := angle (length (z1r - z1), 2 kuulleke);
+
+ fill z2r{dir (alpha - gamma)}
+ .. z4
+ .. {dir (alpha + gamma)}z3l
+ .. {down}z3r
+ -- z5r
+ -- z5l
+ -- z2l{up}
+ .. cycle;
+
+ penlabels (1, 2, 3, 4, 5);
+
+ draw_foot (x5);
+fet_endchar;
+
+
+fet_beginchar ("Numeral 5", "five");
+ save alpha, beta, gamma, delta;
+ save inner_t, outer_t;
+ save pat;
+ path pat;
+
+ set_char_box (0, 27/40 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = 0;
+ calc_kuulleke (w - thin, alpha);
+
+ z1 = (w / 2 + 1/8 thick, h);
+
+ penpos5 (thin, 0);
+ z5l = (x1l, h - 15/16 thick);
+
+ penpos6 (hair, 90 - 45);
+ z6 = z5r + 1/2 hair * dir (-45);
+
+ penpos7 (thin, 0);
+ z7l = (x1l, h / 2 + thin - hair);
+
+ penlabels (range 1 thru 7);
+
+ gamma = angle (length (z1r - z1), 2 kuulleke);
+
+ pat := z2r{dir (alpha - gamma)}
+ .. z4
+ .. {dir (alpha + gamma)}z3l
+ .. z3r{dir (-135)}
+ .. {left}z6r
+ .. {down}z6l
+ -- z7r{down}
+ .. {up}z7l
+ -- z2l{up}
+ .. cycle;
+
+ beta = 45;
+ delta = 180 + beta + 10;
+ z8r = (x7r, y7r - 1/16 thick + thin);
+ z8l = directionpoint dir (delta) of
+ subpath (6, 7) of pat;
+
+ % include intersection point to improve overlap removal
+ fill subpath (0, 6) of pat
+ .. z8l
+ .. subpath (7, length (pat)) of pat
+ .. cycle;
+
+ penpos9 (thin, 90);
+ y9 = 10/16 [y5, y7];
+ x9 = .36 [x8r, x10r];
+
+ penpos10 (thick, 0);
+ x10r = w + hair / 2;
+ y10r = 1/2 [y9r, y11r];
+
+ penpos11 (hair, -90);
+ y11r = 0;
+ x11r = .7 [0, x10l];
+
+ penlabels (range 8 thru 12);
+
+ inner_t = 1.0;
+ outer_t = .85;
+
+ fill z8r {dir (beta)}
+ .. z9r{right}
+ ..tension outer_t.. z10r{down}
+ .. number_flare_path (z11r, 180, -90, hair, flare, x11l,
+ .18 h, 0.06, 1.5, 1)
+ .. z11l{right}
+ ..tension inner_t.. z10l{up}
+ ..tension inner_t.. z9l{left}
+ .. z8l{dir (delta)}
+ -- cycle;
+fet_endchar;
+
+
+fet_beginchar ("Numeral 6", "six");
+ draw_six;
+fet_endchar;
+
+
+fet_beginchar ("Numeral 7", "seven");
+ save tolerance;
+ save alpha, beta, gamma, delta;
+ save bow;
+ save x_overshoot;
+
+ path bow;
+
+ set_char_box (0, 11/15 height# * widen - thin#, 0, height#);
+ overshoot_x = .75 thin;
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = -180;
+
+ penpos1 (3/2 thick, 180 + alpha);
+ penpos2 (hair, 180 + alpha - 45);
+ penpos3 (hair, 180 + alpha + 45);
+
+ z2 = z1l + (1/4 sqrt (2) * hair) * dir (alpha - 135);
+ z3 = z1r + (1/4 sqrt (2) * hair) * dir (alpha - 45);
+ z4 = z1 + kuulleke * dir (alpha - 90);
+
+ z1l = (thin, 0);
+
+ beta = 55;
+ penpos5 (thin, 90 + beta);
+ z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135) + (overshoot_x, 0);
+
+ gamma = angle (length (z1r - z1), 2 kuulleke);
+ delta = 12;
+
+ pickup pencircle;
+
+ fill z3l{dir (alpha - gamma)}
+ .. z4
+ .. {dir (alpha + gamma)}z2r
+ .. z2l{dir (beta + delta)}
+ .. {dir (beta)}z5r
+ .. z5l{dir (180 + beta)}
+ .. {dir (delta - 90)}z3r
+ .. cycle;
+
+ penlabels (1, 2, 3, 4, 5);
+
+ alpha := -45 * widen;
+
+ penpos11 (1/2 thick, 90);
+ z11 = (3/2 thin, h - (thick + thin) / 2);
+
+ penpos13 (thin, 90 + beta);
+ z13 = z5;
+
+ penpos12 (thick, 90 + alpha);
+ x12 = 1/2 [x11, x13] - 1/4 thick;
+ y12 = h - 15/16 thick + thin * widen;
+
+ penpos14 (thin, 0);
+ z14l = (0, h - thin / 2);
+
+ penpos15 (thin, 0);
+ z15l = (0, h / 2 + thin / 2);
+
+ penpos16 (9/8 thick, 90);
+ z16r = (thin, y11r + 2/16 thick);
+
+ tolerance := epsilon;
+
+ % Find proper tension to exactly touch the x axis.
+ % Later on we directly use `bow'.
+ vardef f (expr t) =
+ bow := z11r{dir (beta)}
+ ..tension t.. {dir (alpha)}z12r;
+ ypart (directionpoint right of bow) > h
+ enddef;
+
+ % the return value of `solve' is stored in a dummy variable
+ t = solve f (0.8, 1.2);
+
+ fill bow
+ .. {dir (beta)}z13r
+ -- z13l{dir (180 + beta)}
+ .. {dir (180 + alpha)}z12l
+ .. {dir (180 + beta)}z11l
+ .. {down}z16l
+ -- z15r{down}
+ .. {up}z15l
+ -- z14l{up}
+ .. {down}z14r
+ -- z16r{down}
+ ..tension 1.5.. {dir (beta)}cycle;
+
+ penlabels (range 11 thru 16);
+fet_endchar;
+
+
+fet_beginchar ("Numeral 8", "eight");
+ save alpha, beta;
+
+ set_char_box (0, 11/15 height# * widen, 0, height#);
+
+ message "w:" & decimal w;
+ message "h:" & decimal h;
+
+ alpha = 60;
+ beta = alpha - 15;
+
+ z1 = (w / 2, h / 2 + thick / 8);
+
+ penpos2 (14/8 thin, 0);
+ z2 = (w / 3, h / 2 + thin);
+
+ penpos3 (3/2 thin, 0);
+ z3l = (0, h / 4 + thin / 2);
+
+ penpos4 (hair, 90);
+ z4l = (x1, 0);
+
+ penpos5 (thick, 90 + 90 + alpha);
+ z5 = z1 + w / 4 * dir (alpha - 90);
+
+ penpos6 (thick, 90 + 90 + alpha);
+ z6 = z1 + (w / 4 - thin / 2) * dir (90 + alpha);
+
+ penpos7 (hair, 90);
+ z7r = (x1 + .02 w, h);
+
+ penpos8 (3/2 thin, 0);
+ z8r = (w - thin / 2, 3/4 h + thin / 2);
+
+ penpos9 (13/8 thin, 0);
+ z9 = (2/3 w, h / 2);
+
+ penlabels (range 1 thru 9);
+
+ save t;
+ t = tense;
+
+ fill z2r{dir (180 + beta)}
+ .. z3r{down}
+ .. z4r{right}
+ .. z5r{dir (90 + alpha)}
+ -- z6r{dir (90 + alpha)}
+ ..tension t.. z7r{right}
+ .. z8r{down}
+ .. {dir (180 + beta)}z9r
+ -- z9l{dir (beta)}
+ .. z8l{up}
+ .. z7l{left}
+ .. {dir (alpha - 90)}z6l
+ -- z5l{dir (alpha - 90)}
+ ..tension t.. z4l{left}
+ .. z3l{up}
+ .. {dir (beta)}z2l
+ -- cycle;
+fet_endchar;
+
+
+fet_beginchar ("Numeral 9", "nine");
+ draw_six;
+% xy_mirror_char;
+
+ currentpicture := currentpicture scaled -1;
+ currentpicture := currentpicture shifted (w, h);
+fet_endchar;
+
+
+ligtable "3":
+ "3" kern 0.1 space#,
+ "0" kern 0.1 space#;
+
+ligtable "2":
+ "7" kern 0.15 space#;
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- bold Orator numerals
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-height# := number_design_size;
-space# := number_design_size / 2;
-
-font_x_height height#;
-font_normal_space space#;
-
-
-%
-% DOCME!
-%
-% ugh. b and h are reused.
-%
-
-save b, h;
-4 h + b = 1.15;
-10 h + b = 1;
-fatten := number_design_size * h + b;
-
-save b, h;
-4 h + b = 1.05;
-10 h + b = 1;
-widen := number_design_size * h + b;
-
-tense = 0.85;
-thick# := 7/30 height# * fatten;
-thin# := thick# / 4 * fatten + max (.1 (height# / 10 - 1), 0);
-
-%% sqrt (.8 * blot_diameter# * thin#);
-hair# := thin# * .8;
-
-flare# := 9/8 thick# + .75 (height# / 10 - 1);
-
-save b, h;
-4h + b = 1/8;
-10h + b = 1/6;
-kuulleke# := thick# * number_design_size * h + b;
-foot_top# := thick#;
-foot_width# := 9/4 thick#;
-
-
-%
-% These numbers were taken from a part that that the EJE violas played
-% 1997 -- Probably Mendelssohn's ouverture `Heimkehr aus der Fremde'.
-%
-
-
-%
-% TODO all the invocation of flare_path are weird --
-% the horizontal tangents should be more at the center of the
-% glyph.
-%
-
-define_pixels (height, thick, thick, thin, hair, flare);
-define_pixels (foot_top, foot_width);
-define_pixels (kuulleke);
-
-
-%
-% Yet Another Bulb Routine with smooth inside curve.
-%
-% alpha = start direction.
-% beta = which side to turn to
-% flare = diameter of the bulb
-% line = diameter of line attachment
-% direction = is ink on left or right side (1 or -1)
-%
-%
-% move_away_to = amount left (for 2)
-% turn_to = amount down (for 2)
-%
-
-def number_flare_path (expr pos, alpha, beta, line, flare,
- move_away_to, turn_to, taille, taille_ratio,
- direction) =
-begingroup;
- save res;
- path res;
-
- clearxy;
-
-% z5 = z2 + 0.43 * flare * dir (alpha - 1.5 beta);
-
- z4 = (0.75 - taille) [z2r, z2l] + whatever * dir (alpha - beta);
- z4 = (taille_ratio * taille) [z3l, z3r] + whatever * dir (alpha);
-
- z1r = pos;
- z2r = z1r + move_away_to * dir (alpha)
- + (line + turn_to) * dir (alpha + beta);
- z3r = 0.5 [z2l, z2r] + 0.5 * flare * dir (alpha + beta);
-
- penpos1 (line, 180 + beta + alpha);
- penpos2 (flare, alpha);
- penpos3 (flare, alpha + beta);
-
- penlabels (1, 2, 3, 4, 5);
-
- res := z1r{dir (alpha)}
- .. z2r{dir (180 + alpha - beta)}
- .. z3r{dir (alpha + 180)}
- .. z2l{dir (alpha - beta)}
-
-%%% Two versions of the curve: one with z4, the other with z5.
-% .. z5{dir (alpha - beta / 2)}
-
- .. z4{dir (180 + alpha + beta)}
- .. z1l{dir (alpha + 180)};
-
-% pickup pencircle;
-% draw res;
-
- if direction <> 1:
- res := reverse res;
- fi;
-
-res
-endgroup
-enddef;
-
-
-def calc_kuulleke (expr w, alpha) =
-begingroup;
- save beta, gamma;
-
- beta = (alpha - 90) / 2;
- gamma = (90 + alpha) / 2;
-
- penpos1 (w / cosd (alpha), alpha);
- penpos2 (hair, 90 + beta);
- penpos3 (hair, gamma - 90);
-
- z2 = z1l + (1/2 hair / tand ((alpha + 90) / 2)) * dir (beta);
- z3 = z1r - (1/2 hair / tand ((90 - alpha) / 2)) * dir (gamma);
- z4 = z1 + kuulleke * dir (alpha - 90);
-endgroup;
-enddef;
-
-
-% should make generic macro?
-%
-def draw_foot (expr xpos) =
-begingroup;
- clearxy;
-
- penpos1 (thick, 0);
- penpos2 (foot_width, 0);
- penpos3 (hair, -90);
- penpos4 (hair, 90);
-
- z1= (xpos, foot_top);
- z2= (x1, 0);
- z3r = z2r;
- z4l = z2l;
- z5 = (x1, kuulleke);
-
- penlabels (1, 2, 3, 4);
-
- fill z1
- .. {right}z1r{down}
- .. {right}z3l
- .. z3r{left}
- .. z5
- .. {left}z4l
- .. z4r{right}
- .. {up}z1l{right}
- .. z1
- .. cycle;
-endgroup;
-enddef;
-
-
-def draw_six =
- save outer_t, t;
- save before, after, u, v;
- path before, after;
-
- set_char_box (0, .68 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- penpos2 (hair, 90);
- z2 = (w / 2, h / 2 + thin - hair / 2);
-
- penpos3 (15/16 thick, 0);
- x3r = w;
- y3r = .5 [y4r, y2r];
-
- penpos4 (hair, -90);
- z4r = (x2, 0);
-
- penpos6 (hair, 90);
- x6r = .56 w;
- y6r = h;
-
- penpos7 (thick, 180);
- x7r = 0;
- y7r = .50 h;
-
- penpos10 (thick, 180);
- z10r = (0, y3);
-
- penlabels (range 1 thru 10);
-
- outer_t = 0.88;
- t := tense;
-
- before := z7{right}
- .. z2r{right};
- after := z7r{up}
- .. number_flare_path (z6r, 0, -90, hair, flare,
- w - x6r - hair / 2, .16 h,
- 0.05, 2.5, 1)
- .. z7l{down};
- (u, v) = before intersectiontimes after;
-
-% draw
- fill subpath (u, infinity) of before
- ..tension outer_t.. z3r{down}
- ..tension outer_t.. z4r{left}
- .. subpath (0, v) of after
- .. cycle;
-
- unfill z2l{right}
- ..tension t.. z3l{down}
- ..tension t.. z4l{left}
- ..tension t.. z10l{up}
- ..tension t.. cycle;
-enddef;
-
-
-save dot_diam;
-dot_diam# = 7/8 flare#;
-define_pixels (dot_diam);
-
-
-code := 42; % , 43
-
-fet_beginchar ("Plus", "plus");
- set_char_box (0, .5 height#, -0.25 height#, 0.75 height#);
-
- save hthick, vthick, size, outer_hsize, outer_vsize;
-
- hthick# = vthick# = 2 linethickness#;
- size# = 1.1 staff_space#;
- define_whole_blacker_pixels (vthick);
- define_whole_vertical_blacker_pixels (hthick);
-
- outer_hsize = hround ((b + w - vthick) / 2);
- outer_vsize = vround ((h + d - hthick) / 2);
-
- centerx := hround (w / 2);
- centery := vround ((h - d) / 2);
-
- z1 = (centerx - hthick / 2, -d);
- z2 = (centerx + hthick / 2, h);
-
- labels (1, 2);
-
- draw_rounded_block (z1, z2, hthick);
- draw_rounded_block ((0, centery - vthick / 2),
- (w, (centery + vthick / 2)),
- vthick);
-fet_endchar;
-
-
-code := 43; % , = 44
-
-fet_beginchar ("Numeral comma", "comma");
- save pat, pos;
- path pat;
-
- set_char_box (0, dot_diam#, 3/2 dot_diam#, dot_diam#);
-
- pat := (dot_diam / 2, 0)
- .. (dot_diam, dot_diam / 2)
- .. (dot_diam / 2, dot_diam)
- .. (0, dot_diam / 2)
- .. cycle;
-
- pos = ypart (((w / 3, 0) -- (w / 3, dot_diam / 2))
- intersectiontimes pat);
- z0 = point pos of pat;
-
- alpha = 65;
- penpos1 (thin, alpha + 90);
-
- z1l = (w / 2, -1.5 h + hair);
- z2 = (w, h / 2);
-
- pickup feta_fillpen;
-
- % include z0 to assist removal of overlaps
- fill subpath (0,3) of pat
- .. z0
- .. cycle;
- filldraw z1l{dir (alpha)}
- .. {up}z2
- -- z0{direction pos of pat}
- ..tension 0.95.. {dir (180 + alpha)}z1r
- .. cycle;
-
- labels (0, 2);
- penlabels (1);
-fet_endchar;
-
-
-fet_beginchar ("Numeral dash", "hyphen");
- set_char_box (0, height# / 3, 0, height#);
-
- draw_rounded_block ((-b, h / 3 - thin / 2),
- (w, h / 3 + thin / 2), thin);
-fet_endchar;
-
-
-fet_beginchar ("Numeral dot", "period");
- set_char_box (0, dot_diam#, 0, dot_diam#);
-
- pickup pencircle scaled dot_diam;
-
- drawdot (dot_diam / 2, dot_diam / 2);
-fet_endchar;
-
-
-% skip slash
-
-code := 47; % 0 = 48
-
-fet_beginchar ("Numeral 0", "zero");
- set_char_box (0, 11/15 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- penpos1 (thin, 90);
- penpos2 (thick, 180);
- penpos3 (thin,- 90);
- penpos4 (thick, 0);
-
- z1r = (w / 2, h);
- z2r = (0, h / 2);
- z3r = (w / 2, 0);
- z4r = (w, h / 2);
-
- fill z1r
- .. z2r
- .. z3r
- .. z4r
- .. cycle;
-
- save t;
- t = 1 / tense;
-
- penlabels (1, 2, 3, 4);
-
- unfill z1l
- ..tension t.. z2l
- ..tension t.. z3l
- ..tension t.. z4l
- ..tension t.. cycle;
-fet_endchar;
-
-
-fet_beginchar ("Numeral 1", "one");
- save alpha, beta, gamma;
-
-% set_char_box (0, 19/30 height# * widen, 0, height#);
- set_char_box (0, 1/2 foot_width# + 3/2 thick# + 1/2 hair#,
- 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = 0;
- calc_kuulleke (thick, alpha);
- z1 = (3/2 thick, height);
-
- penpos5 (thick, 0);
- z5 = (x1, foot_top);
-
- z6 = (0, h / 2);
- beta = angle (z1l - z6);
-
- penpos7 (thin, beta - 90);
- z7l = z6;
-
- penpos8 (thin / cosd (beta), -90);
- z8l = z1l;
-
- penpos9 (thin, beta - 90);
- z9r = z8r + (thin / cosd (beta)) * down;
-
- penlabels (range 1 thru 9);
-
- gamma = angle (length (z1r - z1), 2 kuulleke);
-
- fill z2r{dir (alpha - gamma)}
- .. z4
- .. {dir (alpha + gamma)}z3l
- .. z3r{down}
- -- z5r
- -- z5l
- -- z2l{up}
- .. cycle;
-
- fill z7l
- -- z1l{dir (beta)}
- .. {dir (alpha - gamma)}z2r
- -- z9r{up}
- .. {dir (180 + beta)}z9l
- -- z7r{dir (180 + beta)}
- .. {dir (beta)}cycle;
-
- draw_foot (x1);
-fet_endchar;
-
-
-fet_beginchar ("Numeral 2", "two");
- save tolerance;
- save alpha, beta, gamma, theta;
- save flare_start_distance;
- save t, pat, bow;
- path pat, bow;
-
- set_char_box (0, 22/30 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = -45 * widen;
- beta = 85;
- gamma = beta - 10;
- theta = 20 / widen;
-
- flare_start = 0.25;
-
- penpos1 (hair, 90 + beta);
- z1 = (0, 0) + (1/2 sqrt (2) * hair) * dir (45);
-
- penpos3 (hair,90 + gamma);
- z3 = (w, thick) + (1/2 sqrt (2) * hair) * dir (-135);
-
- penpos2 (thick, 90 + alpha - 15);
- x2 - x1 = x3 - x2;
- y2 = 10/16 thick / widen;
-
- tolerance := epsilon;
-
- % Find proper tension to exactly touch the x axis.
- % Later on we directly use `bow'.
- vardef f (expr t) =
- bow := z3l{dir (180 + gamma)}
- ..tension t.. {dir (180 + alpha -5)}z2l;
- ypart (directionpoint left of bow) < 0
- enddef;
-
- % the return value of `solve' is stored in a dummy variable
- t = solve f (0.8, 1.2);
-
- fill z1r{dir (beta)}
- ..tension 0.9.. {dir (alpha + 10)}z2r
- .. {dir (gamma)}z3r
- .. bow
- .. {dir (180 + beta)}z1l
- .. cycle;
-
- penpos4 (thick, 0);
- z4r = (w - thin / 2, .71 h);
-
- penpos5 (hair, 90);
- y5r = h;
- x5r = 9/20 w;
-
- penlabels (range 1 thru 6);
-
- t := tense;
-
- pat := z1l{dir (beta)}
- ..tension t.. z4r{up}
- .. number_flare_path (z5r, 180, 90, hair, 1.05 flare,
- x5r - 1/2 hair, .21 h, 0.006, 0.4, 1)
- .. z4l{down}
- ..tension t.. {dir (180 + beta)}z1r
- -- cycle;
-
-% pickup pencircle scaled 1;
-% draw pat;
-
- fill pat;
-fet_endchar;
-
-
-%%
-% TODO: should widen a bit. The right edge of the 3 bumps into next glyph in
-% combinations
-%
-fet_beginchar ("Numeral 3", "three");
- set_char_box (0, 2/3 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- penpos1 (hair, -90);
-
-% flare_start = 0.25;
-
- x1l = 36/80 w;
- y1l = h;
-
-% z1l = (17/16 thick, h);
-
- penpos2 (7/8 thick, 180);
- x2l = w - thick / 8;
- y2l = 3/4 h + thick * 3/32;
-
- penpos3 (thin, 90);
- z3 = (w / 2, h / 2 + 1/8 thick);
-
- penpos4 (thin, 90);
- z4 = (5/8 thick + 1/2 thin, y3);
-
- penpos5 (thick, 0);
- x5r = w;
- y5r = 17/64 h + thick / 16;
-
- penpos6 (hair, -90);
- x6r = 37/80 w;
- y6r = 0;
-
- penpos7 (3/2 thin, 90);
- x7 = .83 w;
- y7 = y3;
-
- penlabels (range 1 thru 7);
-
- save alpha, t, outer_t;
- alpha = 25;
- t = tense;
- outer_t := 0.93;
-
-% pickup pencircle scaled 1;
-% draw
- fill number_flare_path (z1l, 180, 90, hair, 7/8 flare, x1l - .5 hair,
- .16 h, 0.06, 1.5, -1)
- ..tension outer_t.. z2l{down}
- ..tension outer_t.. z7r{dir (180 + alpha)}
- .. z7l{dir (-alpha)}
- ..tension outer_t.. z5r{down}
- ..tension outer_t.. number_flare_path (z6r, 180, -90, hair,
- flare, x6l, .18 h, 0.06,
- 1.5, 1)
- .. z5l{up}
- ..tension t.. z3l{left}
- .. z4l{left}
- .. z4r{right}
- .. z3r{right}
- ..tension t.. z2r{up}
- ..tension t.. cycle;
-fet_endchar;
-
-
-fet_beginchar ("Numeral 4", "four");
- save alpha, beta, gamma;
-
- set_char_box (0, 4/5 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = 0;
- calc_kuulleke (3/2 thick, alpha);
-
- z1r = (w - 3/4 thick, height);
- z5 = (thin, 1/4 height + thin);
-
- beta = angle (z3r - z5);
-
- penpos6 (thin, -90);
- z6l = z5;
-
- penpos7 (thin, -90);
- y7 = y6;
- x7 = w - 1/2 thin;
-
- penpos8 (thin, -alpha);
- z8r = z5;
-
- penlabels (range 1 thru 8);
-
- gamma = angle (length (z1r - z1), 2 kuulleke);
-
- fill z2r{dir (alpha - gamma)}
- .. z4
- .. {dir (alpha + gamma)}z3l
- .. {dir (180 + beta)}z3r
- -- z8r
- -- z7l{right}
- .. {left}z7r
- -- z6r{left}
- ..tension 0.8 and 2.. z8l{dir (beta)}
- .. {up}z2l
- .. cycle;
-
- clearxy;
-
- alpha := beta;
- calc_kuulleke (thick, alpha);
-
- z1r = (w - 3/4 thick, height - (3/2 thin) / cosd (alpha));
-
- penpos5 (thick, 0);
- z5 = (x1, foot_top);
-
- gamma := angle (length (z1r - z1), 2 kuulleke);
-
- fill z2r{dir (alpha - gamma)}
- .. z4
- .. {dir (alpha + gamma)}z3l
- .. {down}z3r
- -- z5r
- -- z5l
- -- z2l{up}
- .. cycle;
-
- penlabels (1, 2, 3, 4, 5);
-
- draw_foot (x5);
-fet_endchar;
-
-
-fet_beginchar ("Numeral 5", "five");
- save alpha, beta, gamma, delta;
- save inner_t, outer_t;
- save pat;
- path pat;
-
- set_char_box (0, 27/40 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = 0;
- calc_kuulleke (w - thin, alpha);
-
- z1 = (w / 2 + 1/8 thick, h);
-
- penpos5 (thin, 0);
- z5l = (x1l, h - 15/16 thick);
-
- penpos6 (hair, 90 - 45);
- z6 = z5r + 1/2 hair * dir (-45);
-
- penpos7 (thin, 0);
- z7l = (x1l, h / 2 + thin - hair);
-
- penlabels (range 1 thru 7);
-
- gamma = angle (length (z1r - z1), 2 kuulleke);
-
- pat := z2r{dir (alpha - gamma)}
- .. z4
- .. {dir (alpha + gamma)}z3l
- .. z3r{dir (-135)}
- .. {left}z6r
- .. {down}z6l
- -- z7r{down}
- .. {up}z7l
- -- z2l{up}
- .. cycle;
-
- beta = 45;
- delta = 180 + beta + 10;
- z8r = (x7r, y7r - 1/16 thick + thin);
- z8l = directionpoint dir (delta) of
- subpath (6, 7) of pat;
-
- % include intersection point to improve overlap removal
- fill subpath (0, 6) of pat
- .. z8l
- .. subpath (7, length (pat)) of pat
- .. cycle;
-
- penpos9 (thin, 90);
- y9 = 10/16 [y5, y7];
- x9 = .36 [x8r, x10r];
-
- penpos10 (thick, 0);
- x10r = w + hair / 2;
- y10r = 1/2 [y9r, y11r];
-
- penpos11 (hair, -90);
- y11r = 0;
- x11r = .7 [0, x10l];
-
- penlabels (range 8 thru 12);
-
- inner_t = 1.0;
- outer_t = .85;
-
- fill z8r {dir (beta)}
- .. z9r{right}
- ..tension outer_t.. z10r{down}
- .. number_flare_path (z11r, 180, -90, hair, flare, x11l,
- .18 h, 0.06, 1.5, 1)
- .. z11l{right}
- ..tension inner_t.. z10l{up}
- ..tension inner_t.. z9l{left}
- .. z8l{dir (delta)}
- -- cycle;
-fet_endchar;
-
-
-fet_beginchar ("Numeral 6", "six");
- draw_six;
-fet_endchar;
-
-
-fet_beginchar ("Numeral 7", "seven");
- save tolerance;
- save alpha, beta, gamma, delta;
- save bow;
- save x_overshoot;
-
- path bow;
-
- set_char_box (0, 11/15 height# * widen - thin#, 0, height#);
- overshoot_x = .75 thin;
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = -180;
-
- penpos1 (3/2 thick, 180 + alpha);
- penpos2 (hair, 180 + alpha - 45);
- penpos3 (hair, 180 + alpha + 45);
-
- z2 = z1l + (1/4 sqrt (2) * hair) * dir (alpha - 135);
- z3 = z1r + (1/4 sqrt (2) * hair) * dir (alpha - 45);
- z4 = z1 + kuulleke * dir (alpha - 90);
-
- z1l = (thin, 0);
-
- beta = 55;
- penpos5 (thin, 90 + beta);
- z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135) + (overshoot_x, 0);
-
- gamma = angle (length (z1r - z1), 2 kuulleke);
- delta = 12;
-
- pickup pencircle;
-
- fill z3l{dir (alpha - gamma)}
- .. z4
- .. {dir (alpha + gamma)}z2r
- .. z2l{dir (beta + delta)}
- .. {dir (beta)}z5r
- .. z5l{dir (180 + beta)}
- .. {dir (delta - 90)}z3r
- .. cycle;
-
- penlabels (1, 2, 3, 4, 5);
-
- alpha := -45 * widen;
-
- penpos11 (1/2 thick, 90);
- z11 = (3/2 thin, h - (thick + thin) / 2);
-
- penpos13 (thin, 90 + beta);
- z13 = z5;
-
- penpos12 (thick, 90 + alpha);
- x12 = 1/2 [x11, x13] - 1/4 thick;
- y12 = h - 15/16 thick + thin * widen;
-
- penpos14 (thin, 0);
- z14l = (0, h - thin / 2);
-
- penpos15 (thin, 0);
- z15l = (0, h / 2 + thin / 2);
-
- penpos16 (9/8 thick, 90);
- z16r = (thin, y11r + 2/16 thick);
-
- tolerance := epsilon;
-
- % Find proper tension to exactly touch the x axis.
- % Later on we directly use `bow'.
- vardef f (expr t) =
- bow := z11r{dir (beta)}
- ..tension t.. {dir (alpha)}z12r;
- ypart (directionpoint right of bow) > h
- enddef;
-
- % the return value of `solve' is stored in a dummy variable
- t = solve f (0.8, 1.2);
-
- fill bow
- .. {dir (beta)}z13r
- -- z13l{dir (180 + beta)}
- .. {dir (180 + alpha)}z12l
- .. {dir (180 + beta)}z11l
- .. {down}z16l
- -- z15r{down}
- .. {up}z15l
- -- z14l{up}
- .. {down}z14r
- -- z16r{down}
- ..tension 1.5.. {dir (beta)}cycle;
-
- penlabels (range 11 thru 16);
-fet_endchar;
-
-
-fet_beginchar ("Numeral 8", "eight");
- save alpha, beta;
-
- set_char_box (0, 11/15 height# * widen, 0, height#);
-
- message "w:" & decimal w;
- message "h:" & decimal h;
-
- alpha = 60;
- beta = alpha - 15;
-
- z1 = (w / 2, h / 2 + thick / 8);
-
- penpos2 (14/8 thin, 0);
- z2 = (w / 3, h / 2 + thin);
-
- penpos3 (3/2 thin, 0);
- z3l = (0, h / 4 + thin / 2);
-
- penpos4 (hair, 90);
- z4l = (x1, 0);
-
- penpos5 (thick, 90 + 90 + alpha);
- z5 = z1 + w / 4 * dir (alpha - 90);
-
- penpos6 (thick, 90 + 90 + alpha);
- z6 = z1 + (w / 4 - thin / 2) * dir (90 + alpha);
-
- penpos7 (hair, 90);
- z7r = (x1 + .02 w, h);
-
- penpos8 (3/2 thin, 0);
- z8r = (w - thin / 2, 3/4 h + thin / 2);
-
- penpos9 (13/8 thin, 0);
- z9 = (2/3 w, h / 2);
-
- penlabels (range 1 thru 9);
-
- save t;
- t = tense;
-
- fill z2r{dir (180 + beta)}
- .. z3r{down}
- .. z4r{right}
- .. z5r{dir (90 + alpha)}
- -- z6r{dir (90 + alpha)}
- ..tension t.. z7r{right}
- .. z8r{down}
- .. {dir (180 + beta)}z9r
- -- z9l{dir (beta)}
- .. z8l{up}
- .. z7l{left}
- .. {dir (alpha - 90)}z6l
- -- z5l{dir (alpha - 90)}
- ..tension t.. z4l{left}
- .. z3l{up}
- .. {dir (beta)}z2l
- -- cycle;
-fet_endchar;
-
-
-fet_beginchar ("Numeral 9", "nine");
- draw_six;
-% xy_mirror_char;
-
- currentpicture := currentpicture scaled -1;
- currentpicture := currentpicture shifted (w, h);
-fet_endchar;
-
-
-ligtable "3":
- "3" kern 0.1 space#,
- "0" kern 0.1 space#;
-
-ligtable "2":
- "7" kern 0.15 space#;
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- piano pedal markings
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+%
+% Voor Cup
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+% Kerning
+%
+% Pe = -0.034 pedalh == -0.07 staff-space
+% ed = -0.27 pedalh == -0.53 staff-space
+
+
+fet_begingroup ("pedal");
+
+pedalpha = 40;
+pedbeta = 25;
+
+penh# = 0.7 linethickness#;
+penw# = 2 penh# + 0.14 staff_space#;
+define_pixels (penh, penw);
+
+pedalh# = 2 staff_space#;
+pedalbh# = 4/7 pedalh#;
+define_pixels (pedalh, pedalbh);
+
+
+fet_beginchar ("Pedal asterisk", "*");
+ save bulb, p, radius, thin, inner_r;
+ path pat;
+
+ set_char_box (0, 7/9 pedalh#, 0, 7/9 pedalh#);
+
+ z0 = (1/2 w, h - 1/2 w);
+
+ thin = 0.8 linethickness;
+
+ bulb + 2 radius = w;
+ 0.9 thin + bulb = (radius * pi * 2) / 8;
+
+ pickup pencircle scaled penh;
+
+ penpos1 (bulb, 180);
+ penpos2 (bulb, 0);
+ penpos3 (thin, 0);
+
+ z1 = z0 + (0, radius);
+ z2 = z1;
+
+ inner_r = .45 radius;
+
+ z4l = z0 + inner_r * dir (90 + 360/16);
+ z4r = z0 + inner_r * dir (90 - 360/16);
+
+ z4 = .5 [z4l, z4r];
+ z3 = .75 [z1, z4];
+
+ penlabels (0, 1, 2, 3, 4);
+
+ pat := z3r{up}
+ .. z1l{up}
+ .. z2l{down}
+ .. z3l{down}
+ .. z4l{dir (180 + 360/16)};
+ for i = 1 upto 7:
+ pat := pat
+ .. ((z3r{up}
+ .. z1l{up}
+ .. z2l{down}
+ .. z3l{down}
+ .. z4l{dir (180 + 360/16)})
+ rotatedaround (z0, 360/8 i));
+ endfor;
+
+ pat := pat
+ .. cycle;
+ fill pat;
+
+ pickup pencircle scaled (7/8 inner_r);
+
+ undrawdot z0;
+fet_endchar;
+
+
+%% ugh. rounded corners!
+
+fet_beginchar ("Pedal dash", "M");
+ save dash_thickness;
+
+ dash_thickness# := penw#;
+ define_whole_vertical_blacker_pixels (dash_thickness);
+
+ set_char_box (0, 3 penw#, 0, pedalbh#);
+
+ penpos1 (dash_thickness, 60);
+ penpos2 (dash_thickness, 60);
+
+ z1l = (0, vround (2/3 h - 1/2 penw));
+ z2r = (w, vround (y1l + 1.2 penw));
+
+ penlabels (1, 2, 3);
+
+ penstroke z1e{dir 40}
+ ..tension 1.2.. z2e{dir 40};
+fet_endchar;
+
+
+fet_beginchar ("Pedal dot", ".");
+ set_char_box (0, penw#, 0, penw#);
+
+ pickup pencircle scaled penw;
+
+ drawdot (hround (1/2 penw), vround (1/2 penw));
+fet_endchar;
+
+
+def draw_pedal_P (expr show_labels) =
+begingroup;
+ clearxy;
+
+ penpos1 (hround penh, 0);
+ penpos2 (penw, 55);
+ penpos3 (penw, pedalpha);
+ penpos4 (1.2 penh, -pedalpha);
+ penpos5 (penh, -pedalpha);
+ penpos6 (penh, 180 - pedalpha);
+ penpos7 (penh, 180 - pedalpha);
+ penpos8 (penh, 90);
+ penpos9 (4/3 penw, 50);
+ penpos10 (1.4 penw, 50);
+ penpos11 (penh, 90 + pedalpha);
+
+ z1r = (hround 0.6 w, h);
+ x2l = hround (x1l - penw) + xpart feta_offset;
+ y2 = vround (0.7 h) + ypart feta_offset;
+ x3r = hround (x2l + 2 penw);
+ y3r = 0.4 h;
+ z4l = z5r + 1/4 (z3r - z5r);
+ x5 = 1/4 w;
+ y5r = 0;
+ z6 = z5;
+ z7l = z6r + 1/3 (z8r - z6r);
+ z8r = z5r + 3/5 (z3r - z5r);
+ x9l = x10l - penh;
+ y9l = 1/4 penh;
+ x10l = w - tand (90 - pedalpha) * y11l;
+ y10l = 1/4 penh;
+ x11l = w;
+ y11 = 1/5 h;
+
+ % don't stick out at the top
+ z1' = round (0.9 [z2, z1]) + (xpart feta_offset, 0);
+ penpos1' (penh, 0);
+
+ % shift start point of pen stroke to avoid overlapping contours
+ z8'l = z8l;
+ y8'r = y8r;
+ z8'r = z8l + whatever * (z3r - z8l);
+
+ penpos12 (hround penh, 0);
+ penpos13 (penw, -90 - pedbeta);
+ penpos14 (vround penh, 90);
+ penpos15 (penw, -90 + pedbeta);
+ penpos16 (penh, 180 + pedbeta);
+
+ z12r = (hround (5/9 x1 + 1/2 hround penh), y2);
+ z13l = (1/2 x12r, y15r);
+ z14r = z1r;
+ z15l = (1/2 [x16, w], y2l + 0.5 penw);
+ x16 = 1/4 [x1, w];
+ y16r = y2r;
+
+ % We now do a correction to `center' the stem horizontally. While
+ % this is not the most elegant solution, it is definitely the
+ % easiest...
+
+ save horz_corr;
+ horz_corr = 1/5 [x12, x16] - x2l;
+ x2 := x2 + horz_corr;
+ x2l := x2l + horz_corr;
+ x2r := x2r + horz_corr;
+
+ penstroke z1'e
+ ..tension 2.5.. z2e
+ ..tension 1.5.. z3e
+ ..tension 2.5.. {dir (225)}z4e;
+
+ soft_end_penstroke z8'e{right}
+ ..tension 1.5.. z9e{dir (-pedalpha)}
+ .. z10e
+ ..tension 2.5.. z11e;
+
+ fill z4r{dir (225)}
+ ..tension 1.5.. z5r{left}
+ .. z6r
+ ..tension 1.5.. z7r
+ ..tension 1.5.. z8r{right}
+ -- cycle;
+
+ soft_penstroke z12e{down}
+ ..tension 1.1.. z13e{dir (180 - pedbeta)}
+ ..tension 1.1.. z14e{right}
+ ..tension 1.1.. z15e{dir (180 + pedbeta)}
+ ..tension 1.1.. z16e{dir (90 + pedbeta)};
+
+ if show_labels = 1:
+ penlabels (range 1 thru 16);
+ penlabels (1', 8');
+ fi;
+endgroup;
+enddef;
+
+
+def draw_pedal_d (expr show_labels) =
+begingroup;
+ clearxy;
+
+ penpos1 (vround penh, -10 - 90);
+ penpos2 (hround penw, 190);
+ penpos3 (vround (2 penh), 90);
+ penpos4 (hround (3/4 penw), 0);
+ penpos5 (penh, -70);
+
+ x1r = 0;
+ y1l = h;
+ z2 = (w - 1/2 hround penw, 1/2 pedalbh + penh);
+ z4l = (hround (1/3 w), 1/2 pedalbh);
+ z5l = (2/3 w, pedalbh);
+ z3l = (hround x5l, 0);
+
+ if show_labels = 1:
+ penlabels (1, 2, 3, 4, 5);
+ fi;
+
+ soft_start_penstroke z1e{dir (-10)}
+ ..tension 1.1.. z2e{dir (-90 + 10)}
+ ..tension 1.1.. z3e{left}
+ ..tension 1.1.. z4e{up}
+ ..tension 1.1.. z5e{dir (-70 + 90)};
+endgroup;
+enddef;
+
+
+def draw_pedal_e (expr show_labels) =
+begingroup;
+ clearxy;
+
+ penpos1 (penh, pedalpha - 90);
+ penpos2 (penh, pedalpha - 90);
+ penpos3 (3/5 penw, pedalpha);
+ penpos4 (1.2 penh, 90 + pedalpha);
+ penpos5 (2/3 penw, 180);
+ penpos6 (penw, 180 + pedalpha);
+ penpos7 (2/3 penw, -90 - 20);
+ penpos8 (penh, pedalpha - 90);
+
+ z1l = (0, 1/5 pedalh);
+ % this helps to make the path go through z2 at low resolutions
+ z2 = round (z1 + dir pedalpha * penw) + feta_offset;
+ z3 = (3/5 w, 8/9 h);
+ z4 = (2/9 w, y3);
+ x4r := hround x4r;
+ x5r = 0;
+ y5 = y2;
+ x6 = 3/8 w;
+ y6r = 1/2 penh;
+ z7l = (x6l + penh, y6l);
+ x8r = w;
+ y8 = 1/5 pedalh;
+
+ soft_penstroke z1e
+ -- z2e{z2 - z1}
+ ..tension 1.1.. z3e
+ ..tension 1.05.. z4e
+ ..tension 1.1.. z5e
+ ..tension 1.5.. z6e{dir - pedalpha}
+ ..tension 1.1.. z7e
+ ..tension 2.5.. z8e;
+
+ if show_labels = 1:
+ penlabels (range 1 thru 8);
+ fi;
+endgroup;
+enddef;
+
+
+fet_beginchar ("Pedal P", "P");
+ set_char_box (0, 5/6 pedalh#, 0, pedalh#);
+
+ draw_pedal_P (1);
+fet_endchar;
+
+
+fet_beginchar ("Pedal d", "d");
+ set_char_box (0, 2/3 pedalh#, 0, 7/8 pedalh#);
+
+ draw_pedal_d (1);
+fet_endchar;
+
+
+fet_beginchar ("Pedal e", "e");
+ set_char_box (0, 2/5 pedalh#, 0, pedalbh#);
+
+ draw_pedal_e (1);
+fet_endchar;
+
+
+fet_beginchar ("Pedal Ped", "Ped");
+ P_width# = 5/6 pedalh#;
+ e_width# = 2/5 pedalh#;
+ d_width# = 2/3 pedalh#;
+ define_pixels (P_width, e_width, d_width);
+
+ e_height = pedalbh;
+ d_height = 7/8 pedalh;
+
+ % Pe = -0.034 pedalh == -0.07 staff-space
+ % ed = -0.27 pedalh == -0.53 staff-space
+ Pe_kern# = -0.034 pedalh#;
+ ed_kern# = -0.27 pedalh#;
+ define_pixels (Pe_kern, ed_kern);
+
+ w := hround d_width;
+ h := vround d_height;
+ draw_pedal_d (0);
+ currentpicture := currentpicture
+ shifted (hround (e_width + ed_kern), 0);
+
+ w := hround e_width;
+ h := vround e_height;
+ draw_pedal_e (0);
+ currentpicture := currentpicture
+ shifted (hround (P_width + Pe_kern), 0);
+
+ w := hround P_width;
+ h := vround pedalh;
+ draw_pedal_P (0);
+
+ set_char_box (0, P_width# + Pe_kern# + e_width# + ed_kern# + d_width#,
+ 0, pedalh#);
+fet_endchar;
+
+
+fet_endgroup ("pedal");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- piano pedal markings
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 2000--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-% Voor Cup
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-% Kerning
-%
-% Pe = -0.034 pedalh == -0.07 staff-space
-% ed = -0.27 pedalh == -0.53 staff-space
-
-
-fet_begingroup ("pedal");
-
-pedalpha = 40;
-pedbeta = 25;
-
-penh# = 0.7 linethickness#;
-penw# = 2 penh# + 0.14 staff_space#;
-define_pixels (penh, penw);
-
-pedalh# = 2 staff_space#;
-pedalbh# = 4/7 pedalh#;
-define_pixels (pedalh, pedalbh);
-
-
-fet_beginchar ("Pedal asterisk", "*");
- save bulb, p, radius, thin, inner_r;
- path pat;
-
- set_char_box (0, 7/9 pedalh#, 0, 7/9 pedalh#);
-
- z0 = (1/2 w, h - 1/2 w);
-
- thin = 0.8 linethickness;
-
- bulb + 2 radius = w;
- 0.9 thin + bulb = (radius * pi * 2) / 8;
-
- pickup pencircle scaled penh;
-
- penpos1 (bulb, 180);
- penpos2 (bulb, 0);
- penpos3 (thin, 0);
-
- z1 = z0 + (0, radius);
- z2 = z1;
-
- inner_r = .45 radius;
-
- z4l = z0 + inner_r * dir (90 + 360/16);
- z4r = z0 + inner_r * dir (90 - 360/16);
-
- z4 = .5 [z4l, z4r];
- z3 = .75 [z1, z4];
-
- penlabels (0, 1, 2, 3, 4);
-
- pat := z3r{up}
- .. z1l{up}
- .. z2l{down}
- .. z3l{down}
- .. z4l{dir (180 + 360/16)};
- for i = 1 upto 7:
- pat := pat
- .. ((z3r{up}
- .. z1l{up}
- .. z2l{down}
- .. z3l{down}
- .. z4l{dir (180 + 360/16)})
- rotatedaround (z0, 360/8 i));
- endfor;
-
- pat := pat
- .. cycle;
- fill pat;
-
- pickup pencircle scaled (7/8 inner_r);
-
- undrawdot z0;
-fet_endchar;
-
-
-%% ugh. rounded corners!
-
-fet_beginchar ("Pedal dash", "M");
- save dash_thickness;
-
- dash_thickness# := penw#;
- define_whole_vertical_blacker_pixels (dash_thickness);
-
- set_char_box (0, 3 penw#, 0, pedalbh#);
-
- penpos1 (dash_thickness, 60);
- penpos2 (dash_thickness, 60);
-
- z1l = (0, vround (2/3 h - 1/2 penw));
- z2r = (w, vround (y1l + 1.2 penw));
-
- penlabels (1, 2, 3);
-
- penstroke z1e{dir 40}
- ..tension 1.2.. z2e{dir 40};
-fet_endchar;
-
-
-fet_beginchar ("Pedal dot", ".");
- set_char_box (0, penw#, 0, penw#);
-
- pickup pencircle scaled penw;
-
- drawdot (hround (1/2 penw), vround (1/2 penw));
-fet_endchar;
-
-
-def draw_pedal_P (expr show_labels) =
-begingroup;
- clearxy;
-
- penpos1 (hround penh, 0);
- penpos2 (penw, 55);
- penpos3 (penw, pedalpha);
- penpos4 (1.2 penh, -pedalpha);
- penpos5 (penh, -pedalpha);
- penpos6 (penh, 180 - pedalpha);
- penpos7 (penh, 180 - pedalpha);
- penpos8 (penh, 90);
- penpos9 (4/3 penw, 50);
- penpos10 (1.4 penw, 50);
- penpos11 (penh, 90 + pedalpha);
-
- z1r = (hround 0.6 w, h);
- x2l = hround (x1l - penw) + xpart feta_offset;
- y2 = vround (0.7 h) + ypart feta_offset;
- x3r = hround (x2l + 2 penw);
- y3r = 0.4 h;
- z4l = z5r + 1/4 (z3r - z5r);
- x5 = 1/4 w;
- y5r = 0;
- z6 = z5;
- z7l = z6r + 1/3 (z8r - z6r);
- z8r = z5r + 3/5 (z3r - z5r);
- x9l = x10l - penh;
- y9l = 1/4 penh;
- x10l = w - tand (90 - pedalpha) * y11l;
- y10l = 1/4 penh;
- x11l = w;
- y11 = 1/5 h;
-
- % don't stick out at the top
- z1' = round (0.9 [z2, z1]) + (xpart feta_offset, 0);
- penpos1' (penh, 0);
-
- % shift start point of pen stroke to avoid overlapping contours
- z8'l = z8l;
- y8'r = y8r;
- z8'r = z8l + whatever * (z3r - z8l);
-
- penpos12 (hround penh, 0);
- penpos13 (penw, -90 - pedbeta);
- penpos14 (vround penh, 90);
- penpos15 (penw, -90 + pedbeta);
- penpos16 (penh, 180 + pedbeta);
-
- z12r = (hround (5/9 x1 + 1/2 hround penh), y2);
- z13l = (1/2 x12r, y15r);
- z14r = z1r;
- z15l = (1/2 [x16, w], y2l + 0.5 penw);
- x16 = 1/4 [x1, w];
- y16r = y2r;
-
- % We now do a correction to `center' the stem horizontally. While
- % this is not the most elegant solution, it is definitely the
- % easiest...
-
- save horz_corr;
- horz_corr = 1/5 [x12, x16] - x2l;
- x2 := x2 + horz_corr;
- x2l := x2l + horz_corr;
- x2r := x2r + horz_corr;
-
- penstroke z1'e
- ..tension 2.5.. z2e
- ..tension 1.5.. z3e
- ..tension 2.5.. {dir (225)}z4e;
-
- soft_end_penstroke z8'e{right}
- ..tension 1.5.. z9e{dir (-pedalpha)}
- .. z10e
- ..tension 2.5.. z11e;
-
- fill z4r{dir (225)}
- ..tension 1.5.. z5r{left}
- .. z6r
- ..tension 1.5.. z7r
- ..tension 1.5.. z8r{right}
- -- cycle;
-
- soft_penstroke z12e{down}
- ..tension 1.1.. z13e{dir (180 - pedbeta)}
- ..tension 1.1.. z14e{right}
- ..tension 1.1.. z15e{dir (180 + pedbeta)}
- ..tension 1.1.. z16e{dir (90 + pedbeta)};
-
- if show_labels = 1:
- penlabels (range 1 thru 16);
- penlabels (1', 8');
- fi;
-endgroup;
-enddef;
-
-
-def draw_pedal_d (expr show_labels) =
-begingroup;
- clearxy;
-
- penpos1 (vround penh, -10 - 90);
- penpos2 (hround penw, 190);
- penpos3 (vround (2 penh), 90);
- penpos4 (hround (3/4 penw), 0);
- penpos5 (penh, -70);
-
- x1r = 0;
- y1l = h;
- z2 = (w - 1/2 hround penw, 1/2 pedalbh + penh);
- z4l = (hround (1/3 w), 1/2 pedalbh);
- z5l = (2/3 w, pedalbh);
- z3l = (hround x5l, 0);
-
- if show_labels = 1:
- penlabels (1, 2, 3, 4, 5);
- fi;
-
- soft_start_penstroke z1e{dir (-10)}
- ..tension 1.1.. z2e{dir (-90 + 10)}
- ..tension 1.1.. z3e{left}
- ..tension 1.1.. z4e{up}
- ..tension 1.1.. z5e{dir (-70 + 90)};
-endgroup;
-enddef;
-
-
-def draw_pedal_e (expr show_labels) =
-begingroup;
- clearxy;
-
- penpos1 (penh, pedalpha - 90);
- penpos2 (penh, pedalpha - 90);
- penpos3 (3/5 penw, pedalpha);
- penpos4 (1.2 penh, 90 + pedalpha);
- penpos5 (2/3 penw, 180);
- penpos6 (penw, 180 + pedalpha);
- penpos7 (2/3 penw, -90 - 20);
- penpos8 (penh, pedalpha - 90);
-
- z1l = (0, 1/5 pedalh);
- % this helps to make the path go through z2 at low resolutions
- z2 = round (z1 + dir pedalpha * penw) + feta_offset;
- z3 = (3/5 w, 8/9 h);
- z4 = (2/9 w, y3);
- x4r := hround x4r;
- x5r = 0;
- y5 = y2;
- x6 = 3/8 w;
- y6r = 1/2 penh;
- z7l = (x6l + penh, y6l);
- x8r = w;
- y8 = 1/5 pedalh;
-
- soft_penstroke z1e
- -- z2e{z2 - z1}
- ..tension 1.1.. z3e
- ..tension 1.05.. z4e
- ..tension 1.1.. z5e
- ..tension 1.5.. z6e{dir - pedalpha}
- ..tension 1.1.. z7e
- ..tension 2.5.. z8e;
-
- if show_labels = 1:
- penlabels (range 1 thru 8);
- fi;
-endgroup;
-enddef;
-
-
-fet_beginchar ("Pedal P", "P");
- set_char_box (0, 5/6 pedalh#, 0, pedalh#);
-
- draw_pedal_P (1);
-fet_endchar;
-
-
-fet_beginchar ("Pedal d", "d");
- set_char_box (0, 2/3 pedalh#, 0, 7/8 pedalh#);
-
- draw_pedal_d (1);
-fet_endchar;
-
-
-fet_beginchar ("Pedal e", "e");
- set_char_box (0, 2/5 pedalh#, 0, pedalbh#);
-
- draw_pedal_e (1);
-fet_endchar;
-
-
-fet_beginchar ("Pedal Ped", "Ped");
- P_width# = 5/6 pedalh#;
- e_width# = 2/5 pedalh#;
- d_width# = 2/3 pedalh#;
- define_pixels (P_width, e_width, d_width);
-
- e_height = pedalbh;
- d_height = 7/8 pedalh;
-
- % Pe = -0.034 pedalh == -0.07 staff-space
- % ed = -0.27 pedalh == -0.53 staff-space
- Pe_kern# = -0.034 pedalh#;
- ed_kern# = -0.27 pedalh#;
- define_pixels (Pe_kern, ed_kern);
-
- w := hround d_width;
- h := vround d_height;
- draw_pedal_d (0);
- currentpicture := currentpicture
- shifted (hround (e_width + ed_kern), 0);
-
- w := hround e_width;
- h := vround e_height;
- draw_pedal_e (0);
- currentpicture := currentpicture
- shifted (hround (P_width + Pe_kern), 0);
-
- w := hround P_width;
- h := vround pedalh;
- draw_pedal_P (0);
-
- set_char_box (0, P_width# + Pe_kern# + e_width# + ed_kern# + d_width#,
- 0, pedalh#);
-fet_endchar;
-
-
-fet_endgroup ("pedal");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- a duration dot
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("dots");
-
-save dot_diam;
-
-2 dot_diam# = staff_space# - stafflinethickness#;
-define_whole_blacker_pixels (dot_diam);
-
-fet_beginchar ("duration dot", "dot");
- pickup pencircle scaled dot_diam;
-
- lft x0 = 0;
- top y0 = vround (.5 dot_diam);
-
- drawdot z0;
-
- set_char_box (0, dot_diam#, .5 dot_diam#, .5 dot_diam#);
-fet_endchar;
-
-fet_endgroup ("dots");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- rest symbols -*-Fundamental-*-
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("rests");
+
+save block_rest_y, block_rest_x;
+save breve_rest_y, breve_rest_x;
+
+breve_rest_y# = staff_space#;
+breve_rest_x# = 3/5 staff_space#;
+block_rest_y# = 5/8 staff_space#;
+block_rest_x# = 3/2 staff_space#;
+
+define_whole_pixels (block_rest_y, block_rest_x);
+define_whole_pixels (breve_rest_y, breve_rest_x);
+
+
+def block_rest =
+ draw_block ((0, 0), (block_rest_x, block_rest_y));
+enddef;
+
+
+fet_beginchar ("whole rest", "0");
+ set_char_box (0, block_rest_x#,
+ block_rest_y#, 0);
+
+ block_rest;
+ currentpicture := currentpicture
+ shifted (0, -block_rest_y + feta_space_shift);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("half rest", "1");
+ set_char_box (0, block_rest_x#, 0, block_rest_y#);
+
+ block_rest;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+%
+% should use ledgerline thickness?
+%
+fet_beginchar ("whole rest (outside staff)", "0o");
+ set_char_box (0, block_rest_x#,
+ block_rest_y#, ledgerlinethickness# / 2);
+
+ block_rest;
+ currentpicture := currentpicture shifted (0, -block_rest_y);
+
+ pickup pencircle scaled ledgerlinethickness;
+
+ y5 = y6 = 0;
+ lft x5 = -b - block_rest_y;
+ rt x6 = w + block_rest_y;
+ draw_gridline (z5, z6, ledgerlinethickness_rounded);
+
+ draw_staff (-2, 2, -3);
+fet_endchar;
+
+
+fet_beginchar ("half rest (outside staff)", "1o");
+ set_char_box (0, block_rest_x#,
+ ledgerlinethickness# / 2, block_rest_y#);
+
+ block_rest;
+
+ pickup pencircle scaled ledgerlinethickness;
+
+ y5 = y6 = 0;
+ lft x5 = -b - block_rest_y;
+ rt x6 = w + block_rest_y;
+
+ draw_gridline (z5, z6, ledgerlinethickness_rounded);
+
+ draw_staff (-2, 2, 3);
+fet_endchar;
+
+
+fet_beginchar ("maxima rest", "M3");
+ set_char_box (0, 3 breve_rest_x#, breve_rest_y#, breve_rest_y#);
+
+ draw_block ((0, -breve_rest_y + feta_shift),
+ (breve_rest_x, breve_rest_y));
+
+ addto currentpicture also currentpicture shifted (2 breve_rest_x, 0);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("longa rest", "M2");
+ set_char_box (0, breve_rest_x#, breve_rest_y#, breve_rest_y#);
+
+ draw_block ((0, -breve_rest_y + feta_shift),
+ (breve_rest_x, breve_rest_y));
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("breve rest", "M1");
+ set_char_box (0, breve_rest_x#, 0, breve_rest_y#);
+
+ draw_block ((0, 0), (breve_rest_x, breve_rest_y));
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("Quarter rest", "2");
+ save alpha, yshift, height;
+ save xcenter;
+
+ yshift# := -1.25 staff_space#;
+ height# := 2.8125 staff_space#;
+ define_pixels (yshift, height);
+
+ alpha := -50;
+ thick := 1/4 staff_space;
+ rthin := 1.25 linethickness;
+ xcenter := -0.1 staff_space;
+ rthick := 2 thick + rthin;
+
+ set_char_box (0, 0.95 staff_space#, -yshift#, yshift# + height#);
+
+ save ne, nw, se, sw;
+ pair ne, nw, se, sw;
+
+ se = dir alpha;
+ ne = dir (alpha + 90);
+ nw = dir (alpha + 180);
+ sw = dir (alpha + 270);
+
+ penpos1 (rthin, alpha + 90);
+ penpos2 (5/4 rthick, alpha);
+ penpos4 (5/4 rthick, alpha);
+ penpos5 (rthin, alpha + 90);
+ penpos3 (3/4 rthick, alpha);
+% penpos6 (5/8 rthick, alpha);
+ penpos6 (2/3 rthick, alpha);
+ penpos7 (1/2 rthin, alpha + 90);
+
+ z10 = z2l + 1/2 rthin * sw;
+% z11 = z4l + 1/2 rthin * sw;
+ z11 = z4l + 1/2 rthin * sw + 1/2 rthin * se;
+ z12 = z4r + 1/2 rthin * ne;
+% z13 = z2r + 1/2 rthin * ne;
+ z13 = z2r + 1/2 rthin * ne + 1/2 rthin * nw;
+
+ y1r = h;
+ x1l = xcenter + 1/3 staff_space;
+ z2r = z1 + staff_space * se;
+ z3 = 1/2 [z2, z4];
+ x4 = xcenter + 3/8 staff_space;
+ y4 = 0;
+ y4l := vround y4l;
+ z5 = round (z4l + 1.3 staff_space * se) + feta_offset;
+ x6l = x4l;
+ y6l = vround y4r;
+ x6r := hround x6r + xpart feta_offset;
+ y6r := vround y6r + ypart feta_offset;
+ x7 = hround (xcenter + 2/5 staff_space) + xpart feta_offset;
+ y7 = -d;
+
+ save before, after;
+ path before, after;
+ before = z11{se}
+ .. {se}z5l;
+ after = z5r{nw}
+ ..tension1.4.. z6l;
+ (u, v) = before intersectiontimes after;
+
+ fill z1l{se}
+ .. {se}z10
+ .. z3l
+ .. subpath (0, u) of before
+ .. subpath (v, infinity) of after
+ ..tension1.4.. {se}z7l
+ .. z7r{nw}
+ ..tension1.4.. z6r
+ ..tension1.4.. {se}z5l
+ .. z5r{nw}
+ .. {nw}z12
+ .. z3r
+ .. z13{nw}
+ .. {nw}z1r
+ .. cycle;
+
+ penlabels (1, 2, 3, 4, 5, 6, 7);
+ penlabels (10, 11, 12, 13);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+%
+% Notes about 8th rest:
+%
+% * 8th rest should be no wider than the black note head
+%
+% * The inside corner of the horizontal portion is usually a little blotted.
+%
+% * The top of the crook chops off the vertical brush
+%
+% * The crook widens a little
+%
+% * The bottom of the brush is slightly flat, as it has to align with
+% stafflines if it is inside the staff.
+%
+% * The top of the brush usually is a little lower than the top of bulb.
+%
+% * The bulb can vary. Sometimes it is open (like in the clefs). Sometimes
+% it is closed, or even a flare.
+%
+
+% from an email to Rune Zedeler:
+%
+%
+% For example, the 8th rest was vaguely based on a book with trumpet
+% studies by Duhem, and by Baerenreiters cello suites. I included my
+% findings in a comment in the mf file. One of the things that I tried
+% to do was make the rest a little lighter and narrower than the black
+% note head. I think this looks better in polyphonic music, when the
+% rest is below a head from a different voice.
+%
+
+save bulb_diam, thin, thick;
+
+bulb_diam# := 0.64 staff_space#;
+thin# := 1.4 linethickness# - 0.02 staff_space#;
+thick# := 2.2 linethickness#;
+
+crook_thin := 0.5 linethickness + 0.08 staff_space;
+lower_brush := 1.5 linethickness;
+
+define_pixels (bulb_diam);
+define_whole_blacker_pixels (thin, thick);
+
+
+%
+% PAT is a compact way to pass the brush shape to the routine.
+%
+
+def draw_rest_bulb (expr ycenter, ycut, pat, stretch, show_labels) =
+begingroup;
+ save x, y, pt, res;
+
+ z1l = point 0 of pat;
+ z2l = point 1 of pat;
+ z2r = point 3 of pat;
+ z1r = point 4 of pat;
+ z1 = 0.5 [z1l, z1r];
+ z2 = 0.5 [z2l, z2r];
+ y10 = ycenter;
+ z10 = whatever [z2, z1] + left * bulb_diam * stretch;
+
+ % this enforces similar bulb shapes for lower resolutions
+ x10 := hround x10;
+
+ z3 = z10 + bulb_diam / 2.15 * dir (-72);
+ y3 := hround y3;
+ z5 = z10 + up * bulb_diam / 2 + right * linethickness / 3;
+ y5 := hround y5;
+
+ z7 = 0.5 [z4, z5] + crook_thin * (0.45, 0.4) / 1.3;
+ x8 = hround (x10 - 0.4 bulb_diam);
+ y8 = y10 + 0.25 linethickness;
+
+ z6 = whatever [z1l, z2l];
+ z6 = z3 + whatever * dir (12);
+
+ z4 = z3 + whatever * (z6 - z3)
+ + 1.1 crook_thin * (unitvector (z6 - z3) rotated 90);
+ x4 = x10 + bulb_diam * .62;
+ y4 := vround y4;
+
+ (pt, whatever) = pat intersectiontimes ((0, ycut) -- (w, ycut));
+
+ path res;
+ res = point pt of pat {-direction pt of pat}
+ ..tension 2.. z4{left}
+ ..tension 0.9.. z7
+ .. z5{left}
+ .. z8
+ .. z3{right}
+ .. {curl 0.2}z6;
+
+ if show_labels = 1:
+ labels (3, 4, 5, 6, 7, 8, 10);
+ fi;
+
+res
+endgroup;
+enddef;
+
+
+def draw_eighth_rest (expr show_labels) =
+ save ycenter;
+ save pat, bulb;
+ path pat, bulb;
+
+ set_char_box (0, 1.0 staff_space#,
+ 1.0 staff_space# + 0.5 linethickness#,
+ 0.5 staff_space# + bulb_diam# / 2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = -staff_space_rounded;
+ y2 = h - vround lower_brush;
+ x2r = w;
+ z2 = z1 + whatever * dir (72);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
+ y9 := vround y9;
+
+ x1l := hround x1l;
+ x1r := hround x1r;
+ x1 := .5 [x1l, x1r];
+
+ if show_labels = 1:
+ penlabels (1, 2);
+ labels (9);
+ fi;
+
+ pat = z1l
+ -- z2l
+ .. z9
+ .. z2r
+ -- z1r
+ .. cycle;
+ bulb = draw_rest_bulb (0.5 staff_space, y2r, pat, 1.0, show_labels);
+
+ fill simple_serif (z1l, z1r, 40)
+ -- z2r
+ .. z9
+ .. bulb
+ -- z1l
+ .. cycle;
+
+ draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Classical quarter rest", "2classical");
+ draw_eighth_rest (0);
+ currentpicture := currentpicture xscaled -1 shifted (w, 0);
+fet_endchar;
+
+
+fet_beginchar ("8th rest", "3");
+ draw_eighth_rest (1);
+fet_endchar;
+
+
+%
+% TODO: the X dimensions of the rests are fucked up:
+% they can collide with augmentation dots.
+%
+
+fet_beginchar ("16th rest", "4");
+ save ycenter;
+ save pat, bulb_a, bulb_b;
+ path pat, bulb_a, bulb_b;
+
+ set_char_box (0, 1.2 staff_space#,
+ 2.0 staff_space# + 0.5 linethickness#,
+ 0.5 staff_space# + bulb_diam# / 2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = -2 staff_space_rounded;
+ y2 = h - vround lower_brush;
+ x2r = w;
+ z2 = z1 + whatever * dir (74);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
+ y9 := vround y9;
+
+ x1l := hround x1l;
+ x1r := hround x1r;
+ x1 := .5 [x1l, x1r];
+
+ pat = z1l
+ -- z2l
+ .. z9
+ .. z2r
+ -- z1r
+ .. cycle;
+ bulb_a = draw_rest_bulb (.5 staff_space,
+ y2r, pat, 0.98, 1);
+ bulb_b = draw_rest_bulb (.5 staff_space - staff_space_rounded,
+ hround ((-0.5 + 0.2) * staff_space),
+ pat, 1.02, 1);
+
+ fill simple_serif (z1l, z1r, 40)
+ -- z2r
+ .. z9
+ .. bulb_a
+ -- bulb_b
+ -- z1l
+ .. cycle;
+
+ penlabels (1, 2);
+ labels (9);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("32th rest", "5");
+ save ycenter;
+ save pat, bulb_a, bulb_b, bulb_c;
+ path pat, bulb_a, bulb_b, bulb_c;
+
+ set_char_box (0, 1.3 staff_space#,
+ 2.0 staff_space# + 0.5 linethickness#,
+ 1.5 staff_space# + bulb_diam# / 2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = -2 staff_space_rounded;
+ y2 = h - vround lower_brush;
+ x2r = w;
+ z2 = z1 + whatever * dir (76);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
+ y9 := vround y9;
+
+ x1l := hround x1l;
+ x1r := hround x1r;
+ x1 := .5 [x1l, x1r];
+
+ pat = z1l
+ -- z2l
+ .. z9
+ .. z2r
+ -- z1r
+ .. cycle;
+ bulb_a = draw_rest_bulb (.5 staff_space + staff_space_rounded,
+ y2r, pat, 0.96, 1);
+ bulb_b = draw_rest_bulb (.5 staff_space,
+ hround ((0.5 + 0.2) * staff_space),
+ pat, 1.00, 1);
+ bulb_c = draw_rest_bulb (.5 staff_space - staff_space_rounded,
+ hround ((-0.5 + 0.21) * staff_space),
+ pat, 1.04, 1);
+
+ fill simple_serif (z1l, z1r, 40)
+ -- z2r
+ .. z9
+ .. bulb_a
+ -- bulb_b
+ -- bulb_c
+ -- z1l
+ .. cycle;
+
+ penlabels (1, 2);
+ labels (9);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("64th rest", "6");
+ save ycenter;
+ save pat, bulb_a, bulb_b, bulb_c, bulb_d;
+ path pat, bulb_a, bulb_b, bulb_c, bulb_d;
+
+ set_char_box (0, 1.4 staff_space#,
+ 3.0 staff_space# + 0.5 linethickness#,
+ 1.5 staff_space# + bulb_diam# / 2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = -3 staff_space_rounded;
+ y2 = h - vround lower_brush;
+ x2r = w;
+ z2 = z1 + whatever * dir (78);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1) - 10);
+ y9 := vround y9;
+
+ x1l := hround x1l;
+ x1r := hround x1r;
+ x1 := .5 [x1l, x1r];
+
+ pat = z1l
+ -- z2l
+ .. z9
+ .. z2r
+ -- z1r
+ .. cycle;
+ bulb_a = draw_rest_bulb (.5 staff_space + staff_space_rounded,
+ y2r, pat, 0.94, 1);
+ bulb_b = draw_rest_bulb (.5 staff_space,
+ hround ((0.5 + 0.20) * staff_space),
+ pat, 0.98, 1);
+ bulb_c = draw_rest_bulb (.5 staff_space - staff_space_rounded,
+ hround ((-0.5 + 0.21) * staff_space),
+ pat, 1.02, 1);
+ bulb_d = draw_rest_bulb (.5 staff_space - 2 staff_space_rounded,
+ hround ((-1.5 + 0.22) * staff_space),
+ pat, 1.06, 1);
+
+ fill simple_serif (z1l, z1r, 40)
+ -- z2r
+ .. z9
+ .. bulb_a
+ -- bulb_b
+ -- bulb_c
+ -- bulb_d
+ -- z1l
+ .. cycle;
+
+ penlabels (1, 2);
+ labels (9);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_beginchar ("128th rest", "7");
+ save ycenter;
+ save pat, bulb_a, bulb_b, bulb_c, bulb_d, bulb_e;
+ path pat, bulb_a, bulb_b, bulb_c, bulb_d, bulb_e;
+
+ set_char_box (0, 1.5 staff_space#,
+ 3.0 staff_space# + 0.5 linethickness#,
+ 2.5 staff_space# + bulb_diam# / 2);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 10);
+
+ y1 = -3 staff_space_rounded;
+ y2 = h - vround lower_brush;
+ x2r = w;
+ z2 = z1 + whatever * dir (80);
+ z9 = z2 + 0.5 linethickness * dir (angle (z2 - z1)- 10);
+ y9 := vround y9;
+
+ x1l := hround x1l;
+ x1r := hround x1r;
+ x1 := .5 [x1l, x1r];
+
+ pat = z1l
+ -- z2l
+ .. z9
+ .. z2r
+ -- z1r
+ .. cycle;
+ bulb_a = draw_rest_bulb (.5 staff_space + 2 staff_space_rounded,
+ y2r, pat, 0.92, 1);
+ bulb_b = draw_rest_bulb (.5 staff_space + staff_space_rounded,
+ hround ((1.5 + 0.20) * staff_space),
+ pat, 0.96, 1);
+ bulb_c = draw_rest_bulb (.5 staff_space,
+ hround ((0.5 + 0.21) * staff_space),
+ pat, 1.0, 1);
+ bulb_d = draw_rest_bulb (.5 staff_space - staff_space_rounded,
+ hround ((-0.5 + 0.22) * staff_space),
+ pat, 1.04, 1);
+ bulb_e = draw_rest_bulb (.5 staff_space - 2 staff_space_rounded,
+ hround ((-1.5 + 0.23) * staff_space),
+ pat, 1.08, 1);
+
+ fill simple_serif (z1l, z1r, 40)
+ -- z2r
+ .. z9
+ .. bulb_a
+ -- bulb_b
+ -- bulb_c
+ -- bulb_d
+ -- bulb_e
+ -- z1l
+ .. cycle;
+
+ penlabels (1, 2);
+ labels (9);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+fet_endgroup ("rests");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- implement scripts
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-% Jan Nieuwenhuizen <janneke@gnu.org>
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-fet_begingroup ("scripts");
-
-def draw_fermata =
- save alpha, radius, crook_thinness, crook_fatness, dot_size;
- save pat;
- path pat;
-
- % [Wanske] and some Baerenreiter editions
- % suggest about 80 degrees instead of a half-circle
- alpha := 10;
-
- radius# = 1.25 staff_space#;
- crook_thinness# = 1.5 linethickness#;
- crook_fatness# = 0.25 staff_space# + 1.5 linethickness#;
-
- radius# + crook_fatness# / 2 = h#;
- radius# + crook_thinness# / 2 = w#;
-
- set_char_box (w#, w#, crook_thinness# / 2, h#);
-
- define_pixels (radius, crook_thinness, crook_fatness);
-
- dot_size# = 8/6 crook_fatness#;
- define_whole_blacker_pixels (dot_size);
-
- penpos1 (crook_thinness, 0);
- penpos2 (crook_fatness, -90);
- z1 = (-radius, 0);
- z2 = (0, radius);
-
- pat := z2l{left}
- .. z1l{dir (-alpha - 90)}
- .. {dir (90 - alpha)}z1r
- .. {right}z2r;
- pat := pat
- -- reverse pat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
- fill pat;
-
- pickup pencircle scaled dot_size;
- x4 = 0;
- bot y4 = vround (-crook_thinness / 2);
- drawdot z4;
-enddef;
-
-
-fet_beginchar ("fermata up", "ufermata");
- draw_fermata;
- penlabels (1, 2, 4);
-fet_endchar;
-
-
-fet_beginchar ("fermata down", "dfermata");
- draw_fermata;
- y_mirror_char;
-fet_endchar;
-
-
-def draw_short_fermata =
- save fat_factor, thinness, dot_size;
- save left_dist, right_dist, se, ne;
- pair left_dist, right_dist, se, ne;
-
- set_char_box (staff_space#, staff_space#, 0, 2.2 staff_space#);
-
- dot_size# = 0.266 staff_space# + 2.666 linethickness#;
- define_whole_blacker_pixels (dot_size);
-
- fat_factor = .11;
- thinness = 1.5 linethickness;
-
- pickup pencircle scaled thinness;
-
- rt x2 = w;
- lft x5 = -b;
- bot y5 = 0;
- top y3 = h;
- y1 = y2 = y5;
-
- x3 = 0;
- z1 - z4 = whatever * (charwd, -charht);
- z4 = fat_factor [z3, z5];
-
- ne = unitvector (z3 - z5);
- se = unitvector (z2 - z3);
-
- left_dist = (ne rotated 90) * 0.5 thinness;
- right_dist = (se rotated 90) * 0.5 thinness;
-
- fill bot z5{right}
- .. (z5 - left_dist){ne}
- -- (((z5 - left_dist) -- (z3 - left_dist)) intersectionpoint
- ((z1 - right_dist) -- (z4 - right_dist)))
- -- (z1 - right_dist){se}
- .. bot z1{right}
- -- bot z2{right}
- .. (z2 + right_dist){-se}
- -- (z3 + right_dist){-se}
- .. top z3
- .. (z3 + left_dist){-ne}
- -- (z5 + left_dist){-ne}
- .. cycle;
-
- pickup pencircle scaled dot_size;
-
- x1 - 2 x6 = x2;
- x6 := vround (x6);
- bot y6 = -d;
-
- drawdot z6;
-enddef;
-
-fet_beginchar ("short fermata up", "ushortfermata");
- draw_short_fermata;
- labels (1, 2, 3, 4, 5, 6);
-fet_endchar;
-
-
-fet_beginchar ("short fermata down", "dshortfermata");
- draw_short_fermata;
- xy_mirror_char;
-fet_endchar;
-
-
-def draw_long_fermata =
- save stemthick, beamheight, dot_size, wd;
- save pat;
- path pat;
-
- wd# = 2.5 staff_space#;
- stemthick = hround (1.5 linethickness);
- beamheight = 0.3 staff_space + linethickness;
- dot_size# = 0.266 staff_space# + 2.666 * linethickness#;
- define_pixels (wd);
- define_whole_blacker_pixels (dot_size);
-
- set_char_box (wd# / 2, wd# / 2, 0, 3/2 staff_space#);
-
- pickup pencircle scaled blot_diameter;
-
- top y1 = h;
- lft x1 = -b;
-
- pat := top z1{left}
- .. {down}lft z1;
-
- pickup pencircle scaled stemthick;
-
- x2 = -b + stemthick;
- y2 = h - beamheight;
- lft x3 = -b;
- bot y3 = -d;
-
- pat := pat
- -- lft z3
- .. bot z3
- .. rt z3
- -- z2;
- pat := pat
- -- reverse pat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
-
- fill pat;
-
- pickup pencircle scaled dot_size;
-
- x4 = 0;
- bot y4 = -d;
-
- drawdot z4;
-enddef;
-
-
-fet_beginchar ("long fermata up", "ulongfermata");
- draw_long_fermata;
- labels (1, 2, 3, 4);
-fet_endchar;
-
-
-fet_beginchar ("long fermata down", "dlongfermata");
- draw_long_fermata;
- y_mirror_char;
-fet_endchar;
-
-
-def draw_very_long_fermata =
- save ibeamheight, obeamheight;
- save ihwd, ohwd, iht, oht; % inner/outer half_width/height
- save stemthick, dot_size;
- save opat, ipat;
- path opat, ipat;
-
- ihwd# = 1.0 staff_space#;
- ohwd# = 1.5 staff_space#;
- iht# = 0.9 staff_space#;
- oht# = 1.6 staff_space#;
- define_pixels (ihwd, ohwd, iht, oht)
-
- stemthick = hround (1.5 linethickness);
- ibeamheight# = 0.3 staff_space#;
- obeamheight# = 0.5 staff_space#;
- define_pixels (ibeamheight, obeamheight);
-
- dot_size# = (iht# - ibeamheight#) * 8/10;
- define_whole_blacker_pixels (dot_size);
-
- set_char_box (ohwd#, ohwd#, 0, oht#);
-
- pickup pencircle scaled blot_diameter;
-
- top y1 = oht;
- lft x1 = -ohwd;
- top y11 = iht;
- lft x11 = -ihwd;
-
- opat := top z1{left}
- .. {down}lft z1;
- ipat := top z11{left}
- .. {down}lft z11;
-
- pickup pencircle scaled stemthick;
-
- x2 = -ohwd + stemthick;
- y2 = oht - obeamheight;
- lft x3 = -ohwd;
- bot y3 = 0;
- x12 = -ihwd + stemthick;
- y12 = iht - ibeamheight;
- lft x13 = -ihwd;
- bot y13 = 0;
-
- opat := opat
- -- lft z3
- .. bot z3
- .. rt z3
- -- z2;
- opat := opat
- -- reverse opat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
- ipat := ipat
- -- lft z13
- .. bot z13
- .. rt z13
- -- z12;
- ipat := ipat
- -- reverse ipat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
-
- fill opat;
- fill ipat;
-
- pickup pencircle scaled dot_size;
-
- x4 = 0;
- bot y4 = -d;
-
- drawdot z4;
-enddef;
-
-
-fet_beginchar ("very long fermata up", "uverylongfermata");
- draw_very_long_fermata;
- labels (1, 2, 3, 11, 12, 13, 4);
-fet_endchar;
-
-
-fet_beginchar ("very long fermata down", "dverylongfermata");
- draw_very_long_fermata;
- y_mirror_char;
-fet_endchar;
-
-
-%
-% Thumbs are used in cello music.
-% TODO : thumbs should look like the finger-font and should be placed in
-% the same way in the score.
-%
-
-fet_beginchar ("Thumb", "thumb");
- save thin, height, width, thick, depth;
- height# = 5/4 width#;
- height# = staff_space#;
- depth# = 1.6 (height# / 2);
-
- set_char_box (width# / 2, width# / 2, depth#, height# / 2);
-
- define_pixels (height, width);
-
- thin = .6 linethickness + 0.06 staff_space;
- 2 thick + 0.5 (height - 2 thin) = width;
-
- penpos1 (thick, 0);
- penpos2 (thin, 90);
- penpos3 (thick, 180);
- penpos4 (thin, 270);
- z1r = (w, 0);
- z2r = (0, h);
- z3r = (-w, 0);
- z4r = (0, -h);
-
- penlabels (1, 2, 3, 4);
-
- penstroke z1e{up}
- .. z2e{left}
- .. z3e{down}
- .. z4e{right}
- .. cycle;
-
- save brush_thick;
- y5 = -d + brush_thick / 2;
- brush_thick = 0.9 thick;
- x5 = 0;
-
- labels (5);
-
- draw_brush (z4r, 1.4 thin, z5, brush_thick);
-fet_endchar;
-
-
-%
-% `\accent' is TeX reserved.
-%
-
-def draw_accent (expr bottom_left, top_right, thickness, diminish) =
- save thinning_start;
- thinning_start = 0.4;
- pickup pencircle scaled thickness;
-
- lft x1 = xpart bottom_left;
- top y1 = ypart top_right;
- lft x6 = xpart bottom_left;
- bot y6 = ypart bottom_left;
-
- rt z4 = (xpart top_right, (ypart top_right + ypart bottom_left) / 2);
- x5 = x3 = thinning_start [xpart top_right, xpart bottom_left]
- - linethickness + 0.1 staff_space;
- z3 = whatever [z1, z4];
- z5 = whatever [z6, z4];
-
- penpos1 (thickness, angle (z3 - z1) + 90);
- penpos3 (thickness, angle (z3 - z1) + 90);
- penpos4 (thickness, 90);
- penpos5 (thickness, angle (z6 - z5) + 90);
- penpos6 (thickness, angle (z6 - z5) + 90);
-
- x4 - x7 = diminish * thickness;
- y7 = y4;
-
- fill z1l
- -- z3l
- -- z7
- -- z5l
- -- z6l
- .. lft z6{down}
- .. bot z6
- .. z6r
- -- z4l
- ..tension 0.8.. rt z4
- ..tension 0.8.. z4r
- -- z1r
- .. top z1
- .. lft z1{down}
- .. cycle;
-enddef;
-
-
-fet_beginchar ("> accent", "sforzato");
- set_char_box (.9 staff_space#, .9 staff_space#,
- .5 staff_space#, .5 staff_space#);
-
- draw_accent ((-w, -d), (w, h),
- 0.05 staff_space + linethickness, 0.7);
- penlabels (1, 3, 4, 5, 6);
- labels (7);
-fet_endchar;
-
-
-fet_beginchar ("espr", "espr");
- set_char_box (1.9 staff_space#, 1.9 staff_space#,
- .5 staff_space#, .5 staff_space#);
-
- draw_accent ((w - 1.78 staff_space, -d), (w, h),
- 0.05 staff_space + linethickness, 0.6);
- addto currentpicture also currentpicture xscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("staccato dot", "staccato");
- save radius;
- radius# = 0.20 * staff_space#;
- define_whole_pixels (radius);
-
- pickup pencircle scaled 2 radius;
- drawdot (0, 0);
-
- set_char_box (radius#, radius#, radius#, radius#);
-fet_endchar;
-
-
-def draw_staccatissimo =
- save radius, height;
- height# = .8 staff_space#;
- radius# = linethickness# + .1 staff_space#;
- define_whole_blacker_pixels (radius);
- define_pixels (height);
-
- draw_brush ((0, 0), linethickness, (0, height), 2 radius);
-
- set_char_box (radius#, radius#,
- blot_diameter# / 2, height# + radius#);
-enddef;
-
-
-fet_beginchar ("staccatissimo/martellato up", "ustaccatissimo");
- draw_staccatissimo;
-fet_endchar;
-
-
-fet_beginchar ("staccatissimo/martellato down", "dstaccatissimo");
- draw_staccatissimo;
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("portato/single tenuto", "tenuto");
- save thick;
- thick# = 1.6 linethickness#;
- define_whole_blacker_pixels (thick);
-
- set_char_box (.6 staff_space#, .6 staff_space#,
- thick# / 2, thick# / 2);
-
- draw_rounded_block ((-b, -thick / 2), (w, thick / 2), thick);
-fet_endchar;
-
-
-def draw_portato =
- save thick, dot_size;
- thick# = 1.4 linethickness#;
- dot_size# = 2.4 linethickness# + 0.08 staff_space#;
- define_whole_blacker_pixels (thick, dot_size);
-
- set_char_box (.6 staff_space#, .6 staff_space#,
- thick# / 2, .5 staff_space# + .5 dot_size#);
-
- draw_rounded_block ((-b, -thick / 2), (w, thick / 2), thick);
-
- pickup pencircle scaled dot_size;
- drawdot (0, h);
-enddef;
-
-
-fet_beginchar ("portato/tenuto with staccato", "uportato");
- draw_portato;
-fet_endchar;
-
-
-fet_beginchar ("portato/tenuto with staccato", "dportato");
- draw_portato;
- y_mirror_char
-fet_endchar;
-
-
-def draw_marcato =
- save fat_factor, thinness;
- save left_dist, right_dist, ne, se;
- pair left_dist, right_dist, ne, se;
-
- set_char_box (staff_space# / 2, staff_space# / 2,
- 0, 1.1 staff_space#);
-
- fat_factor = .3;
- thinness = linethickness;
-
- pickup pencircle scaled thinness;
-
- rt x2 = w;
- lft x5 = -b;
- bot y5 = 0;
- top y3 = h;
- y1 = y2 = y5;
-
- x3 =0;
- z1 - z4 = whatever * (charwd, -charht);
- z4 = fat_factor [z3, z5];
-
- ne = unitvector (z3 - z5);
- se = unitvector (z2 - z3);
-
- left_dist = (ne rotated 90) * 0.5 thinness;
- right_dist = (se rotated 90) * 0.5 thinness;
-
- fill bot z5{right}
- .. (z5 - left_dist){ne}
- -- (((z5 - left_dist) -- (z3 - left_dist)) intersectionpoint
- ((z1 - right_dist) -- (z4 - right_dist)))
- -- (z1 - right_dist){se}
- .. bot z1{right}
- -- bot z2{right}
- .. (z2 + right_dist){-se}
- -- (z3 + right_dist){-se}
- .. top z3
- .. (z3 + left_dist){-ne}
- -- (z5 + left_dist){-ne}
- .. cycle;
-enddef;
-
-
-fet_beginchar ("marcato up", "umarcato");
- draw_marcato;
- labels (1, 2, 3, 4, 5);
-fet_endchar;
-
-
-%
-% The down marcato char (not very much used).
-% Contrary to what some MF/TeX `gurus' believe
-% it is *point*-symmetric with the "up" version
-%
-
-fet_beginchar ("marcato down", "dmarcato");
- draw_marcato;
- xy_mirror_char;
-fet_endchar;
-
-
-%
-% used in french horn music todo
-%
-% TODO: too light at 20pt
-%
-
-fet_beginchar ("open (unstopped)", "open");
- save thin, height, width, thick;
-
- height# = 5/4 width#;
- height# = staff_space#;
- thin = .6 linethickness + 0.06 staff_space;
-
- set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
-
- define_pixels (width, height);
-
- 2 thick + 0.6 (height - 2 thin) = width;
-
- penpos1 (thick, 0);
- penpos2 (thin, 90);
- penpos3 (thick, 180);
- penpos4 (thin, 270);
- z1r = (w, 0);
- z2r = (0, h);
- z3r = (-w, 0);
- z4r = (0, -h);
-
- penlabels (1, 2, 3, 4);
-
- penstroke z1e{up}
- .. z2e{left}
- .. z3e{down}
- .. z4e{right}
- .. cycle;
-fet_endchar;
-
-
-fet_beginchar ("plus (stopped)", "stopped");
- save hthick, vthick, size, outer_hsize, outer_vsize;
-
- hthick# = vthick# = 2 linethickness#;
- size# = 1.1 staff_space#;
- define_whole_blacker_pixels (vthick);
- define_whole_vertical_blacker_pixels (hthick);
-
- set_char_box (size# / 2, size# / 2, size# / 2, size# / 2);
-
- outer_hsize = hround ((b + w - vthick) / 2);
- outer_vsize = vround ((h + d - hthick) / 2);
- w := b := (2 outer_hsize + vthick) / 2;
- h := d := (2 outer_vsize + hthick) / 2;
-
- draw_rounded_block ((-b, -d + outer_vsize),
- (w, -d + outer_vsize + hthick), hthick);
- draw_rounded_block ((-b + outer_hsize, -d),
- (-b + outer_hsize + vthick, h), vthick);
-fet_endchar;
-
-
-fet_beginchar ("Upbow", "upbow");
- save ht, wd, thick;
-
- thick = 1.4 linethickness;
- wd# = 1.3 staff_space#;
- ht# = 1.6 wd#;
-
- set_char_box (wd# / 2, wd# / 2, 0, ht#);
-
- draw_accent ((-h, -w), (0, w), thick, 0.9);
- currentpicture := currentpicture rotated -90;
-fet_endchar;
-
-
-fet_beginchar ("Downbow", "downbow");
- save stemthick, beamheight, wd;
- save pat;
- path pat;
-
- wd# = 1.5 staff_space#;
- define_pixels (wd);
-
- stemthick = hround (1.2 linethickness);
-
- set_char_box (wd# / 2, wd# / 2, 0, 4/3 staff_space#);
-
- beamheight = 4/10 h;
-
- pickup pencircle scaled blot_diameter;
-
- top y1 = h;
- lft x1 = -b;
-
- pat := top z1{left}
- .. {down}lft z1;
-
- pickup pencircle scaled stemthick;
-
- x2 = -b + stemthick;
- y2 = h - beamheight;
- lft x3 = -b;
- bot y3 = -d;
-
- pat := pat
- -- lft z3
- .. bot z3
- .. rt z3
- -- z2;
- pat := pat
- -- reverse pat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
-
- fill pat;
-
- labels (1, 2, 3);
-fet_endchar;
-
-%
-% Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
-%
-
-def draw_turn =
- save thin, thick, ball_diam, darkness;
- save wd, ht, thick_nibangle, ball_nib_thick;
- save turndir;
- pair turndir;
-
- wd# = 35/16 staff_space#;
- ht# = 18/17 staff_space#;
- darkness = 0.3 linethickness + 0.09 staff_space;
-
- set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
-
- thick_nibangle = 60;
- thick = 3 darkness;
- thin = darkness;
- ball_nib_thick = 2.7 darkness;
- ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
-
- x3l = w;
- y3 = 0;
- y4l = h;
- x4 = x2;
- x2l = w / 2;
- y2l = -d;
- z1 = (0,0);
-
- penpos1 (1.1 thick, thick_nibangle);
- penpos2 (thick, thick_nibangle);
- penpos3 (thin, 180);
- penpos4 (ball_nib_thick, -90);
-
- path swoosh, ploop;
- swoosh := z1l{curl 0}
- .. z2l
- .. z3l{up}
- .. {left}z4l
- -- z4r
- .. z3r{down}
- .. z2r{left};
- fill swoosh
- .. swoosh scaled -1 shifted (-feta_eps, -feta_eps)
- .. cycle;
-
- x5r = x4;
- y5r = y4l - ball_diam / 2;
- z6r = z5r;
-
- penpos5 (1.6 ball_diam / 2, 10);
- penpos6 (ball_diam / 2, 150);
-
- ploop := z4l{left}
- .. z5l
- .. z6l
- -- cycle;
- fill ploop;
- fill ploop scaled -1 shifted (-feta_eps, -feta_eps);
-enddef;
-
-
-fet_beginchar ("Reverse turn", "reverseturn");
- draw_turn;
- currentpicture := currentpicture yscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("Turn", "turn");
- draw_turn;
- penlabels (1, 2, 3, 4, 5, 6, 7);
-fet_endchar;
-
-
-%
-% Inspired by a (by now) PD edition of Durand & C'ie edition of
-% Saint-Saens' Celloconcerto no. 1
-%
-% FIXME take out hardcoded vars.
-% FIXME the two loops on the `t' should be smoother (and the left one bigger).
-% FIXME generic macros for serifs: top of the t and bottom of r
-%
-
-fet_beginchar ("Trill (`tr')", "trill");
- save start_nib_angle, ascender_extra, ex, hair_thick, fatness;
- save slant, t_fatness, r_fatness, kerning, t_overshoot;
- save uitschieter, bulb_size, krul_ang;
- save u, v;
-
- ascender_extra# = 1/2 ex#;
- ascender# = ascender_extra# + ex#;
- ex# = 1.4 staff_space#;
- kerning# = 0.6 ex#;
- start_nib_angle = 20;
- bulb_size = 0.8;
- define_pixels (ex, ascender_extra, ascender, kerning);
-
- t_overshoot = 0.03 ex;
- fatness = 12/40 ex;
- t_fatness = 0.78 fatness;
- t_width = 1.9 t_fatness;
- r_fatness = 0.78 fatness;
- uitschieter = 0.48 ex;
- hair_thick = linethickness;
- r_flare = .5 hair_thick + 0.25 r_fatness;
- r_width = 2 r_fatness + 0.25 kerning;
- slant = .2;
-
- local_copy (transform)(currenttransform);
- currenttransform := currenttransform slanted slant
- shifted (-staff_space, 0);
-
- set_char_box (.85 staff_space#, .85 staff_space#, 0, ascender#);
-
- y1 = ascender;
-
- % try to position in such a way that the center is the visual
- % center
-
- x1l = 0.2 staff_space;
- x1r - x1l = t_fatness;
- penpos1 (start_nib_wid, start_nib_angle);
-
- z2 = (x1, 7/18 ex);
- penpos2 (start_nib_wid, start_nib_angle);
-
- z3l = (x2l + 0.5 t_width, - t_overshoot);
-
- z4l = (x2l + t_width, 0.23 ex);
- penpos4 (whatever, 180); % 200
- x4l - x4r = hair_thick;
-
- x3r = 0.5 [x4r, x2r];
-% 1.7 [x3l, x3r] = x4r;
- y3r - y3l = 0.6 t_fatness;
-
- save krul_p;
- path krul_p;
-
- krul_ang = 32;
-
- pickup pencircle scaled hair_thick;
-
- z5 = (x2l + t_fatness / 2, 2/3 ex);
- lft x6 = x2l - uitschieter;
- y6 = y5; % - 1/20 ex;
- z7 = z5 + whatever * dir krul_ang;
- up_angle = krul_ang; % = angle (z7-z5)
- x7 = 5/10 kerning + x5;
-
- krul_p := z4{up}
- ..tension 0.98.. z5
- .. z6
- .. z5{z7 - z5}
- -- z7;
-
- z4' = point 0.85 of krul_p;
- penpos4' (hair_thick, angle (direction 0.85 of krul_p) + 90);
-
- % the body of the `t' and the bottom loop
- fill z1r{dir (angle (z1l - z1r) + 30)}
- .. z1l{-dir (angle (z1r - z1l) - 45)}
- -- z2l{down}
- ..tension (1 + .5 slant).. z3l{right}
- .. z4l{up}
- .. z4'l{direction 0.85 of krul_p}
- -- z4'r{-direction 0.85 of krul_p}
- .. z4r{down}
- .. z3r{left}
- ..tension (1.5 + .7 slant).. z2r{up}
- -- cycle;
-
- z5' = point 1.1 of krul_p;
- penpos5' (hair_thick, angle (direction 1.1 of krul_p) + 90);
- z5'' = point 1.5 of krul_p;
- penpos5'' (hair_thick, angle (direction 1.5 of krul_p) + 90);
- z5''' = point 1.8 of krul_p;
- penpos5''' (hair_thick, angle (direction 1.8 of krul_p) + 90);
- z6 = point 2 of krul_p;
- penpos6 (hair_thick, angle (direction 2 of krul_p) + 90);
- z6' = point 2.3 of krul_p;
- penpos6' (hair_thick, angle (direction 2.3 of krul_p) + 90);
- z6'' = point 2.6 of krul_p;
- penpos6'' (hair_thick, angle (direction 2.6 of krul_p) + 90);
- z6''' = point 2.9 of krul_p;
- penpos6''' (hair_thick, angle (direction 2.9 of krul_p) + 90);
- penpos7 (hair_thick, up_angle + 90);
- z7' = point 3.2 of krul_p;
- penpos7' (hair_thick, angle (direction 3.2 of krul_p) + 90);
-
- % the left loop
- penstroke z5'e{direction 1.1 of krul_p}
- .. z5''e{direction 1.5 of krul_p}
- .. z5'''e{direction 1.8 of krul_p}
- .. z6e{direction 2 of krul_p}
- .. z6'e{direction 2.3 of krul_p}
- .. z6''e{direction 2.6 of krul_p}
- .. {direction 2.9 of krul_p}z6'''e;
-
- y9 = 3/4 ex;
- x9 = x1 + kerning;
- penpos9 (r_fatness, 0);
-
- x10 = x9;
- y10 = -0.3 linethickness;
- penpos10 (r_fatness, 0);
-
- penpos11 (hair_thick, -4);
- z11r = z9r;
-
- z13l = (x9l + r_width, y11 - linethickness);
- penpos13 (r_flare, 180);
-
- z15 = z13r - (bulb_size * r_fatness, 0);
- z14 = 0.5 [z13l, z15] - (0, bulb_size * r_fatness);
-
- save before, after;
- path before, after;
- before := z13l{up}
- .. {down}z11l;
- after := z9r{up}
- .. z7r{z7' - z7}
- -- z7'r;
- (u, v) = before intersectiontimes after;
-
- save before_bulb, after_bulb;
- path before_bulb, after_bulb;
- before_bulb := z9r{up}
- ..tension 0.94.. z13r{down};
- after_bulb := z13l{up}
- ..tension 1.06.. z15{down};
- (u_bulb, v_bulb) = before_bulb intersectiontimes after_bulb;
-
- % the connection between `t' and `r', the body of the `r',
- % and the bulb
- fill z7'l
- -- z7l{z7 - z7'}
- .. z9l{down}
- -- simple_serif (z10l, z10r, -30)
- -- z9r{up}
- .. subpath (0, u_bulb) of before_bulb
- .. subpath (v_bulb, infinity) of after_bulb
- .. z14
- .. z13l{up}
- .. subpath (0, u) of before
- .. subpath (v, infinity) of after
- -- cycle;
-
- penlabels (range 1 thru 15);
- penlabels (4', 5', 5'', 5''', 6', 6'', 6''', 7');
-fet_endchar;
-
-
-def draw_heel =
- save radius, thickness;
- save pat;
- path pat;
-
- radius# := .5 staff_space#;
-
- set_char_box (radius#, radius#, radius#, 2/3 staff_space#);
-
- thickness := hround (1.5 linethickness);
-
- pickup pencircle scaled thickness;
-
- rt x1 = b;
- top y1 = h;
-
- x2 =x1;
- y2 = 0;
-
- x3 = 0;
- bot y3 = -d;
-
- pat := top z3{right}
- .. lft z2{up}
- -- lft z1
- .. top z1
- .. rt z1
- -- rt z2{down}
- .. bot z3{left};
- pat := pat
- -- reverse pat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
- fill pat;
-enddef;
-
-
-fet_beginchar ("left heel", "upedalheel");
- draw_heel;
- labels (1, 2, 3);
-fet_endchar;
-
-
-fet_beginchar ("right heel", "dpedalheel");
- draw_heel;
- y_mirror_char;
-fet_endchar;
-
-
-def draw_toe =
- save ht, wd, thickness;
-
- thickness := 1.5 linethickness;
- ht# := 1.5 staff_space#;
- wd# := 1/3 ht#;
- define_pixels (ht, wd);
-
- set_char_box (wd#, wd#, 0, ht#);
- draw_accent ((-h, -w), (0, w), thickness, 0.9);
- currentpicture := currentpicture rotated -90;
-enddef;
-
-
-fet_beginchar ("left toe", "upedaltoe");
- draw_toe;
-fet_endchar;
-
-
-fet_beginchar ("right toe", "dpedaltoe");
- draw_toe;
- y_mirror_char;
-fet_endchar;
-
-
-fet_beginchar ("Flageolet", "flageolet");
- save height, width, thickness, superness;
-
- height# = 4/15 staffsize#;
- width# = height#;
- thickness# = blot_diameter#;
- define_pixels (height, width);
- define_whole_blacker_pixels (thickness);
-
- set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
-
- penpos1 (thickness, 90);
- penpos2 (thickness, 180);
- penpos3 (thickness, 270);
- penpos4 (thickness, 0);
-
- x1 = 0;
- y1r = h;
- x4r = w;
- x2r = -x4r;
- y2 = 0;
- y4 = y2;
- x3 = x1;
- y3r = -y1r;
-
- penlabels (1, 2, 3, 4);
-
- % mf doesn't handle pixel dropouts in outline objects, so we use
- % `draw' if not called by mpost
- if known miterlimit:
- penstroke z1e
- .. z2e
- .. z3e
- .. z4e
- .. cycle;
- else:
- pickup pencircle scaled thickness;
- draw z1
- .. z2
- .. z3
- .. z4
- .. cycle;
- fi;
-fet_endchar;
-
-
-%
-% TODO: ARGRGHGH code dup.
-%
-
-fet_beginchar ("Segno", "segno");
- save thin, thick, ball_diam, darkness, pointheight;
- save wd, ht, thick_nibangle, ball_nib_thick;
- save turndir;
- pair turndir;
-
- ht# = 3 staff_space#;
- wd# = 2 staff_space#;
- darkness = .08 staff_space + 0.4 linethickness;
-
- set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
-
- thick_nibangle = 30;
- thick = 3 darkness;
- thin = darkness;
- ball_nib_thick = 2.7 darkness;
- ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
- pointheight = 2 linethickness;
-
- y3l = h;
- 2 x3 = x2 + x4;
- x4 = 0;
- y4 = y2;
- y2l = .6 h;
- x2l = -b;
- z1 = (0, 0);
-
- penpos1 (thick, 2 thick_nibangle);
- penpos2 (thick, thick_nibangle);
- penpos3 (thin, -90);
- penpos4 (ball_nib_thick, 180 - thick_nibangle);
-
- save swoosh, ploop;
- path swoosh, ploop;
-
- swoosh := z1l{curl 0}
- .. z2l
- .. z3l{right}
- .. {down}z4l
- -- z4r
- .. z3r{left}
- .. z2r{down};
- fill swoosh
- .. (swoosh scaled -1)
- .. cycle;
-
- y5r = y4;
- x5r = x4l - ball_diam / 2;
- z6r = z5r;
-
- penpos5 (1.6 ball_diam / 2, 100);
- penpos6 (ball_diam / 2, 240);
-
- ploop := z4l{down}
- .. z5l
- .. z6l
- -- cycle;
- fill ploop;
- fill ploop scaled -1;
-
- penpos7 (2 thin, 0);
- z7l = (-b, -d);
- penpos8 (2 thin, 0);
- z8r = (w, h);
-
- penstroke z7e
- -- z8e;
-
- pickup pencircle scaled 2 thin;
- drawdot (-x2r, pointheight);
- drawdot (x2r, -pointheight);
-
- penlabels (range 1 thru 8);
-fet_endchar;
-
-
-fet_beginchar ("Coda", "coda");
- save stickout, thin, thick, codawidth, codaheight;
-
- stickout# = 0.35 staff_space#;
- codawidth# = 2/3 staff_space#;
- codaheight# = staff_space#;
- define_pixels (codawidth, codaheight);
-
- set_char_box (codawidth# + stickout#, codawidth# + stickout#,
- codaheight# + stickout#, codaheight# + stickout#);
-
- thin = 1.2 linethickness;
- 0.1 (codaheight - 2 thin) = (codawidth - 2 thick);
-
- penpos1 (thick, 0);
- penpos2 (thin, -90);
- penpos3 (thick, -180);
- penpos4 (thin, -270);
-
- x1l = -codawidth;
- y2l = codaheight;
- y1 = 0;
- x2 = 0;
- z3 = -z1;
- z4 = -z2;
-
- penlabels (1, 2, 3, 4);
-
- fill z1l{up}
- .. z2l{right}
- .. z3l{down}
- .. z4l{left}
- .. cycle;
- unfill z1r{up}
- .. z2r{right}
- .. z3r{down}
- .. z4r{left}
- .. cycle;
-
- draw_gridline ((0, -h), (0, h), thin);
- draw_gridline ((-w, 0), (w, 0), thin);
-fet_endchar;
-
-
-fet_beginchar ("Varied Coda", "varcoda");
- save thin, thick, codawidth, codaheight;
- thin# = 1.2 linethickness#;
- thick# = 1.0 linethickness# + 0.25 staff_space#;
- codawidth# = 2/3 staff_space#;
- codaheight# = staff_space#;
- define_pixels (thin, thick, codawidth, codaheight);
-
- set_char_box (codawidth# + thick#, codawidth# + thick#,
- codaheight# + thick#, codaheight# + thick#);
-
- x1 = -codawidth + thick - .5 blot_diameter;
- y1 = y2 - thin;
- x2 = codawidth - thick + .5 blot_diameter;
- y2 = codaheight;
- draw_square_block (z1, z2);
-
- x3 = -codawidth;
- y3 = -codaheight;
- x4 = x3 + thick;
- y4 = y2;
- draw_block (z3, z4);
-
- labels (1, 2, 3, 4);
-
- addto currentpicture also currentpicture scaled -1;
-
- draw_gridline ((0, -h), (0, h), thin);
- draw_gridline ((-w, 0), (w, 0), thin);
-fet_endchar;
-
-
-def draw_comma =
- save alpha, thick, thin, ht;
-
- alpha := 35;
- thin# = 1.2 linethickness#;
- thick# = 3 linethickness#;
- ht# = .6 staff_space#;
- define_pixels (thin, thick, ht);
-
- set_char_box (0, .5 staff_space#, ht#, ht#);
-
- penpos1 (thick, alpha);
- penpos2 (thick, alpha + 90);
- penpos3 (thin, 180 - alpha);
- penpos4 (thin, 90 - alpha);
-
- x3r = 0;
- x1l = x3l;
- y2r = -y4l = h;
- z1 = z2;
- z3 = z4;
-
- fill z1l{dir (alpha + 90)}
- .. z2r{dir alpha}
- .. z1r{dir (alpha - 90)}
- .. z3l{dir (270 - alpha)}
- .. z4l{dir (180 - alpha)}
- .. z3r{dir (90-alpha)}
- .. cycle;
-enddef;
-
-
-fet_beginchar ("Right Comma", "rcomma");
- draw_comma;
- penlabels (1, 2, 3, 4);
-fet_endchar;
-
-
-fet_beginchar ("Left Comma", "lcomma");
- draw_comma;
- xy_mirror_char;
-fet_endchar;
-
-
-def draw_varcomma =
- save thick, thin, ht, wd, alpha;
-
- alpha := 35;
- thin# = 1.2 linethickness#;
- thick# = 3 linethickness#;
- ht# = .6 staff_space#;
- wd# = .25 staff_space#;
- define_pixels (thin, thick, ht, alpha);
-
- set_char_box (wd#, wd#, ht#, ht#);
-
- z1 = (-b, -d);
- z2 = (w, h);
-
- draw_brush (z1, thin, z2, thick);
-enddef;
-
-
-fet_beginchar ("Right Varied Comma", "rvarcomma");
- draw_varcomma;
- labels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("Left Varied Comma", "lvarcomma");
- draw_varcomma;
- xy_mirror_char;
-fet_endchar;
-
-
-thick# := 1/24 designsize;
-define_blacker_pixels (thick);
-
-rthin := 0.075 * staff_space + 0.5 linethickness;
-rthick := 2 thick + rthin;
-
-
-def draw_arpeggio =
- save alpha;
- save ne, nw, se, sw;
- save x, y;
- pair ne, nw, se, sw;
-
- alpha := -40;
-
- nw = dir (alpha + 180);
- ne = dir (alpha + 90);
- se = dir alpha;
- sw = dir (alpha - 90);
-
- penpos1 (rthin, alpha + 90);
- penpos2 (5/4 rthick, alpha);
- penpos3 (3/4 rthick, alpha);
- penpos4 (5/4 rthick, alpha);
- penpos5 (rthin, alpha + 90);
-
- z1 = (width / 2, height) - overshoot * se;
- z2 = 2 [z4, (width / 2, height / 2)];
- z3 = 1/2 [z2, z4];
- x4 = 2/8 staff_space;
- y4 = rthin;
-
- z5 = 2 [z1, (width / 2, height / 2)];
- z6 = z2l + 1/2 rthin * sw;
- z7 = z4l + 1/2 rthin * sw + 1/2 rthin * se;
- z8 = 2 [z6, (width / 2, height / 2)];
- z9 = 2 [z7, (width / 2, height / 2)];
-
- fill z1l{se}
- -- z6
- .. z3l
- .. z7{se}
- -- z5l
- .. z5r{nw}
- -- z8
- .. z3r
- .. z9{nw}
- -- z1r
- .. cycle;
-enddef;
-
-
-fet_beginchar ("Arpeggio", "arpeggio");
- save height, overshoot, width;
- height# = staff_space#;
- width# = 0.8 height#;
- overshoot# = 0.25 staff_space#;
- define_pixels (height, overshoot, width);
-
- set_char_box (0, width#, 0, height#);
- draw_arpeggio;
- penlabels (range 1 thru 9);
-
- draw_staff (-2, 2, 0.0);
-fet_endchar;
-
-
-%
-% Extendable Trill symbol.
-% Not yet used
-% Rename me to Trill, rename Trill to Tr?
-%
-
-fet_beginchar ("Trill_element", "trill_element");
- save height, overshoot;
- height# = staff_space#;
- width# = 0.8 height#;
- overshoot# = 0.25 staff_space#;
- define_pixels (height, overshoot, width);
-
- set_char_box (0, height#, 0, width#);
- draw_arpeggio;
-
- currentpicture := currentpicture shifted -(width / 2, height / 2);
- currentpicture := currentpicture rotated 90;
- currentpicture := currentpicture shifted (height / 2, width / 2);
-fet_endchar;
-
-
-%
-% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
-%
-
-def draw_arpeggio_arrow =
- save thinness, height, width, overshoot;
- save nw, ne, se, sw;
- save alpha;
- save before_left, before_right, after_left, after_right;
- save u_left, v_left, u_right, v_right;
- pair nw, ne, se, sw;
- path before_left, before_right, after_left, after_right;
-
- height# = staff_space#;
- width# = 0.8 height#;
- overshoot# = 0.25 staff_space#;
- define_pixels (height, overshoot, width);
-
- set_char_box (0, width#, 0, height#);
-
- alpha := -40;
- nw = dir (alpha + 180);
- ne = dir (alpha + 90);
- se = dir alpha;
- sw = dir (alpha - 90);
-
- penpos1 (rthin, alpha + 90);
- penpos2 (5/4 rthick, alpha);
- penpos3 (5/4 rthick, 0);
-
- z1 = (width / 2, height) - overshoot * se; % numbering is consistent
- % with the arpeggio symbol
- z2 = 2 [z4, (width / 2, height / 2)];
- z3 = (0.5 width, 0.5 height);
- z4 = (0.25 staff_space, rthin);
- z6 = z2l + 1/2 rthin * sw;
- z9 = (width / 2, height) + overshoot * se;
-
- pickup pencircle scaled vround (0.5 rthin);
-
- bot z10 = (0.5 w, 0);
- lft z11 = (0.5 w - hround (0.8 w), 0.8 h);
- rt z12 = (0.5 w + hround (0.8 w), 0.8 h);
-
- before_left := z1l
- -- z6{z6 - z1l}
- .. {down}z3l;
- after_left := (z3 + (0, -0.25 rthin / cosd (angle (nw))))
- -- (z11 + 0.25 rthin * ne);
- (u_left, v_left) = before_left intersectiontimes after_left;
-
- before_right := (z12 + 0.25 rthin * nw)
- -- (z3 + (0, -0.25 rthin / cosd (angle (nw))));
- after_right := z3r{up}
- .. z9{z1r - z9}
- -- z1r;
- (u_right, v_right) = before_right intersectiontimes after_right;
-
- fill subpath (0, u_left) of before_left
- .. subpath (v_left, infinity) of after_left
- .. top z11
- .. lft z11
- .. {dir -50}(z11 + 0.25 rthin * sw)
- .. (z10 + 0.25 rthin * sw){dir -70}
- .. bot z10
- .. {dir 70}(z10 + 0.25 rthin * se)
- .. (z12 + 0.25 rthin * se){dir 50}
- .. rt z12
- .. top z12
- .. subpath (0, u_right) of before_right
- .. subpath (v_right, infinity) of after_right
- .. cycle;
-
- % mf doesn't handle pixel dropouts in outline objects, so we use
- % `draw' if not called by mpost
- if not known miterlimit:
- pickup pencircle scaled 0.7 rthin;
- draw z1
- -- (z9 + 0.5 rthin * dir (alpha - 90));
- fi;
-enddef;
-
-
-fet_beginchar ("Arpeggio arrow down", "arpeggio.arrow.M1");
- draw_arpeggio_arrow;
- penlabels (range 1 thru 12);
-fet_endchar;
-
-
-fet_beginchar ("Arpeggio arrow up", "arpeggio.arrow.1");
- draw_arpeggio_arrow;
- currentpicture := currentpicture scaled -1
- shifted (w - feta_eps, h - feta_eps);
-fet_endchar;
-
-
-% Hmm
-input feta-slag;
-
-
-%
-% Railroad tracks. We define two variants of these -- both as slightly
-% tapered, comma-shaped curves and as two straight parallel slashes.
-%
-
-fet_beginchar ("Curved caesura", "caesura.curved");
- save slant, space_between, clearance;
- save alpha, pat;
- save botthick, topthick;
- save krom;
- path pat;
-
- botthick = 1.5 linethickness;
- topthick = 2.5 linethickness;
-
- pickup pencircle scaled botthick;
-
- slant = 3.5;
- space_between# = 0.6 staff_space#;
- clearance# = 0.2 staff_space#;
- height# = 1.2 staff_space#;
-
- set_char_box (0, 2.0 staff_space#,
- staff_space# - clearance#, height#);
- define_pixels (clearance, height);
- define_whole_pixels (space_between);
-
- bot y1 = -d;
- top y2 = h;
-
- lft x1 = 0;
- x2 = (y2 - y1) / slant;
-
- krom = 10;
-
- alpha = angle (z2 - z1);
- penpos1 (botthick, alpha - krom);
- penpos3 (botthick, alpha - krom + 90);
-
- penpos2 (topthick, alpha + krom);
- penpos4 (topthick, alpha + krom + 90);
-
- z3 = z1;
- z4 = z2;
-
- penlabels (1, 2, 3, 4);
-
- pat := z3r{(z1r - z1l)}
- .. z4r{z2r-z2l}
- .. z2r{z4l-z4r}
- .. z4l{z2l-z2r}
- .. z3l{z1l-z1r}
- .. z1l{z3r-z3l}
- .. cycle;
- fill pat;
- fill pat shifted (space_between, 0);
-fet_endchar;
-
-
-fet_beginchar ("Straight caesura", "caesura.straight");
- save slant, space_between, clearance;
- save thick, ne, pat;
- path pat;
- pair ne;
-
- slant = 2.0;
- thick = 2.88 linethickness;
-
- space_between# = 0.56 staff_space#;
- clearance# = 0.2 staff_space#;
-
- set_char_box (0, 2.0 staff_space#,
- staff_space# - clearance#, 1.2 staff_space#);
- define_whole_pixels (space_between);
-
- x1 = 0;
- x2 = x1 + thick;
- y1 = y2 = -d;
-
- x3 = x4 + thick;
- x4 = x1 + (h + d) / slant;
- y3 = y4 = h;
-
- ne = unitvector (z4 - z1);
-
- z1a = z1 + blot_diameter * ne;
- z1b = z1 + blot_diameter * right;
- z2a = z2 + blot_diameter * ne;
- z2b = z2 + blot_diameter * left;
-
- z3a = z3 - blot_diameter * ne;
- z3b = z3 + blot_diameter * left;
- z4a = z4 - blot_diameter * ne;
- z4b = z4 + blot_diameter * right;
-
- pat = z1a{-ne}
- .. {right}z1b
- -- z2b{right}
- .. {ne}z2a
- -- z3a{ne}
- .. {left}z3b
- -- z4b{left}
- .. {-ne}z4a
- -- cycle;
-
- fill pat;
- fill pat shifted (space_between, 0);
-
- labels(range 1 thru 4);
- labels(1a, 1b, 2a, 2b, 3a, 3b, 4a, 4b);
-fet_endchar;
-
-
-fet_beginchar ("snap pizzicato (Bartok pizzicato)", "snappizzicato");
- save height, width, thickness, superness;
-
- height# = 4/15 staffsize#;
- width# = height#;
- thickness# = 1.3 linethickness#;
- define_pixels (height, width);
- define_whole_blacker_pixels (thickness);
-
- set_char_box (width# / 2, width# / 2, height# / 2, height# * 3 / 4);
-
- penpos1 (thickness, 90);
- penpos2 (thickness, 180);
- penpos3 (thickness, 270);
- penpos4 (thickness, 0);
-
- x1 = 0;
- y1r = height / 2;
- x3 = x1;
- y3r = -y1r;
- x4r = width / 2;
- y4 = 0;
- x2r = -x4r;
- y2 = y4;
-
- penlabels (1, 2, 3, 4);
-
- % mf doesn't handle pixel dropouts in outline objects, so we use
- % `draw' if not called by mpost
- if known miterlimit:
- penstroke z1e
- .. z2e
- .. z3e
- .. z4e
- .. cycle;
- else:
- pickup pencircle scaled thickness;
- draw z1
- .. z2
- .. z3
- .. z4
- .. cycle;
- fi;
-
- z5 = (0, 0);
- z6 = (x5, 1.5 y1r);
-
- draw_gridline (z5, z6, thickness);
-
- labels (5, 6);
-fet_endchar;
-
-fet_endgroup ("scripts");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- implement scripts
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
+% Jan Nieuwenhuizen <janneke@gnu.org>
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+
+fet_begingroup ("scripts");
+
+def draw_fermata =
+ save alpha, radius, crook_thinness, crook_fatness, dot_size;
+ save pat;
+ path pat;
+
+ % [Wanske] and some Baerenreiter editions
+ % suggest about 80 degrees instead of a half-circle
+ alpha := 10;
+
+ radius# = 1.25 staff_space#;
+ crook_thinness# = 1.5 linethickness#;
+ crook_fatness# = 0.25 staff_space# + 1.5 linethickness#;
+
+ radius# + crook_fatness# / 2 = h#;
+ radius# + crook_thinness# / 2 = w#;
+
+ set_char_box (w#, w#, crook_thinness# / 2, h#);
+
+ define_pixels (radius, crook_thinness, crook_fatness);
+
+ dot_size# = 8/6 crook_fatness#;
+ define_whole_blacker_pixels (dot_size);
+
+ penpos1 (crook_thinness, 0);
+ penpos2 (crook_fatness, -90);
+ z1 = (-radius, 0);
+ z2 = (0, radius);
+
+ pat := z2l{left}
+ .. z1l{dir (-alpha - 90)}
+ .. {dir (90 - alpha)}z1r
+ .. {right}z2r;
+ pat := pat
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+ fill pat;
+
+ pickup pencircle scaled dot_size;
+ x4 = 0;
+ bot y4 = vround (-crook_thinness / 2);
+ drawdot z4;
+enddef;
+
+
+fet_beginchar ("fermata up", "ufermata");
+ draw_fermata;
+ penlabels (1, 2, 4);
+fet_endchar;
+
+
+fet_beginchar ("fermata down", "dfermata");
+ draw_fermata;
+ y_mirror_char;
+fet_endchar;
+
+
+def draw_short_fermata =
+ save fat_factor, thinness, dot_size;
+ save left_dist, right_dist, se, ne;
+ pair left_dist, right_dist, se, ne;
+
+ set_char_box (staff_space#, staff_space#, 0, 2.2 staff_space#);
+
+ dot_size# = 0.266 staff_space# + 2.666 linethickness#;
+ define_whole_blacker_pixels (dot_size);
+
+ fat_factor = .11;
+ thinness = 1.5 linethickness;
+
+ pickup pencircle scaled thinness;
+
+ rt x2 = w;
+ lft x5 = -b;
+ bot y5 = 0;
+ top y3 = h;
+ y1 = y2 = y5;
+
+ x3 = 0;
+ z1 - z4 = whatever * (charwd, -charht);
+ z4 = fat_factor [z3, z5];
+
+ ne = unitvector (z3 - z5);
+ se = unitvector (z2 - z3);
+
+ left_dist = (ne rotated 90) * 0.5 thinness;
+ right_dist = (se rotated 90) * 0.5 thinness;
+
+ fill bot z5{right}
+ .. (z5 - left_dist){ne}
+ -- (((z5 - left_dist) -- (z3 - left_dist)) intersectionpoint
+ ((z1 - right_dist) -- (z4 - right_dist)))
+ -- (z1 - right_dist){se}
+ .. bot z1{right}
+ -- bot z2{right}
+ .. (z2 + right_dist){-se}
+ -- (z3 + right_dist){-se}
+ .. top z3
+ .. (z3 + left_dist){-ne}
+ -- (z5 + left_dist){-ne}
+ .. cycle;
+
+ pickup pencircle scaled dot_size;
+
+ x1 - 2 x6 = x2;
+ x6 := vround (x6);
+ bot y6 = -d;
+
+ drawdot z6;
+enddef;
+
+fet_beginchar ("short fermata up", "ushortfermata");
+ draw_short_fermata;
+ labels (1, 2, 3, 4, 5, 6);
+fet_endchar;
+
+
+fet_beginchar ("short fermata down", "dshortfermata");
+ draw_short_fermata;
+ xy_mirror_char;
+fet_endchar;
+
+
+def draw_long_fermata =
+ save stemthick, beamheight, dot_size, wd;
+ save pat;
+ path pat;
+
+ wd# = 2.5 staff_space#;
+ stemthick = hround (1.5 linethickness);
+ beamheight = 0.3 staff_space + linethickness;
+ dot_size# = 0.266 staff_space# + 2.666 * linethickness#;
+ define_pixels (wd);
+ define_whole_blacker_pixels (dot_size);
+
+ set_char_box (wd# / 2, wd# / 2, 0, 3/2 staff_space#);
+
+ pickup pencircle scaled blot_diameter;
+
+ top y1 = h;
+ lft x1 = -b;
+
+ pat := top z1{left}
+ .. {down}lft z1;
+
+ pickup pencircle scaled stemthick;
+
+ x2 = -b + stemthick;
+ y2 = h - beamheight;
+ lft x3 = -b;
+ bot y3 = -d;
+
+ pat := pat
+ -- lft z3
+ .. bot z3
+ .. rt z3
+ -- z2;
+ pat := pat
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+
+ fill pat;
+
+ pickup pencircle scaled dot_size;
+
+ x4 = 0;
+ bot y4 = -d;
+
+ drawdot z4;
+enddef;
+
+
+fet_beginchar ("long fermata up", "ulongfermata");
+ draw_long_fermata;
+ labels (1, 2, 3, 4);
+fet_endchar;
+
+
+fet_beginchar ("long fermata down", "dlongfermata");
+ draw_long_fermata;
+ y_mirror_char;
+fet_endchar;
+
+
+def draw_very_long_fermata =
+ save ibeamheight, obeamheight;
+ save ihwd, ohwd, iht, oht; % inner/outer half_width/height
+ save stemthick, dot_size;
+ save opat, ipat;
+ path opat, ipat;
+
+ ihwd# = 1.0 staff_space#;
+ ohwd# = 1.5 staff_space#;
+ iht# = 0.9 staff_space#;
+ oht# = 1.6 staff_space#;
+ define_pixels (ihwd, ohwd, iht, oht)
+
+ stemthick = hround (1.5 linethickness);
+ ibeamheight# = 0.3 staff_space#;
+ obeamheight# = 0.5 staff_space#;
+ define_pixels (ibeamheight, obeamheight);
+
+ dot_size# = (iht# - ibeamheight#) * 8/10;
+ define_whole_blacker_pixels (dot_size);
+
+ set_char_box (ohwd#, ohwd#, 0, oht#);
+
+ pickup pencircle scaled blot_diameter;
+
+ top y1 = oht;
+ lft x1 = -ohwd;
+ top y11 = iht;
+ lft x11 = -ihwd;
+
+ opat := top z1{left}
+ .. {down}lft z1;
+ ipat := top z11{left}
+ .. {down}lft z11;
+
+ pickup pencircle scaled stemthick;
+
+ x2 = -ohwd + stemthick;
+ y2 = oht - obeamheight;
+ lft x3 = -ohwd;
+ bot y3 = 0;
+ x12 = -ihwd + stemthick;
+ y12 = iht - ibeamheight;
+ lft x13 = -ihwd;
+ bot y13 = 0;
+
+ opat := opat
+ -- lft z3
+ .. bot z3
+ .. rt z3
+ -- z2;
+ opat := opat
+ -- reverse opat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+ ipat := ipat
+ -- lft z13
+ .. bot z13
+ .. rt z13
+ -- z12;
+ ipat := ipat
+ -- reverse ipat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+
+ fill opat;
+ fill ipat;
+
+ pickup pencircle scaled dot_size;
+
+ x4 = 0;
+ bot y4 = -d;
+
+ drawdot z4;
+enddef;
+
+
+fet_beginchar ("very long fermata up", "uverylongfermata");
+ draw_very_long_fermata;
+ labels (1, 2, 3, 11, 12, 13, 4);
+fet_endchar;
+
+
+fet_beginchar ("very long fermata down", "dverylongfermata");
+ draw_very_long_fermata;
+ y_mirror_char;
+fet_endchar;
+
+
+%
+% Thumbs are used in cello music.
+% TODO : thumbs should look like the finger-font and should be placed in
+% the same way in the score.
+%
+
+fet_beginchar ("Thumb", "thumb");
+ save thin, height, width, thick, depth;
+ height# = 5/4 width#;
+ height# = staff_space#;
+ depth# = 1.6 (height# / 2);
+
+ set_char_box (width# / 2, width# / 2, depth#, height# / 2);
+
+ define_pixels (height, width);
+
+ thin = .6 linethickness + 0.06 staff_space;
+ 2 thick + 0.5 (height - 2 thin) = width;
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 90);
+ penpos3 (thick, 180);
+ penpos4 (thin, 270);
+ z1r = (w, 0);
+ z2r = (0, h);
+ z3r = (-w, 0);
+ z4r = (0, -h);
+
+ penlabels (1, 2, 3, 4);
+
+ penstroke z1e{up}
+ .. z2e{left}
+ .. z3e{down}
+ .. z4e{right}
+ .. cycle;
+
+ save brush_thick;
+ y5 = -d + brush_thick / 2;
+ brush_thick = 0.9 thick;
+ x5 = 0;
+
+ labels (5);
+
+ draw_brush (z4r, 1.4 thin, z5, brush_thick);
+fet_endchar;
+
+
+%
+% `\accent' is TeX reserved.
+%
+
+def draw_accent (expr bottom_left, top_right, thickness, diminish) =
+ save thinning_start;
+ thinning_start = 0.4;
+ pickup pencircle scaled thickness;
+
+ lft x1 = xpart bottom_left;
+ top y1 = ypart top_right;
+ lft x6 = xpart bottom_left;
+ bot y6 = ypart bottom_left;
+
+ rt z4 = (xpart top_right, (ypart top_right + ypart bottom_left) / 2);
+ x5 = x3 = thinning_start [xpart top_right, xpart bottom_left]
+ - linethickness + 0.1 staff_space;
+ z3 = whatever [z1, z4];
+ z5 = whatever [z6, z4];
+
+ penpos1 (thickness, angle (z3 - z1) + 90);
+ penpos3 (thickness, angle (z3 - z1) + 90);
+ penpos4 (thickness, 90);
+ penpos5 (thickness, angle (z6 - z5) + 90);
+ penpos6 (thickness, angle (z6 - z5) + 90);
+
+ x4 - x7 = diminish * thickness;
+ y7 = y4;
+
+ fill z1l
+ -- z3l
+ -- z7
+ -- z5l
+ -- z6l
+ .. lft z6{down}
+ .. bot z6
+ .. z6r
+ -- z4l
+ ..tension 0.8.. rt z4
+ ..tension 0.8.. z4r
+ -- z1r
+ .. top z1
+ .. lft z1{down}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("> accent", "sforzato");
+ set_char_box (.9 staff_space#, .9 staff_space#,
+ .5 staff_space#, .5 staff_space#);
+
+ draw_accent ((-w, -d), (w, h),
+ 0.05 staff_space + linethickness, 0.7);
+ penlabels (1, 3, 4, 5, 6);
+ labels (7);
+fet_endchar;
+
+
+fet_beginchar ("espr", "espr");
+ set_char_box (1.9 staff_space#, 1.9 staff_space#,
+ .5 staff_space#, .5 staff_space#);
+
+ draw_accent ((w - 1.78 staff_space, -d), (w, h),
+ 0.05 staff_space + linethickness, 0.6);
+ addto currentpicture also currentpicture xscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("staccato dot", "staccato");
+ save radius;
+ radius# = 0.20 * staff_space#;
+ define_whole_pixels (radius);
+
+ pickup pencircle scaled 2 radius;
+ drawdot (0, 0);
+
+ set_char_box (radius#, radius#, radius#, radius#);
+fet_endchar;
+
+
+def draw_staccatissimo =
+ save radius, height;
+ height# = .8 staff_space#;
+ radius# = linethickness# + .1 staff_space#;
+ define_whole_blacker_pixels (radius);
+ define_pixels (height);
+
+ draw_brush ((0, 0), linethickness, (0, height), 2 radius);
+
+ set_char_box (radius#, radius#,
+ blot_diameter# / 2, height# + radius#);
+enddef;
+
+
+fet_beginchar ("staccatissimo/martellato up", "ustaccatissimo");
+ draw_staccatissimo;
+fet_endchar;
+
+
+fet_beginchar ("staccatissimo/martellato down", "dstaccatissimo");
+ draw_staccatissimo;
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("portato/single tenuto", "tenuto");
+ save thick;
+ thick# = 1.6 linethickness#;
+ define_whole_blacker_pixels (thick);
+
+ set_char_box (.6 staff_space#, .6 staff_space#,
+ thick# / 2, thick# / 2);
+
+ draw_rounded_block ((-b, -thick / 2), (w, thick / 2), thick);
+fet_endchar;
+
+
+def draw_portato =
+ save thick, dot_size;
+ thick# = 1.4 linethickness#;
+ dot_size# = 2.4 linethickness# + 0.08 staff_space#;
+ define_whole_blacker_pixels (thick, dot_size);
+
+ set_char_box (.6 staff_space#, .6 staff_space#,
+ thick# / 2, .5 staff_space# + .5 dot_size#);
+
+ draw_rounded_block ((-b, -thick / 2), (w, thick / 2), thick);
+
+ pickup pencircle scaled dot_size;
+ drawdot (0, h);
+enddef;
+
+
+fet_beginchar ("portato/tenuto with staccato", "uportato");
+ draw_portato;
+fet_endchar;
+
+
+fet_beginchar ("portato/tenuto with staccato", "dportato");
+ draw_portato;
+ y_mirror_char
+fet_endchar;
+
+
+def draw_marcato =
+ save fat_factor, thinness;
+ save left_dist, right_dist, ne, se;
+ pair left_dist, right_dist, ne, se;
+
+ set_char_box (staff_space# / 2, staff_space# / 2,
+ 0, 1.1 staff_space#);
+
+ fat_factor = .3;
+ thinness = linethickness;
+
+ pickup pencircle scaled thinness;
+
+ rt x2 = w;
+ lft x5 = -b;
+ bot y5 = 0;
+ top y3 = h;
+ y1 = y2 = y5;
+
+ x3 =0;
+ z1 - z4 = whatever * (charwd, -charht);
+ z4 = fat_factor [z3, z5];
+
+ ne = unitvector (z3 - z5);
+ se = unitvector (z2 - z3);
+
+ left_dist = (ne rotated 90) * 0.5 thinness;
+ right_dist = (se rotated 90) * 0.5 thinness;
+
+ fill bot z5{right}
+ .. (z5 - left_dist){ne}
+ -- (((z5 - left_dist) -- (z3 - left_dist)) intersectionpoint
+ ((z1 - right_dist) -- (z4 - right_dist)))
+ -- (z1 - right_dist){se}
+ .. bot z1{right}
+ -- bot z2{right}
+ .. (z2 + right_dist){-se}
+ -- (z3 + right_dist){-se}
+ .. top z3
+ .. (z3 + left_dist){-ne}
+ -- (z5 + left_dist){-ne}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("marcato up", "umarcato");
+ draw_marcato;
+ labels (1, 2, 3, 4, 5);
+fet_endchar;
+
+
+%
+% The down marcato char (not very much used).
+% Contrary to what some MF/TeX `gurus' believe
+% it is *point*-symmetric with the "up" version
+%
+
+fet_beginchar ("marcato down", "dmarcato");
+ draw_marcato;
+ xy_mirror_char;
+fet_endchar;
+
+
+%
+% used in french horn music todo
+%
+% TODO: too light at 20pt
+%
+
+fet_beginchar ("open (unstopped)", "open");
+ save thin, height, width, thick;
+
+ height# = 5/4 width#;
+ height# = staff_space#;
+ thin = .6 linethickness + 0.06 staff_space;
+
+ set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
+
+ define_pixels (width, height);
+
+ 2 thick + 0.6 (height - 2 thin) = width;
+
+ penpos1 (thick, 0);
+ penpos2 (thin, 90);
+ penpos3 (thick, 180);
+ penpos4 (thin, 270);
+ z1r = (w, 0);
+ z2r = (0, h);
+ z3r = (-w, 0);
+ z4r = (0, -h);
+
+ penlabels (1, 2, 3, 4);
+
+ penstroke z1e{up}
+ .. z2e{left}
+ .. z3e{down}
+ .. z4e{right}
+ .. cycle;
+fet_endchar;
+
+
+fet_beginchar ("plus (stopped)", "stopped");
+ save hthick, vthick, size, outer_hsize, outer_vsize;
+
+ hthick# = vthick# = 2 linethickness#;
+ size# = 1.1 staff_space#;
+ define_whole_blacker_pixels (vthick);
+ define_whole_vertical_blacker_pixels (hthick);
+
+ set_char_box (size# / 2, size# / 2, size# / 2, size# / 2);
+
+ outer_hsize = hround ((b + w - vthick) / 2);
+ outer_vsize = vround ((h + d - hthick) / 2);
+ w := b := (2 outer_hsize + vthick) / 2;
+ h := d := (2 outer_vsize + hthick) / 2;
+
+ draw_rounded_block ((-b, -d + outer_vsize),
+ (w, -d + outer_vsize + hthick), hthick);
+ draw_rounded_block ((-b + outer_hsize, -d),
+ (-b + outer_hsize + vthick, h), vthick);
+fet_endchar;
+
+
+fet_beginchar ("Upbow", "upbow");
+ save ht, wd, thick;
+
+ thick = 1.4 linethickness;
+ wd# = 1.3 staff_space#;
+ ht# = 1.6 wd#;
+
+ set_char_box (wd# / 2, wd# / 2, 0, ht#);
+
+ draw_accent ((-h, -w), (0, w), thick, 0.9);
+ currentpicture := currentpicture rotated -90;
+fet_endchar;
+
+
+fet_beginchar ("Downbow", "downbow");
+ save stemthick, beamheight, wd;
+ save pat;
+ path pat;
+
+ wd# = 1.5 staff_space#;
+ define_pixels (wd);
+
+ stemthick = hround (1.2 linethickness);
+
+ set_char_box (wd# / 2, wd# / 2, 0, 4/3 staff_space#);
+
+ beamheight = 4/10 h;
+
+ pickup pencircle scaled blot_diameter;
+
+ top y1 = h;
+ lft x1 = -b;
+
+ pat := top z1{left}
+ .. {down}lft z1;
+
+ pickup pencircle scaled stemthick;
+
+ x2 = -b + stemthick;
+ y2 = h - beamheight;
+ lft x3 = -b;
+ bot y3 = -d;
+
+ pat := pat
+ -- lft z3
+ .. bot z3
+ .. rt z3
+ -- z2;
+ pat := pat
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+
+ fill pat;
+
+ labels (1, 2, 3);
+fet_endchar;
+
+%
+% Inspired by a computer-set version of Auf dem Strom by Baerenreiter.
+%
+
+def draw_turn =
+ save thin, thick, ball_diam, darkness;
+ save wd, ht, thick_nibangle, ball_nib_thick;
+ save turndir;
+ pair turndir;
+
+ wd# = 35/16 staff_space#;
+ ht# = 18/17 staff_space#;
+ darkness = 0.3 linethickness + 0.09 staff_space;
+
+ set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
+
+ thick_nibangle = 60;
+ thick = 3 darkness;
+ thin = darkness;
+ ball_nib_thick = 2.7 darkness;
+ ball_diam = ball_nib_thick + (h - ball_nib_thick) / 10;
+
+ x3l = w;
+ y3 = 0;
+ y4l = h;
+ x4 = x2;
+ x2l = w / 2;
+ y2l = -d;
+ z1 = (0,0);
+
+ penpos1 (1.1 thick, thick_nibangle);
+ penpos2 (thick, thick_nibangle);
+ penpos3 (thin, 180);
+ penpos4 (ball_nib_thick, -90);
+
+ path swoosh, ploop;
+ swoosh := z1l{curl 0}
+ .. z2l
+ .. z3l{up}
+ .. {left}z4l
+ -- z4r
+ .. z3r{down}
+ .. z2r{left};
+ fill swoosh
+ .. swoosh scaled -1 shifted (-feta_eps, -feta_eps)
+ .. cycle;
+
+ x5r = x4;
+ y5r = y4l - ball_diam / 2;
+ z6r = z5r;
+
+ penpos5 (1.6 ball_diam / 2, 10);
+ penpos6 (ball_diam / 2, 150);
+
+ ploop := z4l{left}
+ .. z5l
+ .. z6l
+ -- cycle;
+ fill ploop;
+ fill ploop scaled -1 shifted (-feta_eps, -feta_eps);
+enddef;
+
+
+fet_beginchar ("Reverse turn", "reverseturn");
+ draw_turn;
+ currentpicture := currentpicture yscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("Turn", "turn");
+ draw_turn;
+ penlabels (1, 2, 3, 4, 5, 6, 7);
+fet_endchar;
+
+
+%
+% Inspired by a (by now) PD edition of Durand & C'ie edition of
+% Saint-Saens' Celloconcerto no. 1
+%
+% FIXME take out hardcoded vars.
+% FIXME the two loops on the `t' should be smoother (and the left one bigger).
+% FIXME generic macros for serifs: top of the t and bottom of r
+%
+
+fet_beginchar ("Trill (`tr')", "trill");
+ save start_nib_angle, ascender_extra, ex, hair_thick, fatness;
+ save slant, t_fatness, r_fatness, kerning, t_overshoot;
+ save uitschieter, bulb_size, krul_ang;
+ save u, v;
+
+ ascender_extra# = 1/2 ex#;
+ ascender# = ascender_extra# + ex#;
+ ex# = 1.4 staff_space#;
+ kerning# = 0.6 ex#;
+ start_nib_angle = 20;
+ bulb_size = 0.8;
+ define_pixels (ex, ascender_extra, ascender, kerning);
+
+ t_overshoot = 0.03 ex;
+ fatness = 12/40 ex;
+ t_fatness = 0.78 fatness;
+ t_width = 1.9 t_fatness;
+ r_fatness = 0.78 fatness;
+ uitschieter = 0.48 ex;
+ hair_thick = linethickness;
+ r_flare = .5 hair_thick + 0.25 r_fatness;
+ r_width = 2 r_fatness + 0.25 kerning;
+ slant = .2;
+
+ local_copy (transform)(currenttransform);
+ currenttransform := currenttransform slanted slant
+ shifted (-staff_space, 0);
+
+ set_char_box (.85 staff_space#, .85 staff_space#, 0, ascender#);
+
+ y1 = ascender;
+
+ % try to position in such a way that the center is the visual
+ % center
+
+ x1l = 0.2 staff_space;
+ x1r - x1l = t_fatness;
+ penpos1 (start_nib_wid, start_nib_angle);
+
+ z2 = (x1, 7/18 ex);
+ penpos2 (start_nib_wid, start_nib_angle);
+
+ z3l = (x2l + 0.5 t_width, - t_overshoot);
+
+ z4l = (x2l + t_width, 0.23 ex);
+ penpos4 (whatever, 180); % 200
+ x4l - x4r = hair_thick;
+
+ x3r = 0.5 [x4r, x2r];
+% 1.7 [x3l, x3r] = x4r;
+ y3r - y3l = 0.6 t_fatness;
+
+ save krul_p;
+ path krul_p;
+
+ krul_ang = 32;
+
+ pickup pencircle scaled hair_thick;
+
+ z5 = (x2l + t_fatness / 2, 2/3 ex);
+ lft x6 = x2l - uitschieter;
+ y6 = y5; % - 1/20 ex;
+ z7 = z5 + whatever * dir krul_ang;
+ up_angle = krul_ang; % = angle (z7-z5)
+ x7 = 5/10 kerning + x5;
+
+ krul_p := z4{up}
+ ..tension 0.98.. z5
+ .. z6
+ .. z5{z7 - z5}
+ -- z7;
+
+ z4' = point 0.85 of krul_p;
+ penpos4' (hair_thick, angle (direction 0.85 of krul_p) + 90);
+
+ % the body of the `t' and the bottom loop
+ fill z1r{dir (angle (z1l - z1r) + 30)}
+ .. z1l{-dir (angle (z1r - z1l) - 45)}
+ -- z2l{down}
+ ..tension (1 + .5 slant).. z3l{right}
+ .. z4l{up}
+ .. z4'l{direction 0.85 of krul_p}
+ -- z4'r{-direction 0.85 of krul_p}
+ .. z4r{down}
+ .. z3r{left}
+ ..tension (1.5 + .7 slant).. z2r{up}
+ -- cycle;
+
+ z5' = point 1.1 of krul_p;
+ penpos5' (hair_thick, angle (direction 1.1 of krul_p) + 90);
+ z5'' = point 1.5 of krul_p;
+ penpos5'' (hair_thick, angle (direction 1.5 of krul_p) + 90);
+ z5''' = point 1.8 of krul_p;
+ penpos5''' (hair_thick, angle (direction 1.8 of krul_p) + 90);
+ z6 = point 2 of krul_p;
+ penpos6 (hair_thick, angle (direction 2 of krul_p) + 90);
+ z6' = point 2.3 of krul_p;
+ penpos6' (hair_thick, angle (direction 2.3 of krul_p) + 90);
+ z6'' = point 2.6 of krul_p;
+ penpos6'' (hair_thick, angle (direction 2.6 of krul_p) + 90);
+ z6''' = point 2.9 of krul_p;
+ penpos6''' (hair_thick, angle (direction 2.9 of krul_p) + 90);
+ penpos7 (hair_thick, up_angle + 90);
+ z7' = point 3.2 of krul_p;
+ penpos7' (hair_thick, angle (direction 3.2 of krul_p) + 90);
+
+ % the left loop
+ penstroke z5'e{direction 1.1 of krul_p}
+ .. z5''e{direction 1.5 of krul_p}
+ .. z5'''e{direction 1.8 of krul_p}
+ .. z6e{direction 2 of krul_p}
+ .. z6'e{direction 2.3 of krul_p}
+ .. z6''e{direction 2.6 of krul_p}
+ .. {direction 2.9 of krul_p}z6'''e;
+
+ y9 = 3/4 ex;
+ x9 = x1 + kerning;
+ penpos9 (r_fatness, 0);
+
+ x10 = x9;
+ y10 = -0.3 linethickness;
+ penpos10 (r_fatness, 0);
+
+ penpos11 (hair_thick, -4);
+ z11r = z9r;
+
+ z13l = (x9l + r_width, y11 - linethickness);
+ penpos13 (r_flare, 180);
+
+ z15 = z13r - (bulb_size * r_fatness, 0);
+ z14 = 0.5 [z13l, z15] - (0, bulb_size * r_fatness);
+
+ save before, after;
+ path before, after;
+ before := z13l{up}
+ .. {down}z11l;
+ after := z9r{up}
+ .. z7r{z7' - z7}
+ -- z7'r;
+ (u, v) = before intersectiontimes after;
+
+ save before_bulb, after_bulb;
+ path before_bulb, after_bulb;
+ before_bulb := z9r{up}
+ ..tension 0.94.. z13r{down};
+ after_bulb := z13l{up}
+ ..tension 1.06.. z15{down};
+ (u_bulb, v_bulb) = before_bulb intersectiontimes after_bulb;
+
+ % the connection between `t' and `r', the body of the `r',
+ % and the bulb
+ fill z7'l
+ -- z7l{z7 - z7'}
+ .. z9l{down}
+ -- simple_serif (z10l, z10r, -30)
+ -- z9r{up}
+ .. subpath (0, u_bulb) of before_bulb
+ .. subpath (v_bulb, infinity) of after_bulb
+ .. z14
+ .. z13l{up}
+ .. subpath (0, u) of before
+ .. subpath (v, infinity) of after
+ -- cycle;
+
+ penlabels (range 1 thru 15);
+ penlabels (4', 5', 5'', 5''', 6', 6'', 6''', 7');
+fet_endchar;
+
+
+def draw_heel =
+ save radius, thickness;
+ save pat;
+ path pat;
+
+ radius# := .5 staff_space#;
+
+ set_char_box (radius#, radius#, radius#, 2/3 staff_space#);
+
+ thickness := hround (1.5 linethickness);
+
+ pickup pencircle scaled thickness;
+
+ rt x1 = b;
+ top y1 = h;
+
+ x2 =x1;
+ y2 = 0;
+
+ x3 = 0;
+ bot y3 = -d;
+
+ pat := top z3{right}
+ .. lft z2{up}
+ -- lft z1
+ .. top z1
+ .. rt z1
+ -- rt z2{down}
+ .. bot z3{left};
+ pat := pat
+ -- reverse pat xscaled -1 shifted (-feta_eps, 0)
+ -- cycle;
+ fill pat;
+enddef;
+
+
+fet_beginchar ("left heel", "upedalheel");
+ draw_heel;
+ labels (1, 2, 3);
+fet_endchar;
+
+
+fet_beginchar ("right heel", "dpedalheel");
+ draw_heel;
+ y_mirror_char;
+fet_endchar;
+
+
+def draw_toe =
+ save ht, wd, thickness;
+
+ thickness := 1.5 linethickness;
+ ht# := 1.5 staff_space#;
+ wd# := 1/3 ht#;
+ define_pixels (ht, wd);
+
+ set_char_box (wd#, wd#, 0, ht#);
+ draw_accent ((-h, -w), (0, w), thickness, 0.9);
+ currentpicture := currentpicture rotated -90;
+enddef;
+
+
+fet_beginchar ("left toe", "upedaltoe");
+ draw_toe;
+fet_endchar;
+
+
+fet_beginchar ("right toe", "dpedaltoe");
+ draw_toe;
+ y_mirror_char;
+fet_endchar;
+
+
+fet_beginchar ("Flageolet", "flageolet");
+ save height, width, thickness, superness;
+
+ height# = 4/15 staffsize#;
+ width# = height#;
+ thickness# = blot_diameter#;
+ define_pixels (height, width);
+ define_whole_blacker_pixels (thickness);
+
+ set_char_box (width# / 2, width# / 2, height# / 2, height# / 2);
+
+ penpos1 (thickness, 90);
+ penpos2 (thickness, 180);
+ penpos3 (thickness, 270);
+ penpos4 (thickness, 0);
+
+ x1 = 0;
+ y1r = h;
+ x4r = w;
+ x2r = -x4r;
+ y2 = 0;
+ y4 = y2;
+ x3 = x1;
+ y3r = -y1r;
+
+ penlabels (1, 2, 3, 4);
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if known miterlimit:
+ penstroke z1e
+ .. z2e
+ .. z3e
+ .. z4e
+ .. cycle;
+ else:
+ pickup pencircle scaled thickness;
+ draw z1
+ .. z2
+ .. z3
+ .. z4
+ .. cycle;
+ fi;
+fet_endchar;
+
+
+%
+% TODO: ARGRGHGH code dup.
+%
+
+fet_beginchar ("Segno", "segno");
+ save thin, thick, ball_diam, darkness, pointheight;
+ save wd, ht, thick_nibangle, ball_nib_thick;
+ save turndir;
+ pair turndir;
+
+ ht# = 3 staff_space#;
+ wd# = 2 staff_space#;
+ darkness = .08 staff_space + 0.4 linethickness;
+
+ set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
+
+ thick_nibangle = 30;
+ thick = 3 darkness;
+ thin = darkness;
+ ball_nib_thick = 2.7 darkness;
+ ball_diam = ball_nib_thick + (w - ball_nib_thick) / 10;
+ pointheight = 2 linethickness;
+
+ y3l = h;
+ 2 x3 = x2 + x4;
+ x4 = 0;
+ y4 = y2;
+ y2l = .6 h;
+ x2l = -b;
+ z1 = (0, 0);
+
+ penpos1 (thick, 2 thick_nibangle);
+ penpos2 (thick, thick_nibangle);
+ penpos3 (thin, -90);
+ penpos4 (ball_nib_thick, 180 - thick_nibangle);
+
+ save swoosh, ploop;
+ path swoosh, ploop;
+
+ swoosh := z1l{curl 0}
+ .. z2l
+ .. z3l{right}
+ .. {down}z4l
+ -- z4r
+ .. z3r{left}
+ .. z2r{down};
+ fill swoosh
+ .. (swoosh scaled -1)
+ .. cycle;
+
+ y5r = y4;
+ x5r = x4l - ball_diam / 2;
+ z6r = z5r;
+
+ penpos5 (1.6 ball_diam / 2, 100);
+ penpos6 (ball_diam / 2, 240);
+
+ ploop := z4l{down}
+ .. z5l
+ .. z6l
+ -- cycle;
+ fill ploop;
+ fill ploop scaled -1;
+
+ penpos7 (2 thin, 0);
+ z7l = (-b, -d);
+ penpos8 (2 thin, 0);
+ z8r = (w, h);
+
+ penstroke z7e
+ -- z8e;
+
+ pickup pencircle scaled 2 thin;
+ drawdot (-x2r, pointheight);
+ drawdot (x2r, -pointheight);
+
+ penlabels (range 1 thru 8);
+fet_endchar;
+
+
+fet_beginchar ("Coda", "coda");
+ save stickout, thin, thick, codawidth, codaheight;
+
+ stickout# = 0.35 staff_space#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = staff_space#;
+ define_pixels (codawidth, codaheight);
+
+ set_char_box (codawidth# + stickout#, codawidth# + stickout#,
+ codaheight# + stickout#, codaheight# + stickout#);
+
+ thin = 1.2 linethickness;
+ 0.1 (codaheight - 2 thin) = (codawidth - 2 thick);
+
+ penpos1 (thick, 0);
+ penpos2 (thin, -90);
+ penpos3 (thick, -180);
+ penpos4 (thin, -270);
+
+ x1l = -codawidth;
+ y2l = codaheight;
+ y1 = 0;
+ x2 = 0;
+ z3 = -z1;
+ z4 = -z2;
+
+ penlabels (1, 2, 3, 4);
+
+ fill z1l{up}
+ .. z2l{right}
+ .. z3l{down}
+ .. z4l{left}
+ .. cycle;
+ unfill z1r{up}
+ .. z2r{right}
+ .. z3r{down}
+ .. z4r{left}
+ .. cycle;
+
+ draw_gridline ((0, -h), (0, h), thin);
+ draw_gridline ((-w, 0), (w, 0), thin);
+fet_endchar;
+
+
+fet_beginchar ("Varied Coda", "varcoda");
+ save thin, thick, codawidth, codaheight;
+ thin# = 1.2 linethickness#;
+ thick# = 1.0 linethickness# + 0.25 staff_space#;
+ codawidth# = 2/3 staff_space#;
+ codaheight# = staff_space#;
+ define_pixels (thin, thick, codawidth, codaheight);
+
+ set_char_box (codawidth# + thick#, codawidth# + thick#,
+ codaheight# + thick#, codaheight# + thick#);
+
+ x1 = -codawidth + thick - .5 blot_diameter;
+ y1 = y2 - thin;
+ x2 = codawidth - thick + .5 blot_diameter;
+ y2 = codaheight;
+ draw_square_block (z1, z2);
+
+ x3 = -codawidth;
+ y3 = -codaheight;
+ x4 = x3 + thick;
+ y4 = y2;
+ draw_block (z3, z4);
+
+ labels (1, 2, 3, 4);
+
+ addto currentpicture also currentpicture scaled -1;
+
+ draw_gridline ((0, -h), (0, h), thin);
+ draw_gridline ((-w, 0), (w, 0), thin);
+fet_endchar;
+
+
+def draw_comma =
+ save alpha, thick, thin, ht;
+
+ alpha := 35;
+ thin# = 1.2 linethickness#;
+ thick# = 3 linethickness#;
+ ht# = .6 staff_space#;
+ define_pixels (thin, thick, ht);
+
+ set_char_box (0, .5 staff_space#, ht#, ht#);
+
+ penpos1 (thick, alpha);
+ penpos2 (thick, alpha + 90);
+ penpos3 (thin, 180 - alpha);
+ penpos4 (thin, 90 - alpha);
+
+ x3r = 0;
+ x1l = x3l;
+ y2r = -y4l = h;
+ z1 = z2;
+ z3 = z4;
+
+ fill z1l{dir (alpha + 90)}
+ .. z2r{dir alpha}
+ .. z1r{dir (alpha - 90)}
+ .. z3l{dir (270 - alpha)}
+ .. z4l{dir (180 - alpha)}
+ .. z3r{dir (90-alpha)}
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Right Comma", "rcomma");
+ draw_comma;
+ penlabels (1, 2, 3, 4);
+fet_endchar;
+
+
+fet_beginchar ("Left Comma", "lcomma");
+ draw_comma;
+ xy_mirror_char;
+fet_endchar;
+
+
+def draw_varcomma =
+ save thick, thin, ht, wd, alpha;
+
+ alpha := 35;
+ thin# = 1.2 linethickness#;
+ thick# = 3 linethickness#;
+ ht# = .6 staff_space#;
+ wd# = .25 staff_space#;
+ define_pixels (thin, thick, ht, alpha);
+
+ set_char_box (wd#, wd#, ht#, ht#);
+
+ z1 = (-b, -d);
+ z2 = (w, h);
+
+ draw_brush (z1, thin, z2, thick);
+enddef;
+
+
+fet_beginchar ("Right Varied Comma", "rvarcomma");
+ draw_varcomma;
+ labels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("Left Varied Comma", "lvarcomma");
+ draw_varcomma;
+ xy_mirror_char;
+fet_endchar;
+
+
+thick# := 1/24 designsize;
+define_blacker_pixels (thick);
+
+rthin := 0.075 * staff_space + 0.5 linethickness;
+rthick := 2 thick + rthin;
+
+
+def draw_arpeggio =
+ save alpha;
+ save ne, nw, se, sw;
+ save x, y;
+ pair ne, nw, se, sw;
+
+ alpha := -40;
+
+ nw = dir (alpha + 180);
+ ne = dir (alpha + 90);
+ se = dir alpha;
+ sw = dir (alpha - 90);
+
+ penpos1 (rthin, alpha + 90);
+ penpos2 (5/4 rthick, alpha);
+ penpos3 (3/4 rthick, alpha);
+ penpos4 (5/4 rthick, alpha);
+ penpos5 (rthin, alpha + 90);
+
+ z1 = (width / 2, height) - overshoot * se;
+ z2 = 2 [z4, (width / 2, height / 2)];
+ z3 = 1/2 [z2, z4];
+ x4 = 2/8 staff_space;
+ y4 = rthin;
+
+ z5 = 2 [z1, (width / 2, height / 2)];
+ z6 = z2l + 1/2 rthin * sw;
+ z7 = z4l + 1/2 rthin * sw + 1/2 rthin * se;
+ z8 = 2 [z6, (width / 2, height / 2)];
+ z9 = 2 [z7, (width / 2, height / 2)];
+
+ fill z1l{se}
+ -- z6
+ .. z3l
+ .. z7{se}
+ -- z5l
+ .. z5r{nw}
+ -- z8
+ .. z3r
+ .. z9{nw}
+ -- z1r
+ .. cycle;
+enddef;
+
+
+fet_beginchar ("Arpeggio", "arpeggio");
+ save height, overshoot, width;
+ height# = staff_space#;
+ width# = 0.8 height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height, overshoot, width);
+
+ set_char_box (0, width#, 0, height#);
+ draw_arpeggio;
+ penlabels (range 1 thru 9);
+
+ draw_staff (-2, 2, 0.0);
+fet_endchar;
+
+
+%
+% Extendable Trill symbol.
+% Not yet used
+% Rename me to Trill, rename Trill to Tr?
+%
+
+fet_beginchar ("Trill_element", "trill_element");
+ save height, overshoot;
+ height# = staff_space#;
+ width# = 0.8 height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height, overshoot, width);
+
+ set_char_box (0, height#, 0, width#);
+ draw_arpeggio;
+
+ currentpicture := currentpicture shifted -(width / 2, height / 2);
+ currentpicture := currentpicture rotated 90;
+ currentpicture := currentpicture shifted (height / 2, width / 2);
+fet_endchar;
+
+
+%
+% Arpeggio arrow by Chris Jackson <chris@fluffhouse.org.uk>
+%
+
+def draw_arpeggio_arrow =
+ save thinness, height, width, overshoot;
+ save nw, ne, se, sw;
+ save alpha;
+ save before_left, before_right, after_left, after_right;
+ save u_left, v_left, u_right, v_right;
+ pair nw, ne, se, sw;
+ path before_left, before_right, after_left, after_right;
+
+ height# = staff_space#;
+ width# = 0.8 height#;
+ overshoot# = 0.25 staff_space#;
+ define_pixels (height, overshoot, width);
+
+ set_char_box (0, width#, 0, height#);
+
+ alpha := -40;
+ nw = dir (alpha + 180);
+ ne = dir (alpha + 90);
+ se = dir alpha;
+ sw = dir (alpha - 90);
+
+ penpos1 (rthin, alpha + 90);
+ penpos2 (5/4 rthick, alpha);
+ penpos3 (5/4 rthick, 0);
+
+ z1 = (width / 2, height) - overshoot * se; % numbering is consistent
+ % with the arpeggio symbol
+ z2 = 2 [z4, (width / 2, height / 2)];
+ z3 = (0.5 width, 0.5 height);
+ z4 = (0.25 staff_space, rthin);
+ z6 = z2l + 1/2 rthin * sw;
+ z9 = (width / 2, height) + overshoot * se;
+
+ pickup pencircle scaled vround (0.5 rthin);
+
+ bot z10 = (0.5 w, 0);
+ lft z11 = (0.5 w - hround (0.8 w), 0.8 h);
+ rt z12 = (0.5 w + hround (0.8 w), 0.8 h);
+
+ before_left := z1l
+ -- z6{z6 - z1l}
+ .. {down}z3l;
+ after_left := (z3 + (0, -0.25 rthin / cosd (angle (nw))))
+ -- (z11 + 0.25 rthin * ne);
+ (u_left, v_left) = before_left intersectiontimes after_left;
+
+ before_right := (z12 + 0.25 rthin * nw)
+ -- (z3 + (0, -0.25 rthin / cosd (angle (nw))));
+ after_right := z3r{up}
+ .. z9{z1r - z9}
+ -- z1r;
+ (u_right, v_right) = before_right intersectiontimes after_right;
+
+ fill subpath (0, u_left) of before_left
+ .. subpath (v_left, infinity) of after_left
+ .. top z11
+ .. lft z11
+ .. {dir -50}(z11 + 0.25 rthin * sw)
+ .. (z10 + 0.25 rthin * sw){dir -70}
+ .. bot z10
+ .. {dir 70}(z10 + 0.25 rthin * se)
+ .. (z12 + 0.25 rthin * se){dir 50}
+ .. rt z12
+ .. top z12
+ .. subpath (0, u_right) of before_right
+ .. subpath (v_right, infinity) of after_right
+ .. cycle;
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if not known miterlimit:
+ pickup pencircle scaled 0.7 rthin;
+ draw z1
+ -- (z9 + 0.5 rthin * dir (alpha - 90));
+ fi;
+enddef;
+
+
+fet_beginchar ("Arpeggio arrow down", "arpeggio.arrow.M1");
+ draw_arpeggio_arrow;
+ penlabels (range 1 thru 12);
+fet_endchar;
+
+
+fet_beginchar ("Arpeggio arrow up", "arpeggio.arrow.1");
+ draw_arpeggio_arrow;
+ currentpicture := currentpicture scaled -1
+ shifted (w - feta_eps, h - feta_eps);
+fet_endchar;
+
+
+% Hmm
+input feta-trills;
+
+
+%
+% Railroad tracks. We define two variants of these -- both as slightly
+% tapered, comma-shaped curves and as two straight parallel slashes.
+%
+
+fet_beginchar ("Curved caesura", "caesura.curved");
+ save slant, space_between, clearance;
+ save alpha, pat;
+ save botthick, topthick;
+ save krom;
+ path pat;
+
+ botthick = 1.5 linethickness;
+ topthick = 2.5 linethickness;
+
+ pickup pencircle scaled botthick;
+
+ slant = 3.5;
+ space_between# = 0.6 staff_space#;
+ clearance# = 0.2 staff_space#;
+ height# = 1.2 staff_space#;
+
+ set_char_box (0, 2.0 staff_space#,
+ staff_space# - clearance#, height#);
+ define_pixels (clearance, height);
+ define_whole_pixels (space_between);
+
+ bot y1 = -d;
+ top y2 = h;
+
+ lft x1 = 0;
+ x2 = (y2 - y1) / slant;
+
+ krom = 10;
+
+ alpha = angle (z2 - z1);
+ penpos1 (botthick, alpha - krom);
+ penpos3 (botthick, alpha - krom + 90);
+
+ penpos2 (topthick, alpha + krom);
+ penpos4 (topthick, alpha + krom + 90);
+
+ z3 = z1;
+ z4 = z2;
+
+ penlabels (1, 2, 3, 4);
+
+ pat := z3r{(z1r - z1l)}
+ .. z4r{z2r-z2l}
+ .. z2r{z4l-z4r}
+ .. z4l{z2l-z2r}
+ .. z3l{z1l-z1r}
+ .. z1l{z3r-z3l}
+ .. cycle;
+ fill pat;
+ fill pat shifted (space_between, 0);
+fet_endchar;
+
+
+fet_beginchar ("Straight caesura", "caesura.straight");
+ save slant, space_between, clearance;
+ save thick, ne, pat;
+ path pat;
+ pair ne;
+
+ slant = 2.0;
+ thick = 2.88 linethickness;
+
+ space_between# = 0.56 staff_space#;
+ clearance# = 0.2 staff_space#;
+
+ set_char_box (0, 2.0 staff_space#,
+ staff_space# - clearance#, 1.2 staff_space#);
+ define_whole_pixels (space_between);
+
+ x1 = 0;
+ x2 = x1 + thick;
+ y1 = y2 = -d;
+
+ x3 = x4 + thick;
+ x4 = x1 + (h + d) / slant;
+ y3 = y4 = h;
+
+ ne = unitvector (z4 - z1);
+
+ z1a = z1 + blot_diameter * ne;
+ z1b = z1 + blot_diameter * right;
+ z2a = z2 + blot_diameter * ne;
+ z2b = z2 + blot_diameter * left;
+
+ z3a = z3 - blot_diameter * ne;
+ z3b = z3 + blot_diameter * left;
+ z4a = z4 - blot_diameter * ne;
+ z4b = z4 + blot_diameter * right;
+
+ pat = z1a{-ne}
+ .. {right}z1b
+ -- z2b{right}
+ .. {ne}z2a
+ -- z3a{ne}
+ .. {left}z3b
+ -- z4b{left}
+ .. {-ne}z4a
+ -- cycle;
+
+ fill pat;
+ fill pat shifted (space_between, 0);
+
+ labels(range 1 thru 4);
+ labels(1a, 1b, 2a, 2b, 3a, 3b, 4a, 4b);
+fet_endchar;
+
+
+fet_beginchar ("snap pizzicato (Bartok pizzicato)", "snappizzicato");
+ save height, width, thickness, superness;
+
+ height# = 4/15 staffsize#;
+ width# = height#;
+ thickness# = 1.3 linethickness#;
+ define_pixels (height, width);
+ define_whole_blacker_pixels (thickness);
+
+ set_char_box (width# / 2, width# / 2, height# / 2, height# * 3 / 4);
+
+ penpos1 (thickness, 90);
+ penpos2 (thickness, 180);
+ penpos3 (thickness, 270);
+ penpos4 (thickness, 0);
+
+ x1 = 0;
+ y1r = height / 2;
+ x3 = x1;
+ y3r = -y1r;
+ x4r = width / 2;
+ y4 = 0;
+ x2r = -x4r;
+ y2 = y4;
+
+ penlabels (1, 2, 3, 4);
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if known miterlimit:
+ penstroke z1e
+ .. z2e
+ .. z3e
+ .. z4e
+ .. cycle;
+ else:
+ pickup pencircle scaled thickness;
+ draw z1
+ .. z2
+ .. z3
+ .. z4
+ .. cycle;
+ fi;
+
+ z5 = (0, 0);
+ z6 = (x5, 1.5 y1r);
+
+ draw_gridline (z5, z6, thickness);
+
+ labels (5, 6);
+fet_endchar;
+
+fet_endgroup ("scripts");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- implement trill symbols
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-% this file is included by feta-scripts.mf
-
-trill_thin# = 0.1 staff_space# + 0.6 stafflinethickness#;
-trill_stemwidth# = trill_thin#;
-define_pixels (trill_thin);
-define_whole_blacker_pixels (trill_stemwidth);
-
-trill_thick = 1/2 staff_space;
-trill_overlap = 1/6 staff_space;
-
-trill_width# = 5/6 staff_space#;
-trill_height# = 1/2 staff_space#;
-define_pixels (trill_height);
-define_whole_pixels (trill_width);
-
-pair trill_ne;
-trill_ne := unitvector ((2, 3));
-
-
-%
-% The trill element sticks out on both the left and right side
-% of the normal bbox, so you can glue them together easily.
-%
-% `ending' is either 0 for none, 1 for left, or 2 for right.
-%
-
-def draw_trillelement (expr offset, ending) =
- clearxy;
-
-begingroup;
- save nw, pat, nw_dist, ne_dist;
- pair nw, nw_dist, ne_dist;
- path pat;
-
- pickup pencircle scaled trill_thin;
-
- x1 = -.5 trill_width;
- y1 = 0;
- z3 = whatever * trill_ne + z1;
- top y3 = vround trill_height;
- z2 = z3 - (trill_thick - trill_thin) * trill_ne;
-
- bot z3' = (top z3) scaled -1;
-
- nw = unitvector (z2 - z3');
- ne_dist = (nw rotated -90) * 0.5 trill_thin;
- nw_dist = (trill_ne rotated 90) * 0.5 trill_thin;
-
- z5 = whatever * trill_ne + (z1 - nw_dist);
- z5 = whatever * nw + (z3' - ne_dist);
-
- pat := z5
- -- (z1 - nw_dist){-trill_ne}
- -- (z1 + nw_dist){trill_ne}
- -- (z3 + nw_dist){trill_ne}
- .. top z3{right}
- .. (z3 + ne_dist){-nw};
- pat := pat
- -- pat scaled -1 shifted (-feta_eps, -feta_eps)
- -- cycle;
- pat := pat shifted (offset, 0);
- fill pat;
-
- z4 = z1 - trill_ne * trill_overlap;
- x4 := hround (x4 + 0.5 trill_thin) - 0.5 trill_thin;
-
- pat := (z4 - nw_dist){-trill_ne}
- .. bot z4{left}
- .. lft z4{up}
- .. (z4 + nw_dist){trill_ne}
- -- (z1 + nw_dist){trill_ne}
- -- (z1 - nw_dist){-trill_ne}
- -- cycle;
-
- if ending = 1:
- fill pat shifted (offset, 0);
- elseif ending = 2:
- pat := pat scaled -1 shifted (-feta_eps, -feta_eps);
- fill pat shifted (offset, 0);
- fi;
-endgroup;
-enddef;
-
-
-fet_beginchar ("trilelement", "trilelement");
- set_char_box (.5 trill_width#, .5 trill_width#,
- trill_height#, trill_height#);
-
- draw_trillelement (0, 0);
- labels (1, 2, 3, 3', 4, 5, 5');
-fet_endchar;
-
-
-fet_beginchar ("prall", "prall");
- set_char_box (trill_width#, trill_width#,
- trill_height#, trill_height#);
-
- draw_trillelement (-hround (.5 trill_width), 1);
- draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
-fet_endchar;
-
-
-fet_beginchar ("mordent", "mordent");
- set_char_box (trill_width#, trill_width#,
- 4/3 trill_height#, 4/3 trill_height#);
-
- draw_trillelement (-hround (.5 trill_width), 1);
- draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
-
- clearxy;
-
- pickup pencircle scaled trill_stemwidth;
-
- top y1 = h;
- bot y2 = -d;
- x1 = x2;
- x2 = 0;
-
- draw_gridline (z2, z1, trill_stemwidth);
-
- labels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("prallprall", "prallprall");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, trill_height#);
-
- draw_trillelement (-trill_width, 1);
- draw_trillelement (0, 0);
- draw_trillelement (trill_width, 2);
-fet_endchar;
-
-
-fet_beginchar ("prallmordent", "prallmordent");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- 4/3 trill_height#, 4/3 trill_height#);
-
- draw_trillelement (-trill_width, 1);
- draw_trillelement (0, 0);
- draw_trillelement (trill_width, 2);
-
- clearxy;
-
- pickup pencircle scaled trill_stemwidth;
-
- top y1 = h;
- bot y2 = -d;
- x1 = x2 ;
- x2 = good.x (.5 trill_width);
-
- draw_gridline (z2, z1, trill_stemwidth);
-
- labels (1, 2);
-fet_endchar;
-
-
-save remember_pic;
-picture remember_pic;
-
-
-fet_beginchar ("upprall", "upprall");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, trill_height#);
-
- draw_trillelement (-trill_width, 1);
- draw_trillelement (0, 0);
- draw_trillelement (trill_width, 2);
-
- z11 = z4 shifted (-trill_width, 0);
- z12 = z11 + (0, -2 trill_height);
-
- penpos11 (trill_thin, angle (trill_ne) - 90);
- penpos12 (trill_thin, angle (trill_ne yscaled -1) + 90);
- penlabels (11, 12);
-
- pickup pencircle scaled trill_stemwidth;
-
- fill z11l{-trill_ne}
- .. z12l{trill_ne yscaled -1}
- .. bot z12
- .. rt z12
- .. z12r{-trill_ne yscaled -1}
- .. z11r{trill_ne}
- -- cycle;
-
- remember_pic := currentpicture;
-fet_endchar;
-
-
-fet_beginchar ("upmordent", "upmordent");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- 4/3 trill_height#, 4/3 trill_height#);
-
- currentpicture := remember_pic;
-
- clearxy;
-
- pickup pencircle scaled trill_stemwidth;
-
- top y1 = h;
- bot y2 = -d;
- x1 = x2;
- x2 = good.x (.5 trill_width);
-
- draw_gridline (z2, z1, trill_stemwidth);
-
- labels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("pralldown", "pralldown");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, trill_height#);
-
- currentpicture := remember_pic xscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("downprall", "downprall");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, trill_height#);
-
- draw_trillelement (-trill_width, 1);
- draw_trillelement (0, 0);
- draw_trillelement (trill_width, 2);
-
- z11 = z4 shifted (-trill_width, 0);
- z12 = z11 + (0, 2 trill_height);
-
- penpos11 (trill_thin, angle (trill_ne xscaled -1) - 90);
- penpos12 (trill_thin, angle (trill_ne) - 90);
- penlabels (11, 12);
-
- pickup pencircle scaled trill_stemwidth;
-
- fill z11l{trill_ne xscaled -1}
- .. z12l{trill_ne}
- .. top z12
- .. rt z12
- .. z12r{-trill_ne}
- .. z11r{-trill_ne xscaled -1}
- -- cycle;
-
- remember_pic := currentpicture;
-fet_endchar;
-
-
-fet_beginchar ("downmordent", "downmordent");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- 4/3 trill_height#, 4/3 trill_height#);
-
- currentpicture := remember_pic;
-
- clearxy;
-
- pickup pencircle scaled trill_stemwidth;
-
- top y1 = h;
- bot y2 = -d;
- x1 = x2;
- x2 = good.x (.5 trill_width);
-
- draw_gridline (z2, z1, trill_stemwidth);
-
- labels (1, 2);
-fet_endchar;
-
-
-fet_beginchar ("prallup", "prallup");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, trill_height#);
-
- currentpicture := remember_pic xscaled -1;
-fet_endchar;
-
-
-fet_beginchar ("lineprall", "lineprall");
- set_char_box (1.5 trill_width#, 1.5 trill_width#,
- trill_height#, 4 trill_height#);
-
- draw_trillelement (-trill_width, 1);
-
- labels (1, 2, 3, 3', 4, 5, 5');
-
- pickup pencircle scaled trill_stemwidth;
-
- penpos10 (trill_stemwidth, 0);
- penpos11 (trill_stemwidth, 0);
-
- x10l = x4 - .5 trill_thin - trill_width;
- y10 = y4;
- z11 = z10 + (0, h);
-
- penlabels (10, 11);
-
- fill z11l
- .. top z11
- .. z11r
- -- z10r
- -- z10l
- -- cycle;
-
- draw_trillelement (0, 0);
- draw_trillelement (trill_width, 2);
-fet_endchar;
% in a separate file to avoid tainting non-test font files for testing.
%
-%input feta-eindelijk;
-input feta-toevallig;
-%input feta-puntje;
-%input feta-bolletjes;
-%input feta-arrow;
-%input feta-schrift;
-%input feta-schrift;
-%input feta-banier;
-% input feta-slag;
-%input feta-klef;
-%input feta-haak;
-% input feta-haak;
-%input feta-timesig;
-%input feta-pendaal;
+%input feta-rests;
+input feta-accidentals;
+%input feta-dots;
+%input feta-noteheads;
+%input feta-arrowheads;
+%input feta-scripts;
+%input feta-flags;
+%input feta-trills;
+%input feta-clefs;
+%input feta-brackettips;
+%input feta-timesignatures;
+%input feta-pedals;
%input feta-accordion;
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- implement Time Signatures
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1998--2009 Mats Bengtsson <matsb@s3.kth.se>,
-% Christian Mondrup <scancm@biobase.dk>
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("timesig");
-
-
-%
-% Originally by Mats B. nuked by Han-Wen, inspired by
-% Baerenreiter BA320 (Bach Cello Suites, Suite III).
-%
-% Notes:
-%
-% * The inside curve of the C is rather straight.
-% * The outside curve of the C is rather round.
-% * Right tips of the C point slightly outward.
-% * Lower tip protrudes to the right very slightly.
-%
-
-def draw_C =
- save hair, bulb_rad, left_fatness;
- save left_width, right_width;
- save width, lower_offset;
-
- width# := 1.8 staff_space# - stafflinethickness#;
-
- left_width := 1.0 staff_space;
- right_width := 0.8 staff_space;
-
- hair := stafflinethickness;
-
- bulb_rad := 0.40 staff_space - .6 stafflinethickness;
- left_fatness := 0.55 * staff_space;
- lower_offset := 0.3 stafflinethickness;
-
- set_char_box (0, width#, staff_space#, staff_space#);
-
- d := d - feta_shift;
-
- x1r = w;
- x3r = 0;
- y1r = .45 h;
- y2r = h + vround (.5 stafflinethickness_rounded);
- y4r = -d - vround (.5 stafflinethickness_rounded);
- x2 = x4;
- x2 = x3r + h;
- y3r = .5 (h - d);
-
- x5r = x1r + lower_offset;
- y5r = -0.37 h;
-
- penpos1 (hair, 10);
- penpos2 (stafflinethickness_rounded, 90);
- penpos3 (left_fatness, 180);
- penpos4 (stafflinethickness_rounded, -90);
- penpos5 (hair, -13);
-
- draw_bulb (-1, z1l, z1r, bulb_rad, .8);
-
- save s;
- s := 0.735;
-
- fill z1l{dir (100)}
- .. z2l{left}
- ..tension 0.8.. z3l{down}
- ..tension 0.8.. z4l{right}
- .. simple_serif (z5l, z5r, -90)
- .. z4r{left}
- .. super_curvelet (z4r, z3r, s, -1)
- .. z3r{up}
- .. super_curvelet (z3r, z2r, s, 1)
- .. z2r{right}
- .. {dir (-80)}z1r
- -- cycle;
-
- penlabels (1, 2, 3, 4, 5);
-
- draw_staff (-2, 2, 0);
-enddef;
-
-
-fet_beginchar ("4/4 meter", "C44");
- draw_C;
-fet_endchar;
-
-
-fet_beginchar ("2/2 meter", "C22");
- save eccentricity, top_stemlen, bottom_stemlen, thick, left_pos;
-
- draw_C;
-
- eccentricity = -1.75 stafflinethickness - 0.025 staff_space;
- top_stemlen# = bottom_stemlen# = 1.4 staff_space#;
- thick# = stafflinethickness# + 0.05 staff_space#;
- define_whole_pixels (top_stemlen, bottom_stemlen);
- define_whole_blacker_pixels (thick);
-
- bottom_stemlen := bottom_stemlen - feta_shift;
-
- draw_block ((x2 + eccentricity, -bottom_stemlen),
- (x2 + eccentricity + thick, top_stemlen));
-fet_endchar;
-
-fet_endgroup ("timesig");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- implement Time Signatures
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1998--2009 Mats Bengtsson <matsb@s3.kth.se>,
+% Christian Mondrup <scancm@biobase.dk>
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("timesig");
+
+
+%
+% Originally by Mats B. nuked by Han-Wen, inspired by
+% Baerenreiter BA320 (Bach Cello Suites, Suite III).
+%
+% Notes:
+%
+% * The inside curve of the C is rather straight.
+% * The outside curve of the C is rather round.
+% * Right tips of the C point slightly outward.
+% * Lower tip protrudes to the right very slightly.
+%
+
+def draw_C =
+ save hair, bulb_rad, left_fatness;
+ save left_width, right_width;
+ save width, lower_offset;
+
+ width# := 1.8 staff_space# - stafflinethickness#;
+
+ left_width := 1.0 staff_space;
+ right_width := 0.8 staff_space;
+
+ hair := stafflinethickness;
+
+ bulb_rad := 0.40 staff_space - .6 stafflinethickness;
+ left_fatness := 0.55 * staff_space;
+ lower_offset := 0.3 stafflinethickness;
+
+ set_char_box (0, width#, staff_space#, staff_space#);
+
+ d := d - feta_shift;
+
+ x1r = w;
+ x3r = 0;
+ y1r = .45 h;
+ y2r = h + vround (.5 stafflinethickness_rounded);
+ y4r = -d - vround (.5 stafflinethickness_rounded);
+ x2 = x4;
+ x2 = x3r + h;
+ y3r = .5 (h - d);
+
+ x5r = x1r + lower_offset;
+ y5r = -0.37 h;
+
+ penpos1 (hair, 10);
+ penpos2 (stafflinethickness_rounded, 90);
+ penpos3 (left_fatness, 180);
+ penpos4 (stafflinethickness_rounded, -90);
+ penpos5 (hair, -13);
+
+ draw_bulb (-1, z1l, z1r, bulb_rad, .8);
+
+ save s;
+ s := 0.735;
+
+ fill z1l{dir (100)}
+ .. z2l{left}
+ ..tension 0.8.. z3l{down}
+ ..tension 0.8.. z4l{right}
+ .. simple_serif (z5l, z5r, -90)
+ .. z4r{left}
+ .. super_curvelet (z4r, z3r, s, -1)
+ .. z3r{up}
+ .. super_curvelet (z3r, z2r, s, 1)
+ .. z2r{right}
+ .. {dir (-80)}z1r
+ -- cycle;
+
+ penlabels (1, 2, 3, 4, 5);
+
+ draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("4/4 meter", "C44");
+ draw_C;
+fet_endchar;
+
+
+fet_beginchar ("2/2 meter", "C22");
+ save eccentricity, top_stemlen, bottom_stemlen, thick, left_pos;
+
+ draw_C;
+
+ eccentricity = -1.75 stafflinethickness - 0.025 staff_space;
+ top_stemlen# = bottom_stemlen# = 1.4 staff_space#;
+ thick# = stafflinethickness# + 0.05 staff_space#;
+ define_whole_pixels (top_stemlen, bottom_stemlen);
+ define_whole_blacker_pixels (thick);
+
+ bottom_stemlen := bottom_stemlen - feta_shift;
+
+ draw_block ((x2 + eccentricity, -bottom_stemlen),
+ (x2 + eccentricity + thick, top_stemlen));
+fet_endchar;
+
+fet_endgroup ("timesig");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- Accidentals
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-
-%
-% also show in other configuration wrt staff lines.
-%
-def draw_shifted_too =
-if test > 0:
- fet_beginchar ("shifted too", "");
- set_char_box (0, 0, 0, 0);
- currentpicture := remember_pic;
-
- draw_staff (-2, 2, 0.5);
- fet_endchar;
-fi;
-enddef;
-
-
-%
-% Accidentals from various sources, notably
-%
-% Baerenreiter edition of Schuberts `Auf dem Strom' (sharp, natural)
-% F Hofmeister edition of Muellers `Etueden fuer Horn' (double sharp, flat)
-%
-
-
-%
-% Naming for accidentals (including microtonal variants):
-%
-% SHARPBASE[.SLASHES.STEMS]
-% FLATBASE[.MODIFIER]
-%
-% Examples:
-%
-% sharp.slashslash.stem
-% mirroredflat.flat
-%
-%
-
-
-fet_begingroup ("accidentals");
-
-%
-% Draw an arrow
-%
-% * `stemslant' gives the direction of the stem's left boundary
-% (needed for brushed stems, equals "up" for straight stems)
-% * `extend' is used to make the stem longer or shorter (if negative);
-% different kinds of accidentals need different values here
-%
-def draw_arrow (expr attach, stemwidth, stemslant, extend, pointingdown) =
-begingroup;
- save htip; % tip height
- save wwing; % wing `radius'
- save angle_wing_bot, angle_wing_top, angle_tip;
- save upshift;
- clearxy;
-
- wwing := 0.26 stemwidth;
- htip := staff_space * 0.85 + stafflinethickness - wwing;
-
- % `flip' is used to reflect the arrow vertically
- % if arrow points downward
- transform flip;
- if pointingdown:
- flip = identity reflectedabout (origin, right);
- else:
- flip = identity;
- fi;
-
- z1 = attach shifted (-stemwidth / 2, 0);
- upshift := max (0, wwing + 0.1 staff_space + extend);
- z2 = z1 shifted (((unitvector stemslant)
- scaled upshift) transformed flip);
-
- z7 = attach shifted ((stemwidth/2),0);
- z6 = z7 shifted (((unitvector (-xpart stemslant, ypart stemslant))
- scaled upshift) transformed flip);
- z2 - z3 = ( 0.38 staff_space, 0.05 htip) transformed flip;
- z6 - z5 = (-0.38 staff_space, 0.05 htip) transformed flip;
-
- z4 = attach shifted ((-0.2 stemwidth, upshift + htip)
- transformed flip);
- z4'= attach shifted (( 0.2 stemwidth, upshift + htip)
- transformed flip);
-
- % `angle_wing_bot' is the angle at which the arc
- % from z2 to z3a enters z3a
- % `angle_wing_top' is the angle at which the arc
- % from z3b to z4 leaves z3b
- % `angle_tip' is the angle at which the arc
- % from z4 to z4' leaves z4
- angle_wing_bot = 30;
- angle_wing_top = 55;
- angle_tip = 68;
-
- z3a = z3 shifted ((((dir angle_wing_bot) rotated -90)
- scaled wwing) transformed flip);
- z3b = z3 shifted ((((dir angle_wing_top) rotated 90)
- scaled wwing) transformed flip);
-
- z5a = z5 shifted ((((dir (180 - angle_wing_bot)) rotated 90)
- scaled wwing) transformed flip);
- z5b = z5 shifted ((((dir (180 - angle_wing_top)) rotated -90)
- scaled wwing) transformed flip);
-
- % Draw the arrow
- pickup pencircle scaled 1;
- fill z1
- -- z2{stemslant transformed flip}
- .. {(-dir angle_wing_bot) transformed flip}z3a
- .. z3b{(dir angle_wing_top) transformed flip}
- .. z4{(dir angle_tip) transformed flip}
- .. z4'{(dir (-angle_tip)) transformed flip}
- .. {(dir (-angle_wing_top)) transformed flip}z5b
- .. z5a{(-dir (-angle_wing_bot)) transformed flip}
- .. z6{((-stemslant) reflectedabout (origin, up)) transformed flip}
- -- z7
- -- cycle;
-
- labels (range 0 thru 7, 4', 3a, 3b, 5a, 5b);
-endgroup;
-enddef;
-
-save remember_pic;
-picture remember_pic;
-
-save sharp_beamheight;
-sharp_beamheight# := 0.3 staff_space# + stafflinethickness#;
-
-%
-% The beams of most sharps have horizontal endings (as if drawn with
-% a square pen). [Wanske] does not mention this, so we'll just ignore
-% this fact.
-%
-
-def draw_meta_sharp (expr width, offset) =
- save beamwidth, beamslope;
- save ne, nw_dist;
- pair ne, nw_dist;
-
- beamwidth := width;
-
- define_whole_vertical_blacker_pixels (sharp_beamheight);
-
- clearxy;
-
- beamslope = sharp_beamheight / beamwidth;
-
- pickup pencircle scaled 2 blot_diameter;
-
- rt x2 - lft x1 = beamwidth;
- z2 = z1 + whatever * (beamwidth, sharp_beamheight);
- .5 [z1, z3] = (.5 w, offset);
- x3 = x2;
- top y2 - bot y3 = sharp_beamheight;
- x4 = x1;
- top y1 - bot y4 = sharp_beamheight;
-
- ne = unitvector (z2 - z1);
- nw_dist = (ne rotated 90) * blot_diameter;
-
- fill lft z1{up}
- ... (z1 + nw_dist){ne}
- -- (z2 + nw_dist){ne}
- ... rt z2{down}
- -- rt z3{down}
- ... (z3 - nw_dist){-ne}
- -- (z4 - nw_dist){-ne}
- ... lft z4{up}
- -- cycle;
-
- labels (1, 2, 3, 4);
-enddef;
-
-
-def draw_sharp(expr arrowup, arrowdown) =
- save stem, stemx, stemwidth;
- save outer_space, interbeam;
- save stemlength, extendleft, extendright, height, depth;
-
- stemwidth# := stafflinethickness# + .05 staff_space#;
- define_whole_blacker_pixels (stemwidth);
-
- interbeam := 1.05 staff_space_rounded;
-
- stemlength# := 1.5 staff_space#;
- define_pixels (stemlength);
-
- height# = stemlength#;
- depth# = stemlength#;
- extendright# = 0;
- extendleft# = 0;
- if arrowup:
- height# := height# + 1.2 staff_space#;
- extendright# := extendright# + 1.5 stafflinethickness#;
- fi;
- if arrowdown:
- depth# := depth# + 1.2 staff_space#;
- extendleft# := extendleft# + 1.5 stafflinethickness#;
- fi;
- define_pixels (extendleft, extendright);
- set_char_box (extendleft#, 1.1 staff_space#, depth#, height#);
-
- stem := 7 / 16 * w;
- stemx := hround stem;
- outer_space := hround ((w - stemx - stemwidth) / 2);
-
- w := 2 outer_space + stemx + stemwidth;
- d := d - feta_space_shift;
-
- draw_meta_sharp (w, -.5 interbeam);
- draw_meta_sharp (w, -.5 interbeam + vround interbeam);
-
- % expand the charbox so that it encloses the whole arrow;
- % this must not happen earlier because some commands above
- % still rely on the old width
- w := w + extendright;
-
- pickup pencircle scaled stemwidth;
-
- lft x5 = lft x6 = outer_space;
- lft x7 = lft x8 = outer_space + stemx;
- bot y5 = -stemlength;
- top y6 = vround (1.5 staff_space - stem * beamslope);
- bot y7 = -top y6 + feta_space_shift;
- top y8 = stemlength;
-
- labels (5, 6, 7, 8);
-
- draw_gridline (z5, z6, stemwidth);
- draw_gridline (z7, z8, stemwidth);
-
- if arrowup:
- draw_arrow (z8, stemwidth, up,
- stafflinethickness / 2 + stemwidth / 2, false);
- fi;
- if arrowdown:
- draw_arrow (z5, stemwidth, up,
- stafflinethickness / 2 + stemwidth / 2, true);
- fi;
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-enddef;
-
-
-fet_beginchar ("Sharp", "sharp");
- draw_sharp (false, false);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Sharp (arrow up)", "sharp.arrowup");
- draw_sharp (true, false);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Sharp (arrow down)", "sharp.arrowdown");
- draw_sharp (false, true);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Sharp (arrows up and down)", "sharp.arrowboth");
- draw_sharp (true, true);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("1/2 Sharp", "sharp.slashslash.stem");
- save stem, stemwidth;
- save outer_space, interbeam;
-
- stemwidth# := stafflinethickness# + .05 staff_space#;
- define_whole_blacker_pixels (stemwidth);
-
- interbeam := 1.05 staff_space_rounded;
-
- set_char_box (0, 0.7 staff_space#,
- 1.5 staff_space#, 1.5 staff_space#);
-
- stem := 7 / 16 * w;
- outer_space := hround ((w - stemwidth) / 2);
-
- w := 2 outer_space + stemwidth;
- d := d - feta_space_shift;
-
- draw_meta_sharp (w, -.5 interbeam);
- draw_meta_sharp (w, -.5 interbeam + vround interbeam);
-
- pickup pencircle scaled stemwidth;
-
- lft x5 = lft x6 = outer_space;
- top y6 = vround (1.5 staff_space - .5 stem);
- bot y5 = -top y6 + feta_space_shift;
-
- labels (5, 6);
-
- draw_gridline (z5, z6, stemwidth);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Sharp (3 beams)", "sharp.slashslashslash.stemstem");
- save stem, stemx, stemwidth;
- save outer_space, interbeam;
- save sharp_beamheight;
-
- sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
-
- stemwidth# := stafflinethickness# + .05 staff_space#;
- define_whole_blacker_pixels (stemwidth);
-
- interbeam := 1.2 staff_space_rounded;
-
- set_char_box (0, 1.1 staff_space#,
- 1.5 staff_space#, 1.5 staff_space#);
-
- stem := 7 / 16 * w;
- stemx := hround stem;
- outer_space := hround ((w - stemx - stemwidth) / 2);
-
- w := 2 outer_space + stemx + stemwidth;
- d := d - feta_space_shift;
-
- draw_meta_sharp (.88 w, -.5 interbeam);
- draw_meta_sharp (.88 w, -.5 interbeam + vround interbeam);
- sharp_beamheight# := 1/.88 sharp_beamheight#;
- draw_meta_sharp (w, 0);
-
- pickup pencircle scaled stemwidth;
-
- lft x5 = lft x6 = outer_space;
- lft x7 = lft x8 = outer_space + stemx;
- bot y5 = -d;
- top y6 = vround (1.5 staff_space - stem * beamslope);
- bot y7 = -top y6 + feta_space_shift;
- top y8 = h;
-
- labels (5, 6, 7, 8);
-
- draw_gridline (z5, z6, stemwidth);
- draw_gridline (z7, z8, stemwidth);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("1/2 Sharp (3 beams)", "sharp.slashslashslash.stem");
- save stem, stemx, stemwidth;
- save outer_space, interbeam;
- save sharp_beamheight;
-
- sharp_beamheight# := 0.22 staff_space# + stafflinethickness#;
-
- stemwidth# := stafflinethickness# + .05 staff_space#;
- define_whole_blacker_pixels (stemwidth);
-
- interbeam := 1.2 staff_space_rounded;
-
- set_char_box (0, 0.95 staff_space#,
- 1.3 staff_space#, 1.3 staff_space#);
-
- stem := 7 / 16 * w;
- outer_space := hround ((w - stemwidth) / 2);
-
- w := 2 outer_space + stemwidth;
- d := d - feta_space_shift;
-
- draw_meta_sharp (.8 w, -.5 interbeam);
- draw_meta_sharp (.8 w, -.5 interbeam + vround interbeam);
- sharp_beamheight# := 1/.8 sharp_beamheight#;
- draw_meta_sharp (w, 0);
-
- pickup pencircle scaled stemwidth;
-
- lft x5 = lft x6 = outer_space;
- top y6 = vround (1.5 staff_space - .5 stem);
- bot y5 = -top y6 + feta_space_shift;
- labels (5, 6);
-
- draw_gridline (z5, z6, stemwidth);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("3/4 Sharp", "sharp.slashslash.stemstemstem");
- save stem, stemx, stemwidth;
- save outer_space, interbeam;
-
- stemwidth# := stafflinethickness# + .05 staff_space#;
- define_whole_blacker_pixels (stemwidth);
-
- interbeam := 1.05 staff_space_rounded;
-
- set_char_box (0, 1.6 staff_space#,
- 1.5 staff_space#, 1.5 staff_space#);
-
- stem := 9 / 32 * w;
- stemx := hround stem;
- outer_space := hround ((w - 2 stemx - stemwidth) / 2);
-
- w := 2 outer_space + 2 stemx + stemwidth;
- d := d - feta_space_shift;
-
- draw_meta_sharp (w, -.5 interbeam);
- draw_meta_sharp (w, -.5 interbeam + vround interbeam);
-
- pickup pencircle scaled stemwidth;
-
- lft x5 = lft x6 = outer_space;
- lft x7 = lft x8 = outer_space + stemx;
- lft x9 = lft x10 = outer_space + 2 stemx;
- bot y5 = -d;
- top y6 = vround (1.5 staff_space - 2 stem * beamslope);
- bot y9 = -top y6 + feta_space_shift;
- top y10 = h;
- y7 = .5 [y5, y9];
- y8 = .5 [y6, y10];
-
- labels (5, 6, 7, 8, 9, 10);
-
- draw_gridline (z5, z6, stemwidth);
- draw_gridline (z7, z8, stemwidth);
- draw_gridline (z9, z10, stemwidth);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-%
-% The stems of the natural are brushed (at least, in Barenreiter SCS)
-%
-
-def draw_natural (expr arrowup, arrowdown) =
- save stemwidth, top_stem_thick;
- save ne, pat_top, pat_bottom;
- save depth, height, extendleft, extendright, stemlength;
- save brush_scale_up, brush_scale_down;
- pair ne;
- path pat_top, pat_bottom;
-
- top_stem_thick# = stafflinethickness# + .10 staff_space#;
- stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
- define_whole_blacker_pixels (top_stem_thick, stemwidth);
-
- stemlength# = 1.5 staff_space#;
- define_pixels (stemlength);
-
- height# = stemlength#;
- depth# = stemlength#;
- extendleft# = 0;
- extendright# = 0;
- if arrowup:
- extendleft# := 3 stafflinethickness#;
- height# := height# + 1.2 staff_space#;
- fi;
- if arrowdown:
- extendright# := 3.15 stafflinethickness#;
- depth# := depth# + 1.2 staff_space#;
- fi;
- define_pixels (extendright);
-
- set_char_box (extendleft#, 2/3 staff_space#, depth#, height#);
-
- d := d - feta_space_shift;
-
- pickup pencircle scaled stemwidth;
-
- brush_scale_up := 1.0;
- brush_scale_down := 1.0;
- % to look nice, arrowed stems must be less brushed
- if arrowup:
- brush_scale_up := 0.85;
- fi;
- if arrowdown:
- brush_scale_down := 0.85;
- fi;
-
- penpos1 (top_stem_thick, 0);
- penpos3 (top_stem_thick, 0);
- penpos2 (stemwidth, 0);
- penpos4 (stemwidth, 0);
- % z1' and z3' are needed for the arrowed accidentals
- penpos1' (top_stem_thick * brush_scale_up, 0);
- penpos3' (top_stem_thick * brush_scale_down, 0);
-
- x2r = w;
- x4l = 0;
- x3 = x3' = x2;
- x1 = x1' = x4;
-
- y1 = y1' = stemlength;
- y3 = y3' = -stemlength;
- top y2 = vround (staff_space - 3/2 stafflinethickness);
- y4 = -y2 + feta_space_shift;
-
- pat_bottom := z4r{z4r - z1r}
- .. bot z4
- .. z4l{z1l - z4l};
- fill simple_serif (z1'l, z1'r, -30)
- -- pat_bottom
- -- cycle;
-
- pat_top := z2r{z2r - z3r}
- .. top z2
- .. z2l{z3l - z2l};
- fill simple_serif (z3'l, z3'r, 30)
- -- pat_top
- -- cycle;
-
- ne = (x2 - x4, stafflinethickness);
-
- z11' = z3l + whatever * (z2l - z3l);
- y11' = vround (.5 (staff_space - stafflinethickness));
- z11 = z11' + whatever * ne;
- x11 = x12;
- z12 = directionpoint -ne of pat_top;
- z13 = z12 + whatever * ne;
- x13 = x1;
- z14 = z11 + whatever * ne;
- x14 = x1;
-
- z21' = z4r + whatever * (z1r - z4r);
- y21' = -y11' + feta_space_shift;
- z21 = z21' + whatever * ne;
- x21 = x22;
- z22 = directionpoint -ne of pat_bottom;
- z23 = z22 + whatever * ne;
- x23 = x3;
- z24 = z21 + whatever * ne;
- x24 = x3;
-
- fill z11
- -- z12
- -- z13
- -- z14
- -- cycle;
- fill z21
- -- z22
- -- z23
- -- z24
- -- cycle;
-
- penlabels (1, 1', 2, 3, 3', 4);
- labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
-
- if arrowup:
- draw_arrow (z1, top_stem_thick * brush_scale_up,
- z1'l - z4l, stafflinethickness / 2, false);
- fi;
- if arrowdown:
- draw_arrow (z3, top_stem_thick * brush_scale_down,
- z2r - z3'r, stafflinethickness / 2, true);
- w := w + extendright;
- fi;
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-enddef;
-
-
-fet_beginchar ("Natural", "natural");
- draw_natural (false, false);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Natural (arrow up)", "natural.arrowup");
- draw_natural (true, false);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Natural (arrow down)", "natural.arrowdown");
- draw_natural (false, true);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Natural (arrows up and down)", "natural.arrowboth");
- draw_natural (true, true);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-%
-% Dedicated to my mom. (3/10/97)
-%
-% Mamma, ik hou van je; kom je alsjeblieft terug?
-% -- HW
-%
-%
-% TODO: remove crook_fatness
-% TODO: document, simplify!
-%
-
-def draw_meta_flat (expr xcenter, w, crook_fatness, arrowup, arrowdown) =
- save crook_thinness;
- save bottom_overshoot, bot_crook_dir;
- save top_stem_thick, top_stem_thick_orig;
- save bottom_stem_thick, hair, smaller_hole;
- save top_crook_thinness;
- save zwiep;
- save center;
- pair center, bot_crook_dir;
- save clearing, clearing_orig;
-
- clearxy;
-
- % the stem shouldn't reach the top staff line.
- %% TODO: should take from height.
- %
- % TODO: parameterize this
- %
- if w >= 0.75 staff_space:
- smaller_hole = 0.35 stafflinethickness;
- else:
- smaller_hole = 0;
- fi;
- crook_thinness = .7 stafflinethickness + .06 staff_space;
- top_crook_thinness = 1 stafflinethickness + .065 staff_space;
- clearing = 1.7 stafflinethickness;
- clearing_orig = clearing;
- if arrowup:
- clearing := 0.5 staff_space;
- fi;
- bottom_overshoot = stafflinethickness;
-
- bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
- top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
- top_stem_thick_orig# = top_stem_thick#;
- if arrowup:
- % to look nice, arrowed stems should be less brushed
- top_stem_thick# := top_stem_thick# * 0.8;
- fi;
- define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick,
- top_stem_thick_orig);
-
- if odd (top_stem_thick - bottom_stem_thick):
- top_stem_thick := top_stem_thick - 1;
- fi;
- if odd (top_stem_thick_orig - bottom_stem_thick):
- top_stem_thick_orig := top_stem_thick_orig - 1;
- fi;
-
- center = (xcenter, 0);
-
- x1l = hround (xcenter - .5 top_stem_thick);
- y1 = vround (2 staff_space - clearing);
- x2l = hround (xcenter - .5 bottom_stem_thick);
- y2 = -.5 staff_space - .5 stafflinethickness;
- % z16 and the `*_orig' variables are needed for arrowed accidentals
- % because their inner part should be unchanged from plain ones but
- % the points z3l, z3r, and z10 depend on values that are different
- % for arrowed accidentals
- x16l = hround (xcenter -.5 top_stem_thick_orig);
- y16 = vround (2 staff_space - clearing_orig);
-
- penpos1 (top_stem_thick, 0);
- penpos16 (top_stem_thick_orig, 0);
- penpos2 (bottom_stem_thick, 0);
-
- y3l = vfloor ((staff_space - stafflinethickness) / 2);
- z3l = whatever [z2r, z1r];
- z3r = .3 [z2r,
- (z16r shifted (0, clearing_orig - 1.7 stafflinethickness))]
- + (smaller_hole, 0);
- x3r := hceiling x3r;
-
- % we insert z3l to get better conversion with mf2pt1
- fill simple_serif (z1r, z1l, 30)
- -- z2l
- -- z2r
- -- z3l
- -- cycle;
-
- z10 = whatever [z2r, z16r] + (smaller_hole, 0);
- y10 = -1/10 staff_space;
- x10 := hceiling x10;
-
- x11 = xcenter + bottom_overshoot / 3;
- y11 = -vround (.5 (staff_space + stafflinethickness)
- + bottom_overshoot);
-
- x2a = 0.2[x2r, x7];
- y2a = 1.5[y2, y11];
-
- penpos4 (whatever, 53);
-
- y4l - y4r = top_crook_thinness;
- y5r = .15 staff_space;
- x5l = hround (w + xcenter);
- y4 = staff_space / 2;
- x4r = .45 [x5r, x3r];
- y4l := vround y4l;
-
- penpos5 (crook_fatness, -175);
-
- bot_crook_dir = unitvector ((x5l, 0) - z11);
- z8 = z11 + whatever * bot_crook_dir;
- y8 = -staff_space / 2;
-
- z7 = z8
- + whatever * bot_crook_dir
- + crook_thinness * (bot_crook_dir rotated 90);
- x7 = .1 [x3r, x8];
-
- unfill z3r{z3r - z10}
- .. z4r{right}
- .. z5r{down}
- .. z7{-bot_crook_dir}
- & z7
- .. z10{z3r - z10}
- -- cycle;
-
- if arrowdown:
- fill z2l{down}
- .. z2a{up}
- .. z8{bot_crook_dir}
- .. z5l{up}
- .. z4l{left}
- .. z3l
- -- cycle;
- else:
- fill z2l{down}
- .. z11{right}
- .. z8{bot_crook_dir}
- .. z5l{up}
- .. z4l{left}
- .. z3l
- -- cycle;
- fi;
-
- if arrowup:
- draw_arrow (z1, top_stem_thick, z1l - z2l,
- 0.5 stafflinethickness, false);
- fi;
- if arrowdown:
- draw_arrow ((0.5 [x2l, x2a], y2), x2a - x2l, up,
- staff_space / 2, true);
- fi;
-enddef;
-
-
-def draw_arrowed_meta_flat (expr xcenter, width, crook_fatness,
- arrowup, arrowdown) =
- save depth, height, extendleft;
-
- depth# = 0.6 staff_space#;
- height# = 1.9 staff_space#;
- extendleft# := 1.2 stafflinethickness#;
- if arrowup:
- extendleft# := 3.45 stafflinethickness#;
- height# := height# + 0.8 staff_space#;
- fi;
- if arrowdown:
- extendleft# := 3.45 stafflinethickness#;
- depth# := depth# + 1.6 staff_space#;
- fi;
-
- set_char_box (extendleft#, width, depth#, height#);
- draw_meta_flat(xcenter, w, crook_fatness, arrowup, arrowdown);
-enddef;
-
-%
-% unfortunately, 600dpi is not enough to show the brush of the stem.
-%
-
-fet_beginchar ("Flat", "flat");
- draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
- false, false);
- penlabels (range 0 thru 11);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Flat (arrow up)", "flat.arrowup");
- draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
- true, false);
- penlabels (range 0 thru 23);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Flat (arrow down)", "flat.arrowdown");
- draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
- false, true);
- penlabels (range 0 thru 23);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Arrowed Flat (arrow up and down)", "flat.arrowboth");
- draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
- true, true);
- penlabels (range 0 thru 23);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Flat (slashed)", "flat.slash");
- set_char_box (.4 staff_space#, .8 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- draw_meta_flat (0, w, 0.31 staff_space, false, false);
-
- clearxy;
-
- save slope, slash_width;
- slope = 0.5;
- slash_width = w;
-
- z11 = (0, h / 2);
- z12 = z11 - (slash_width, slash_width * slope) / 2;
- z13 = z11 + (slash_width, slash_width * slope) / 2;
- penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
- penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
-
- z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
- z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
-
- fill z13r
- .. z15
- .. z13l
- -- z12l
- .. z14
- .. z12r
- -- z13r
- .. cycle;
-
- penlabels (12, 13);
- labels (14, 15);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Flat (slashed twice)", "flat.slashslash");
- set_char_box (.4 staff_space#, .8 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- draw_meta_flat (0, w, 0.31 staff_space, false, false);
-
- clearxy;
-
- save slope, slash_width;
- slope = 0.5;
- slash_width = w;
-
- z11 = (0, 5/12 h);
- z12 = z11 - (slash_width, slash_width * slope) / 2;
- z13 = z11 + (slash_width, slash_width * slope) / 2;
- penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
- penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
-
- z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
- z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
-
- fill z13r
- .. z15
- .. z13l
- -- z12l
- .. z14
- .. z12r
- -- z13r
- .. cycle;
-
- penlabels (12, 13);
- labels (14, 15);
-
- z21 = (0, 2/3 h);
- z22 = z21 - (slash_width, slash_width * slope) / 2;
- z23 = z21 + (slash_width, slash_width * slope) / 2;
- penpos22 (1.5 stafflinethickness, angle (z23 - z22) - 90);
- penpos23 (1.5 stafflinethickness, angle (z23 - z22) - 90);
-
- z24 = z22 - .75 stafflinethickness * unitvector (z23 - z22);
- z25 = z23 + .75 stafflinethickness * unitvector (z23 - z22);
-
- fill z23r
- .. z25
- .. z23l
- -- z22l
- .. z24
- .. z22r
- -- z23r
- .. cycle;
-
- penlabels (22, 23);
- labels (24, 25);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-fet_beginchar ("Flatflat (mirrored)", "mirroredflat.flat");
- set_char_box (0, 1.6 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- % This is a modified version of `draw_meta_flat'.
-
- save crook_thinness, crook_fatness;
- save bottom_overshoot, bot_crook_dir;
- save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
- save top_crook_thinness;
- save zwiep;
- save center;
- pair center, bot_crook_dir;
- save clearing, wid;
- save pat;
- path pat;
-
- clearxy;
-
- wid = w / 2;
-
- % the stem shouldn't reach the top staff line.
- %% TODO: should take from height.
- %
- % TODO: parameterize this
- %
- if wid >= 0.75 staff_space:
- smaller_hole = 0.35 stafflinethickness;
- else:
- smaller_hole = 0;
- fi;
- clearing = 1.7 stafflinethickness;
- crook_thinness = .7 stafflinethickness + .06 staff_space;
- crook_fatness = 0.31 staff_space;
- top_crook_thinness = 1 stafflinethickness + .065 staff_space;
- bottom_overshoot = stafflinethickness;
-
- bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
- top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
- define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
-
- if odd (top_stem_thick - bottom_stem_thick):
- top_stem_thick := top_stem_thick - 1;
- fi;
-
- center = (0, 0);
-
- x1l = hround (-.5 top_stem_thick);
- y1 = vround (2 staff_space - clearing);
- x2l = hround (-.5 bottom_stem_thick);
- y2 = -.5 staff_space - .5 stafflinethickness;
-
- penpos1 (top_stem_thick, 0);
- penpos2 (bottom_stem_thick, 0);
-
- y3l = vfloor ((staff_space - stafflinethickness) / 2);
- z3l = whatever [z2r, z1r];
- z3r = .3 [z2r, z1r] + (smaller_hole, 0);
- x3r := hceiling x3r;
-
- z10 = whatever [z2r, z1r] + (smaller_hole, 0);
- y10 = -1/10 staff_space;
- x10 := hceiling x10;
-
- x11 = bottom_overshoot / 3;
- y11 = -vround (.5 (staff_space + stafflinethickness)
- + bottom_overshoot);
-
- penpos4 (whatever, 53);
-
- y4l - y4r = top_crook_thinness;
- y5r = .15 staff_space;
- x5l = hround (wid);
- y4 = staff_space / 2;
- x4r = .45 [x5r, x3r];
- y4l := vround y4l;
-
- penpos5 (crook_fatness, -175);
-
- bot_crook_dir = unitvector ((x5l, 0) - z11);
- z8 = z11 + whatever * bot_crook_dir;
- y8 = -staff_space / 2;
-
- z7 = z8
- + whatever * bot_crook_dir
- + crook_thinness * (bot_crook_dir rotated 90);
- x7 = .1 [x3r, x8];
-
- pat := z3r{z3r - z10}
- .. z4r{right}
- .. z5r{down}
- .. z7{-bot_crook_dir}
- & z7
- .. z10{z3r - z10}
- -- cycle;
- unfill pat;
- unfill pat xscaled -1;
-
- pat := z11{right}
- .. z8{bot_crook_dir}
- .. z5l{up}
- .. z4l{left}
- .. z3l;
- fill pat
- -- simple_serif (z1r, z1l, 30)
- -- reverse pat xscaled -1 shifted (-feta_eps, 0)
- -- cycle;
-
- currentpicture := currentpicture shifted (w/2, 0);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Semi flat", "mirroredflat");
- set_char_box (1.2 stafflinethickness#, .8 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- draw_meta_flat (0, w, 0.31 staff_space, false, false);
- currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
-fet_endchar;
-
-
-fet_beginchar ("Semi flat", "mirroredflat.backslash");
- set_char_box (.4 staff_space#, .8 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- draw_meta_flat (0, w, 0.31 staff_space, false, false);
-
- clearxy;
-
- save slope, slash_width;
- slope = 0.5;
- slash_width = w;
-
- z11 = (0, h / 2);
- z12 = z11 - (slash_width, slash_width * slope) / 2;
- z13 = z11 + (slash_width, slash_width * slope) / 2;
- penpos12 (1.5 stafflinethickness, angle (z13 - z12) - 90);
- penpos13 (1.5 stafflinethickness, angle (z13 - z12) - 90);
-
- z14 = z12 - .75 stafflinethickness * unitvector (z13 - z12);
- z15 = z13 + .75 stafflinethickness * unitvector (z13 - z12);
-
- fill z13r
- .. z15
- .. z13l
- -- z12l
- .. z14
- .. z12r
- -- z13r
- .. cycle;
-
- currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
-
- labels (1, 2, 3);
-fet_endchar;
-
-
-fet_beginchar ("Double Flat", "flatflat");
- save left_wid, overlap, right_wid;
-
- left_wid = .7;
- right_wid = .8;
- overlap = .05;
-
- set_char_box (1.2 stafflinethickness#,
- (left_wid + right_wid - overlap) * staff_space#,
- .6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
- false, false);
- draw_meta_flat (hround ((left_wid - overlap) * staff_space),
- right_wid * staff_space, 1/3 staff_space,
- false, false);
-fet_endchar;
-
-
-fet_beginchar ("3/4 Flat", "flatflat.slash");
- save left_wid, overlap, right_wid;
-
- left_wid = .7;
- right_wid = .8;
- overlap = .05;
-
- set_char_box (1.2 stafflinethickness#,
- (left_wid + right_wid - overlap) * staff_space#,
- .6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
- false, false);
- draw_meta_flat (hround ((left_wid - overlap) * staff_space),
- right_wid * staff_space, 1/3 staff_space,
- false, false);
-
- %% maybe we should clip part of the stems?
- %% or make the 1st flat smaller?
- %% or reverse it?
- pickup pencircle scaled 2 stafflinethickness;
-
- z12 = round (-.25 w - b, .55 staff_space) + feta_offset;
- z13 = round (.75 w, 1.45 staff_space) + feta_offset;
- penpos12 (2 stafflinethickness, angle (z13 - z12) - 90);
- penpos13 (2 stafflinethickness, angle (z13 - z12) - 90);
-
- z14 = z12 - stafflinethickness * unitvector (z13 - z12);
- z15 = z13 + stafflinethickness * unitvector (z13 - z12);
-
- fill z13r
- .. z15
- .. z13l
- -- z12l
- .. z14
- .. z12r
- -- z13r
- .. cycle;
-
- penlabels (12, 13);
- labels (14, 15);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Double Sharp", "doublesharp");
- save klaverblad, klaversteel;
- save pat;
- path pat;
-
- klaversteel = 1/15 staff_space;
- klaverblad = .4 staff_space - .5 stafflinethickness;
-
- set_char_box (0, staff_space#, .5 staff_space#, .5 staff_space#);
-
- z1 = (klaversteel, 0);
- z2 = (w / 2 - klaverblad / 10, h - klaverblad);
- z3 = (w / 2, h);
- z4 = z2 reflectedabout ((0, 0), (1, 1));
- z5 = z1 reflectedabout ((0, 0), (1, 1));
-
- labels (1, 2, 3, 4, 5);
-
- pickup pencircle scaled blot_diameter;
-
- x2 := hfloor (rt x2) - blot_diameter / 2;
- x3 := hfloor (rt x3) - blot_diameter / 2;
- y3 := vfloor (top y3) - blot_diameter / 2;
- y4 := vfloor (top y4) - blot_diameter / 2;
-
- pat = (rt z1){dir45}
- .. {right}(bot z2)
- .. rt z2
- -- rt z3{z3 - z2}
- .. top z3{z4 - z3}
- -- top z4{z4 - z3}
- .. (lft z4){down}
- .. {dir 225}(top z5);
- pat := pat
- -- reverse pat xscaled -1 shifted (-feta_eps, 0);
-
- % assure symmetry -- it's more important to center the glyph on the
- % staff line than centering it between staff lines, so we use
- % feta_shift, not feta_space_shift.
- h := h + feta_shift;
-
- fill pat shifted (0, feta_shift)
- -- reverse pat yscaled -1 shifted (0, -feta_eps)
- -- cycle;
-
- % ugh
- currentpicture := currentpicture shifted (hround (w / 2), 0);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-def draw_paren =
- save leftindent;
-
- leftindent := .2 staff_space;
-
- set_char_box (0, .5 staff_space# + stafflinethickness#,
- staff_space#, staff_space#);
-
- d := d - feta_shift;
-
- z1 = (leftindent, h);
- z2 = (w - stafflinethickness, .5 (h - d));
- z3 = (leftindent, -d);
-
- penpos1 (stafflinethickness, 35);
- penpos2 (.1 staff_space + stafflinethickness, 0);
- penpos3 (stafflinethickness, -35);
-
- fill z2l{down}
- .. simple_serif (z3l, z3r, 90)
- .. z2r{up}
- .. simple_serif (z1r, z1l, 90)
- .. z2l{down}
- -- cycle;
-enddef;
-
-
-fet_beginchar ("Right Parenthesis", "rightparen");
- draw_paren;
- penlabels (1, 2, 3);
-
- remember_pic := currentpicture;
-
- draw_staff (-2, 2, 0);
-fet_endchar;
-
-
-draw_shifted_too;
-
-
-fet_beginchar ("Left Parenthesis", "leftparen");
- draw_paren;
-
- currentpicture := currentpicture xscaled -1;
-
- set_char_box (charwd, charbp, chardp, charht);
-fet_endchar;
-
-fet_endgroup ("accidentals");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- implement trill symbols
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+% this file is included by feta-scripts.mf
+
+trill_thin# = 0.1 staff_space# + 0.6 stafflinethickness#;
+trill_stemwidth# = trill_thin#;
+define_pixels (trill_thin);
+define_whole_blacker_pixels (trill_stemwidth);
+
+trill_thick = 1/2 staff_space;
+trill_overlap = 1/6 staff_space;
+
+trill_width# = 5/6 staff_space#;
+trill_height# = 1/2 staff_space#;
+define_pixels (trill_height);
+define_whole_pixels (trill_width);
+
+pair trill_ne;
+trill_ne := unitvector ((2, 3));
+
+
+%
+% The trill element sticks out on both the left and right side
+% of the normal bbox, so you can glue them together easily.
+%
+% `ending' is either 0 for none, 1 for left, or 2 for right.
+%
+
+def draw_trillelement (expr offset, ending) =
+ clearxy;
+
+begingroup;
+ save nw, pat, nw_dist, ne_dist;
+ pair nw, nw_dist, ne_dist;
+ path pat;
+
+ pickup pencircle scaled trill_thin;
+
+ x1 = -.5 trill_width;
+ y1 = 0;
+ z3 = whatever * trill_ne + z1;
+ top y3 = vround trill_height;
+ z2 = z3 - (trill_thick - trill_thin) * trill_ne;
+
+ bot z3' = (top z3) scaled -1;
+
+ nw = unitvector (z2 - z3');
+ ne_dist = (nw rotated -90) * 0.5 trill_thin;
+ nw_dist = (trill_ne rotated 90) * 0.5 trill_thin;
+
+ z5 = whatever * trill_ne + (z1 - nw_dist);
+ z5 = whatever * nw + (z3' - ne_dist);
+
+ pat := z5
+ -- (z1 - nw_dist){-trill_ne}
+ -- (z1 + nw_dist){trill_ne}
+ -- (z3 + nw_dist){trill_ne}
+ .. top z3{right}
+ .. (z3 + ne_dist){-nw};
+ pat := pat
+ -- pat scaled -1 shifted (-feta_eps, -feta_eps)
+ -- cycle;
+ pat := pat shifted (offset, 0);
+ fill pat;
+
+ z4 = z1 - trill_ne * trill_overlap;
+ x4 := hround (x4 + 0.5 trill_thin) - 0.5 trill_thin;
+
+ pat := (z4 - nw_dist){-trill_ne}
+ .. bot z4{left}
+ .. lft z4{up}
+ .. (z4 + nw_dist){trill_ne}
+ -- (z1 + nw_dist){trill_ne}
+ -- (z1 - nw_dist){-trill_ne}
+ -- cycle;
+
+ if ending = 1:
+ fill pat shifted (offset, 0);
+ elseif ending = 2:
+ pat := pat scaled -1 shifted (-feta_eps, -feta_eps);
+ fill pat shifted (offset, 0);
+ fi;
+endgroup;
+enddef;
+
+
+fet_beginchar ("trilelement", "trilelement");
+ set_char_box (.5 trill_width#, .5 trill_width#,
+ trill_height#, trill_height#);
+
+ draw_trillelement (0, 0);
+ labels (1, 2, 3, 3', 4, 5, 5');
+fet_endchar;
+
+
+fet_beginchar ("prall", "prall");
+ set_char_box (trill_width#, trill_width#,
+ trill_height#, trill_height#);
+
+ draw_trillelement (-hround (.5 trill_width), 1);
+ draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
+fet_endchar;
+
+
+fet_beginchar ("mordent", "mordent");
+ set_char_box (trill_width#, trill_width#,
+ 4/3 trill_height#, 4/3 trill_height#);
+
+ draw_trillelement (-hround (.5 trill_width), 1);
+ draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
+
+ clearxy;
+
+ pickup pencircle scaled trill_stemwidth;
+
+ top y1 = h;
+ bot y2 = -d;
+ x1 = x2;
+ x2 = 0;
+
+ draw_gridline (z2, z1, trill_stemwidth);
+
+ labels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("prallprall", "prallprall");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, trill_height#);
+
+ draw_trillelement (-trill_width, 1);
+ draw_trillelement (0, 0);
+ draw_trillelement (trill_width, 2);
+fet_endchar;
+
+
+fet_beginchar ("prallmordent", "prallmordent");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ 4/3 trill_height#, 4/3 trill_height#);
+
+ draw_trillelement (-trill_width, 1);
+ draw_trillelement (0, 0);
+ draw_trillelement (trill_width, 2);
+
+ clearxy;
+
+ pickup pencircle scaled trill_stemwidth;
+
+ top y1 = h;
+ bot y2 = -d;
+ x1 = x2 ;
+ x2 = good.x (.5 trill_width);
+
+ draw_gridline (z2, z1, trill_stemwidth);
+
+ labels (1, 2);
+fet_endchar;
+
+
+save remember_pic;
+picture remember_pic;
+
+
+fet_beginchar ("upprall", "upprall");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, trill_height#);
+
+ draw_trillelement (-trill_width, 1);
+ draw_trillelement (0, 0);
+ draw_trillelement (trill_width, 2);
+
+ z11 = z4 shifted (-trill_width, 0);
+ z12 = z11 + (0, -2 trill_height);
+
+ penpos11 (trill_thin, angle (trill_ne) - 90);
+ penpos12 (trill_thin, angle (trill_ne yscaled -1) + 90);
+ penlabels (11, 12);
+
+ pickup pencircle scaled trill_stemwidth;
+
+ fill z11l{-trill_ne}
+ .. z12l{trill_ne yscaled -1}
+ .. bot z12
+ .. rt z12
+ .. z12r{-trill_ne yscaled -1}
+ .. z11r{trill_ne}
+ -- cycle;
+
+ remember_pic := currentpicture;
+fet_endchar;
+
+
+fet_beginchar ("upmordent", "upmordent");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ 4/3 trill_height#, 4/3 trill_height#);
+
+ currentpicture := remember_pic;
+
+ clearxy;
+
+ pickup pencircle scaled trill_stemwidth;
+
+ top y1 = h;
+ bot y2 = -d;
+ x1 = x2;
+ x2 = good.x (.5 trill_width);
+
+ draw_gridline (z2, z1, trill_stemwidth);
+
+ labels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("pralldown", "pralldown");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, trill_height#);
+
+ currentpicture := remember_pic xscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("downprall", "downprall");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, trill_height#);
+
+ draw_trillelement (-trill_width, 1);
+ draw_trillelement (0, 0);
+ draw_trillelement (trill_width, 2);
+
+ z11 = z4 shifted (-trill_width, 0);
+ z12 = z11 + (0, 2 trill_height);
+
+ penpos11 (trill_thin, angle (trill_ne xscaled -1) - 90);
+ penpos12 (trill_thin, angle (trill_ne) - 90);
+ penlabels (11, 12);
+
+ pickup pencircle scaled trill_stemwidth;
+
+ fill z11l{trill_ne xscaled -1}
+ .. z12l{trill_ne}
+ .. top z12
+ .. rt z12
+ .. z12r{-trill_ne}
+ .. z11r{-trill_ne xscaled -1}
+ -- cycle;
+
+ remember_pic := currentpicture;
+fet_endchar;
+
+
+fet_beginchar ("downmordent", "downmordent");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ 4/3 trill_height#, 4/3 trill_height#);
+
+ currentpicture := remember_pic;
+
+ clearxy;
+
+ pickup pencircle scaled trill_stemwidth;
+
+ top y1 = h;
+ bot y2 = -d;
+ x1 = x2;
+ x2 = good.x (.5 trill_width);
+
+ draw_gridline (z2, z1, trill_stemwidth);
+
+ labels (1, 2);
+fet_endchar;
+
+
+fet_beginchar ("prallup", "prallup");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, trill_height#);
+
+ currentpicture := remember_pic xscaled -1;
+fet_endchar;
+
+
+fet_beginchar ("lineprall", "lineprall");
+ set_char_box (1.5 trill_width#, 1.5 trill_width#,
+ trill_height#, 4 trill_height#);
+
+ draw_trillelement (-trill_width, 1);
+
+ labels (1, 2, 3, 3', 4, 5, 5');
+
+ pickup pencircle scaled trill_stemwidth;
+
+ penpos10 (trill_stemwidth, 0);
+ penpos11 (trill_stemwidth, 0);
+
+ x10l = x4 - .5 trill_thin - trill_width;
+ y10 = y4;
+ z11 = z10 + (0, h);
+
+ penlabels (10, 11);
+
+ fill z11l
+ .. top z11
+ .. z11r
+ -- z10r
+ -- z10l
+ -- cycle;
+
+ draw_trillelement (0, 0);
+ draw_trillelement (trill_width, 2);
+fet_endchar;
fet_beginfont ("parmesan", design_size, "parmesanMusic");
if test = 0:
input parmesan-rests;
- input parmesan-heads;
+ input parmesan-noteheads;
input parmesan-clefs;
input parmesan-custodes
input parmesan-accidentals;
input parmesan-flags;
- input parmesan-timesig;
+ input parmesan-timesignatures;
input parmesan-scripts;
input parmesan-dots;
else:
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- ancient note heads
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 2001--2009 Juergen Reuter <reuter@ipd.uka.de>
-%
-% Neo-mensural heads originally by
-% Christian Mondrup and Mats Bengtsson
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-save black_notehead_width;
-numeric black_notehead_width;
-
-fet_begingroup ("noteheads");
-
-%
-% character aligment:
-%
-% The head is assumed to be vertically centered around (0, 0).
-% The left-most edge of the head should touch the vertical line
-% that goes though the point (0, 0).
-%
-% set_char_box() conventions:
-%
-% * breapth: Ignored (as far as I know). Should be set to 0.
-%
-% * width: Should match the head's width.
-%
-% * depth: Should match the bottom edge of the head. Affects vertical
-% collision handling.
-%
-% * height: Should match the top edge of the head. Affects vertical
-% collision handling.
-%
-% TODO: should depth/height include appendages/stems?
-
-overdone_heads = 0;
-noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
-define_pixels (noteheight);
-
-
-%%%%%%%%
-%
-%
-%
-% MENSURAL NOTATION
-%
-%
-%
-
-def draw_neomensural_brevis (expr brevwid) =
- save beamheight, head_width;
- save holeheight, stem_width;
- save serif_size, serif_protrude;
-
- head_width# = brevwid;
- holeheight = 3 stafflinethickness;
- stem_width = 1.4 stafflinethickness;
-
- define_pixels (head_width);
-
- set_char_box (0, head_width#,
- noteheight# / 2, noteheight# / 2);
-
- 2 beamheight + holeheight = noteheight;
- serif_size = (holeheight - stafflinethickness) / 2;
- serif_protrude = 1.5 serif_size;
-
- z1l = (0, 0);
- z2l = (0, -stafflinethickness / 2);
- z3r = z2r + serif_size * (1, -1);
- y4r = y3r;
- x4r = head_width / 2;
- z5l = z3l + (-serif_size, -serif_protrude);
-
- penpos1 (stem_width, 0);
- penpos2 (stem_width, 0);
- penpos3 (beamheight, 90);
- penpos4 (beamheight, 90);
- penpos5 (stem_width, 180);
-
- save pat_in, pat_out;
- path pat_in, pat_out;
-
- pat_out := z4l
- -- z3l{left}
- .. z5l{down}
- .. z5r{up}
- -- z1l;
- pat_out := pat_out
- -- reverse pat_out yscaled -1;
- pat_out := pat_out
- -- reverse pat_out shifted (-x4r, 0)
- xscaled -1
- shifted (x4l, 0)
- -- cycle;
- fill pat_out;
-
- pat_in := z4r
- -- z3r{left}
- .. z2r{up}
- -- z1r;
- pat_in := pat_in
- -- reverse pat_in yscaled -1;
- pat_in := pat_in
- -- reverse pat_in shifted (-x4r, 0)
- xscaled -1
- shifted (x4l, 0)
- -- cycle;
- unfill pat_in;
-
- penlabels (1, 2, 3, 4, 5);
-enddef;
-
-
-%%% This head does not seem to be used anywhere. Junk me? -- jr
-def draw_neomensural_left_stemmed_head (expr wid) =
- draw_neomensural_brevis (wid);
-
- x6 = x7 = stem_width / 2;
- y6 = y5;
- y7 = y5 - 2.25 staff_space;
-
- z17 = (x7, y7 - stem_width / 2);
-
- penpos6 (stem_width, 0);
- penpos7 (stem_width, 0);
-
- fill z7l
- -- z6l
- -- z6r
- -- z7r
- .. z17
- .. cycle;
-
- penlabels (6, 7);
- labels (17);
-enddef;
-
-
-%%% This head does not seem to be used anywhere. Junk me? -- jr
-fet_beginchar ("Left stemmed notehead", "slneomensural");
- draw_neomensural_left_stemmed_head (2 staff_space#);
-fet_endchar;
-
-
-%
-% Some sources (eg. Musix/OpusTeX) think that the appendage should be on
-% the left, some say right. Right wins democratically.
-%
-def draw_neomensural_longa (expr wid) =
- draw_neomensural_brevis (wid);
-
- save theta;
-
- x7r = head_width;
- y7 = y5;
- z6 - z7 = (stem_width / 2, -staff_space);
- theta = angle (z6 - z7) + 90;
-
- penpos7 (stem_width, 0);
- penpos6 (1.2 stem_width, theta);
-
- z7' = find_tangent (z6l, pat_out,
- (x7l + 0.5 stem_width, y7l),
- (x7l - 0.5 stem_width, y7l));
-
- fill z7r
- .. z6r{z6 - z7}
- .. {z7 - z6}z6l
- -- z7'
- -- cycle;
-
- penlabels (6, 7);
- labels (7');
-enddef;
-
-
-%
-% En wij presenteren U: de opvolgster van Emily
-%
-% (ze is wel breed)
-%
-fet_beginchar ("Neo-mensural maxima notehead", "sM3neomensural");
- draw_neomensural_longa (2.6 staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Neo-mensural longa notehead", "sM2neomensural");
- draw_neomensural_longa (2 staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
- draw_neomensural_brevis (2 staff_space#);
-fet_endchar;
-
-
-def draw_neomensural_black_head (expr wid, height) =
- save head_width;
- save ne, nw, ne_dist, nw_dist;
- pair ne, nw, ne_dist, nw_dist;
-
- head_width# = wid;
-
- set_char_box (0, head_width#,
- height / 2, height / 2);
-
- charwx := head_width# / 2;
- charwy := height / 2;
-
- y3 = y1 = 0;
- x2 = x4 = (x1 + x3) / 2;
-
- pickup pencircle scaled blot_diameter;
-
- top y2 = h;
- bot y4 = -d;
- lft x1 = 0;
- rt x3 = w;
-
- ne := unitvector (z2 - z1);
- nw_dist := (ne rotated 90) * 0.5 blot_diameter;
- nw := unitvector (z2 - z3);
- ne_dist := (nw rotated -90) * 0.5 blot_diameter;
-
- fill lft z1{up}
- .. (z1 + nw_dist){ne}
- -- (z2 + nw_dist){ne}
- .. top z2{right}
- .. (z2 + ne_dist){-nw}
- -- (z3 + ne_dist){-nw}
- .. rt z3{down}
- .. (z3 - nw_dist){-ne}
- -- (z4 - nw_dist){-ne}
- .. bot z4{left}
- .. (z4 - ne_dist){nw}
- -- (z1 - ne_dist){nw}
- .. cycle;
-
- labels (1, 2, 3, 4);
-enddef;
-
-
-def draw_neomensural_open_head (expr wid, height)=
- draw_neomensural_black_head (wid, height);
-
- save diamNW, diamSW;
-
- diamNW = length (z2 - z1) + blot_diameter;
- diamSW = length (z4 - z1) + blot_diameter;
-
- save hole_widthNW, hole_widthSW;
-
- hole_widthNW = 0.34 diamNW ;
- hole_widthSW + 2.6 linethickness = diamSW;
-
- (z7 + z5) / 2 = (w / 2, 0);
- (z8 + z6) / 2 = (w / 2, 0);
- z6 - z5 = hole_widthNW * unitvector (z2 - z1);
- z7 - z6 = hole_widthSW * unitvector (z4 - z1);
-
- unfill z5
- -- z6
- -- z7
- -- z8
- -- cycle;
-
- labels (5, 6, 7, 8);
-enddef;
-
-
-%
-% WL says the thin lines should be thinner.
-%
-fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic");
- draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
- charwx := head_width#;
- charwy := 0;
-fet_endchar;
-
-
-fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic");
- draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
- charwx := head_width#;
- charwy := 0;
-fet_endchar;
-
-
-fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural");
- draw_neomensural_open_head (staff_space#, noteheight#);
-fet_endchar;
-
-
-fet_beginchar ("Neo-mensural minima head", "s1neomensural");
- draw_neomensural_open_head (staff_space#, noteheight#);
-fet_endchar;
-
-
-fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
- draw_neomensural_black_head (staff_space#, noteheight#);
-fet_endchar;
-
-
-def draw_mensural_brevis (expr wid) =
- % TODO. For the moment, fall back to draw_neomensural_brevis.
- draw_neomensural_brevis (wid);
-enddef;
-
-
-%%% This head does not seem to be used anywhere. Junk me? -- jr
-def draw_mensural_left_stemmed_head (expr wid) =
- draw_mensural_brevis (wid);
-
- x6 = x7 = stem_width / 2;
- y6 = y5;
- y7 = y5 - 2.25 staff_space;
-
- z17 = (x7, y7 - stem_width / 2);
-
- penpos6 (stem_width, 0);
- penpos7 (stem_width, 0);
-
- fill z7l
- -- z6l
- -- z6r
- -- z7r
- .. z17
- .. cycle;
-
- penlabels (6, 7);
- labels (17);
-enddef;
-
-
-def draw_mensural_longa (expr wid) =
- draw_mensural_brevis (wid);
-
- x6 = x7 = head_width - stem_width / 2;
- y6 = y5;
- y7 = y5 - 2.25 staff_space;
-
- z17 = (x7, y7 - stem_width / 2);
-
- penpos6 (stem_width, 0);
- penpos7 (stem_width, 0);
-
- fill z7l
- -- z6l
- -- z6r
- -- z7r
- .. z17
- .. cycle;
-
- penlabels (6, 7);
- labels (17);
-enddef;
-
-
-%%% This head does not seem to be used anywhere. Junk me? -- jr
-fet_beginchar ("Mensural left stemmed notehead", "slmensural");
- draw_mensural_left_stemmed_head (staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Mensural maxima notehead", "sM3mensural");
- draw_mensural_longa (2.0 staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Mensural longa notehead", "sM2mensural");
- draw_mensural_longa (staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Mensural brevis notehead", "sM1mensural");
- draw_mensural_brevis (staff_space#);
-fet_endchar;
-
-
-def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
- save head_width, head_height;
- save ellipse, ellipse_r;
- path ellipse, ellipse_r, diamond_shape;
-
- head_height# = head_h;
- head_width# / head_height# = tand (angle);
-
- set_char_box (0, head_width#,
- head_height# / 2, head_height# / 2);
-
- charwx := head_width# / 2;
- charwy := head_height# / 2 - linethickness#;
-
- define_pixels (head_width, head_height);
-
- ellipse := reverse fullcircle
- xscaled (max (blot_diameter, pen_w * head_width))
- yscaled (max (blot_diameter, pen_h * head_width))
- rotated -angle;
-
- z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
- (0, 0), (w / 2, 0));
- z2 = find_tangent_shift (((0, h) -- (w, h)), ellipse,
- (w / 2, h), (w / 2, 0));
- z3 = find_tangent_shift (((w, h) -- (w, -h)), ellipse,
- (w, 0), (w / 2, 0));
- z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
- (w / 2, -h), (w / 2, 0));
-
- diamond_shape := get_subpath (ellipse, z1 - z4, z2 - z1, z1)
- -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
- -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
- -- get_subpath (ellipse, z4 - z3, z1 - z4, z4)
- -- cycle;
- fill diamond_shape;
-
- if open:
- save l;
- path l[];
-
- l12 := (directionpoint (z1 - z2) of ellipse) shifted z1
- -- (directionpoint (z1 - z2) of ellipse) shifted z2;
- l23 := (directionpoint (z2 - z3) of ellipse) shifted z2
- -- (directionpoint (z2 - z3) of ellipse) shifted z3;
- l34 := (directionpoint (z3 - z4) of ellipse) shifted z3
- -- (directionpoint (z3 - z4) of ellipse) shifted z4;
- l41 := (directionpoint (z4 - z1) of ellipse) shifted z4
- -- (directionpoint (z4 - z1) of ellipse) shifted z1;
-
- unfill l12 intersectionpoint l23
- -- l23 intersectionpoint l34
- -- l34 intersectionpoint l41
- -- l41 intersectionpoint l12
- -- cycle;
- fi;
-
- labels (1, 2, 3, 4);
-enddef;
-
-
-fet_beginchar ("Mensural semibrevis head", "s0mensural");
- draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
-fet_endchar;
-
-
-fet_beginchar ("Mensural minima head", "s1mensural");
- draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
-fet_endchar;
-
-
-fet_beginchar ("Mensural semiminima head", "s2mensural");
- draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
-fet_endchar;
-
-
-fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
-% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
- draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Petrucci minima head", "s1petrucci");
-% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
- draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
-fet_endchar;
-
-
-fet_beginchar ("Petrucci semiminima head", "s2petrucci");
-% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, false);
- draw_neomensural_black_head (staff_space#, 1.8 staff_space#);
-fet_endchar;
-
-
-%%%%%%%%
-%
-%
-%
-% EDITIO VATICANA (including solesmes extensions)
-%
-%
-%
-
-def vat_punctum_char (expr verbose_name, internal_name,
- linea, cavum, straight, auctum,
- d_up, up_shift, down_shift, mag) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save a_b, b_h, a_w;
-
- a_b := 1.54; % b_h * a_b / a_w = wd / ht
- b_h := 0.85;
- a_w := 1.09;
-
- save a, beta, ht, wd;
-
- ht# = noteheight# * mag;
- 2 beta = ht# * b_h;
- a = beta * a_b;
- wd# = 2 a / a_w;
- black_notehead_width# := wd#;
-
- % direction
- save d_, d_sign;
- pair d_;
-
- if d_up:
- d_ := up;
- d_sign := 1;
- else:
- d_ := down;
- d_sign := -1;
- fi;
-
- % convexity and eccentricity
- save u_convexity, u_eccentricity;
-
- if straight:
- u_convexity# := -0.01 ht#;
- u_eccentricity# := 0.0 ht#; % dummy
- elseif auctum:
- u_convexity# := -0.03 ht#;
- u_eccentricity# := +0.25 ht#;
- else:
- u_convexity# := -0.05 ht#;
- u_eccentricity# := 0.0 ht#; % dummy
- fi;
-
- save convexity, eccentricity;
-
- convexity# := d_sign * u_convexity#;
- eccentricity# := d_sign * u_eccentricity#;
-
- % y shift offset
- save yoffs;
-
- if up_shift:
- yoffs# := 0.08 ht#;
- elseif down_shift:
- yoffs# := -0.11 ht#;
- else:
- yoffs# := 0.00 ht#;
- fi;
-
- define_pixels (convexity, eccentricity, yoffs, ht, wd);
-
- pickup pencircle scaled linethickness;
-
- save height, yoffs_bt, p, circle, circle_r;
- path p, circle, circle_r;
-
- height# = 0.47 ht#;
- yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
-
- define_pixels (height, yoffs_bt);
-
- circle := fullcircle scaled linethickness;
-
- x1 = x6;
- x2 = x5;
- x3 = x4;
- y1 + height = y6;
- y2 + height = y5;
- y3 + height = y4;
-
- save box_top, box_bt;
-
- if auctum:
- z1 = (0.00 wd + linethickness / 2, yoffs_bt);
- z2 = (0.21 wd, yoffs_bt + convexity);
- z3 = (0.42 wd - linethickness/ 2,
- yoffs_bt + eccentricity);
- box_top# = height# + yoffs_bt# +
- max (0, convexity#, eccentricity#);
- box_bt# = yoffs_bt# +
- min (0, convexity#, eccentricity#);
- p = z1
- .. {right}z2
- .. {d_}z3
- -- z4{-d_}
- .. z5{left}
- .. z6
- -- cycle;
- else:
- z1 = (0.00 wd + linethickness / 2, yoffs_bt);
- z2 = (0.21 wd, yoffs_bt + convexity);
- z3 = (0.42 wd - linethickness / 2, yoffs_bt);
- box_top# = height# + yoffs_bt# + max (0, convexity#);
- box_bt# = yoffs_bt# + min (0, convexity#);
- p = z1
- .. z2
- .. z3
- -- z4
- .. z5
- .. z6
- -- cycle;
- fi;
-
- labels (1, 2, 3, 4, 5, 6);
-
- save dirs;
- pair dirs[];
-
- dirs12 := direction (0 + epsilon) of p;
- dirs2 := direction 1 of p;
- dirs32 := direction (2 - epsilon) of p;
- dirs45 := direction (3 + epsilon) of p;
- dirs5 := direction 4 of p;
- dirs65 := direction (5 - epsilon) of p;
-
- fill get_subpath (circle, down, dirs12, z1)
- .. (bot z2){dirs2}
- .. get_subpath (circle, dirs32, up, z3)
- -- get_subpath (circle, up, dirs45, z4)
- .. (top z5){dirs5}
- .. get_subpath (circle, dirs65, down, z6)
- -- cycle;
-
- if cavum:
- save pat, t;
- path pat[];
- numeric t[];
-
- pat123 := ((directionpoint -dirs12 of circle)
- shifted z1){dirs12}
- .. (top z2){dirs2}
- .. {dirs32}((directionpoint -dirs32 of circle)
- shifted z3);
- pat34 := lft z3
- -- lft z4;
- pat456 := ((directionpoint -dirs45 of circle)
- shifted z4){dirs45}
- .. (bot z5){dirs5}
- .. {dirs65}((directionpoint -dirs65 of circle)
- shifted z6);
- pat61 := rt z6
- -- rt z1;
-
- t61 := ypart (pat61 intersectiontimes pat123);
- t12 := xpart (pat123 intersectiontimes pat34);
- t34 := ypart (pat34 intersectiontimes pat456);
- t45 := xpart (pat456 intersectiontimes pat61);
-
- unfill subpath (t61, t12) of pat123
- -- subpath (t34, t45) of pat456
- -- cycle;
- fi;
-
- set_char_box (0.00 wd#, 0.42 wd#,
- max (0, -box_bt#) + linethickness# / 2,
- max (0, box_top#) + linethickness# / 2);
-
- if linea:
- save linea_width, linea_height;
-
- linea_width# = 0.6 linethickness#;
- linea_height# = 0.7 ht#;
-
- define_pixels (linea_width, linea_height);
-
- pickup pencircle scaled 0.6 linethickness;
-
- draw_rounded_block ((-0.10 wd - linea_width / 2,
- -linea_height / 2),
- (-0.10 wd + linea_width / 2,
- +linea_height / 2),
- 0.6 linethickness);
- draw_rounded_block ((+0.52 wd - linea_width / 2,
- -linea_height / 2),
- (+0.52 wd + linea_width / 2,
- +linea_height / 2),
- 0.6 linethickness);
-
- set_char_box (0, 0.62 wd# + linea_width#,
- linea_height# / 2,
- linea_height# / 2);
-
- currentpicture := currentpicture
- shifted (0.10 wd + linea_width / 2, 0);
- fi;
- fet_endchar;
-enddef;
-
-
-def plica_char (expr verbose_name, internal_name,
- d_up, mag) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save a_b, b_h, a_w;
-
- a_b := 1.54; % b_h * a_b / a_w = wd / ht
- b_h := 0.85;
- a_w := 1.09;
-
- save a, beta, ht, wd;
-
- ht# = noteheight# * mag;
- 2 beta = ht# * b_h;
- a = beta * a_b;
- wd# = 2 a / a_w;
- black_notehead_width# := wd#;
-
- % direction
- save d_, d_sign;
- pair d_;
-
- if d_up:
- d_ := up;
- d_sign := 1;
- else:
- d_ := down;
- d_sign := -1;
- fi;
-
- % convexity and eccentricity
- save convexity, eccentricity;
-
- convexity# := d_sign * -0.10 ht#;
- eccentricity# := d_sign * -0.12 ht#;
-
- % y shift offset
- save yoffs;
-
- yoffs# := -0.11 ht#;
-
- define_pixels (convexity, eccentricity, yoffs, ht, wd);
-
- pickup pencircle scaled linethickness;
-
- save height, yoffs_bt, p, circle, circle_r;
- path p, circle, circle_r;
-
- height# = 0.47 ht#;
- yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
-
- define_pixels (height, yoffs_bt);
-
- circle := fullcircle scaled linethickness;
-
- x1 = x6;
- x2 = x5;
- x3 = x4;
- y1 + height = y6;
- y2 + height = y5;
- y3 + height = y4;
-
- save box_top, box_bt;
-
- z1 = (0.00 wd + linethickness / 2, yoffs_bt);
- z2 = (0.21 wd, yoffs_bt + convexity);
- z3 = (0.42 wd - linethickness/ 2, yoffs_bt + eccentricity);
- box_top# = height# + yoffs_bt# +
- max (0, convexity#, eccentricity#);
- box_bt# = yoffs_bt# +
- min (0, convexity#, eccentricity#);
- p = z1
- .. z2{right}
- .. z3
- -- z4
- .. z5{left}
- .. z6
- -- cycle;
-
- labels (1, 2, 3, 4, 5, 6);
-
- save dirs;
- pair dirs[];
-
- dirs12 := direction (0 + epsilon) of p;
- dirs2 := direction 1 of p;
- dirs32 := direction (2 - epsilon) of p;
- dirs45 := direction (3 + epsilon) of p;
- dirs5 := direction 4 of p;
- dirs65 := direction (5 - epsilon) of p;
-
- fill get_subpath (circle, down, dirs12, z1)
- .. (bot z2){dirs2}
- .. get_subpath (circle, dirs32, up, z3)
- -- get_subpath (circle, up, dirs45, z4)
- .. (top z5){dirs5}
- .. get_subpath (circle, dirs65, down, z6)
- -- cycle;
-
- pickup pencircle scaled 0.6 linethickness;
-
- save stem_bt;
-
- set_char_box (0.00 wd#, 0.42 wd#,
- max (0, -box_bt#) + linethickness# / 2,
- max (0, box_top#) + linethickness# / 2);
-
- fet_endchar;
-enddef;
-
-
-def epiphonus_char (expr verbose_name, internal_name,
- left_stem, d_up, down_shift, mag) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save a_b, b_h, a_w;
-
- a_b := 1.54; % b_h * a_b / a_w = wd / ht
- b_h := 0.85;
- a_w := 1.09;
-
- save a, beta, ht, wd;
-
- ht# = noteheight# * mag;
- 2 beta = ht# * b_h;
- a = beta * a_b;
- wd# = 2 a / a_w;
- black_notehead_width# := wd#;
-
- % direction
- save d_, d_sign;
- pair d_;
-
- if d_up:
- d_ := up;
- d_sign := 1;
- else:
- d_ := down;
- d_sign := -1;
- fi;
-
- % convexity and eccentricity
- save convexity;
-
- convexity# := d_sign * -0.05ht#;
-
- % y shift offset
- save yoffs;
-
- if down_shift:
- yoffs# := -0.11 ht#;
- else:
- yoffs# := 0.00 ht#;
- fi;
-
- define_pixels (convexity, yoffs, ht, wd);
-
- pickup pencircle scaled linethickness;
-
- save height, yoffs_bt, p, circle, circle_r;
- path p, circle, circle_r;
-
- height# = 0.47 ht#;
- yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
-
- define_pixels (height, yoffs_bt);
-
- circle := fullcircle scaled linethickness;
-
- x1 = x6;
- x2 = x5;
- x3 = x4;
- y1 + height = y6;
- y2 + height = y5;
- y3 + height = y4;
-
- save box_top, box_bt;
-
- z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
- z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
- z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
- box_top# = height# + yoffs_bt# +
- max (-1.0 convexity#, 1.4 convexity#, 0);
- box_bt# = yoffs_bt# +
- min (-1.0 convexity#, 1.4 convexity#, 0);
- p = z1{-d_}
- .. {curl 1}z2{right}
- .. z3
- -- z4
- .. {left}z5{curl 1}
- .. {d_}z6
- -- cycle;
-
- labels (1, 2, 3, 4, 5, 6);
-
- save dirs;
- pair dirs[];
-
- dirs12 := direction (0 + epsilon) of p;
- dirs21 := direction (1 - epsilon) of p;
- dirs23 := direction (1 + epsilon) of p;
- dirs32 := direction (2 - epsilon) of p;
- dirs45 := direction (3 + epsilon) of p;
- dirs54 := direction (4 - epsilon) of p;
- dirs56 := direction (4 + epsilon) of p;
- dirs65 := direction (5 - epsilon) of p;
-
- fill get_subpath (circle, down, dirs12, z1)
- .. get_subpath (circle, dirs21, dirs23, z2)
- .. get_subpath (circle, dirs32, up, z3)
- -- get_subpath (circle, up, dirs45, z4)
- .. get_subpath (circle, dirs54, dirs56, z5)
- .. get_subpath (circle, dirs65, down, z6)
- -- cycle;
-
- save stem_bt;
-
- if left_stem:
- pickup pencircle scaled 0.6 linethickness;
-
- lft x11 = x1 - linethickness / 2;
- bot y11 = yoffs - 1.1 ht - linethickness / 2;
- x12 = x11;
- y12 = y1;
-
- draw_rounded_block (bot lft z11, top rt z12,
- 0.6 linethickness);
- stem_bt# = yoffs# - 1.1 ht#;
-
- labels (11, 12);
- else:
- stem_bt# = 0;
- fi;
-
- set_char_box (0.00 wd#, 0.42 wd#,
- max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
- max (0, box_top#) + linethickness# / 2);
- fet_endchar;
-enddef;
-
-
-def inclinatum_char (expr verbose_name, internal_name,
- small, stropha, auctum) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save ht, alpha;
-
- alpha := 35;
-
- if small:
- ht# = 0.50 noteheight#;
- else:
- ht# = 0.80 noteheight#;
- fi;
-
- draw_diamond_head (ht#, 0, 0, alpha, false);
-
- save off_angle;
-
- off_angle := alpha + 15;
-
- save stropha_ellipse, auctum_hook, circle;
- path stropha_ellipse, auctum_hook, circle;
-
- circle := reverse fullcircle scaled linethickness;
-
- stropha_ellipse := fullcircle xscaled 0.25 head_height
- yscaled 0.55 head_height
- rotated alpha;
-
- z11 = z12
- + linethickness / 2 * dir (180 - off_angle)
- - directionpoint dir (90 - off_angle)
- of stropha_ellipse;
- z12 = directionpoint -dir (90 - off_angle) of diamond_shape +
- linethickness / 2 * dir (180 - off_angle);
- z13 = (0, -0.5 head_height + linethickness);
-
- auctum_hook := z12{-dir (90 - off_angle)}
- .. {dir (90 + alpha)}z13;
-
- labels (12);
-
- if (stropha and not auctum):
- clearit;
-
- save t_in, t_out;
-
- t_in := xpart ((stropha_ellipse shifted z11)
- intersectiontimes
- get_subpath (diamond_shape,
- left, up,
- (0, 0)));
- t_out := xpart ((stropha_ellipse shifted z11)
- intersectiontimes
- get_subpath (diamond_shape,
- up, right,
- (0, 0)));
-
- % the addition or subtraction of `1' is necessary
- % so that we get the right starting point
- fill get_subpath_i (diamond_shape,
- dir (angle (z2 - z1) - 1),
- dir (angle (z1 - z4) + 1),
- (0, 0))
- -- get_subpath (stropha_ellipse,
- direction t_in of stropha_ellipse,
- direction t_out of stropha_ellipse,
- z11)
- -- cycle;
-
- labels (11);
- fi;
-
- if (auctum and not stropha):
- clearit;
-
- fill get_subpath (diamond_shape,
- left,
- -dir (90 - off_angle),
- (0, 0))
- .. get_subpath (circle,
- dir (90 + alpha),
- -dir (90 + alpha),
- z13)
- .. get_subpath (circle,
- dir (90 - off_angle),
- right,
- z12)
- -- cycle;
-
- labels (13);
- fi;
-
- if (auctum and stropha):
- clearit;
-
- save t;
-
- t := xpart ((stropha_ellipse shifted z11)
- intersectiontimes
- get_subpath (diamond_shape, up, right,
- (0, 0)));
-
- % the addition or subtraction of `1' is necessary
- % so that we get the right starting point
- fill get_subpath_i (diamond_shape,
- dir (angle (z2 - z1) - 1),
- -dir (90 - off_angle),
- (0, 0))
- .. get_subpath (circle,
- dir (90 + alpha),
- -dir (90 + alpha),
- z13)
- .. get_subpath (stropha_ellipse,
- dir (90 - off_angle),
- direction t of stropha_ellipse,
- z11)
- -- cycle;
-
- labels (11, 13);
- fi;
- fet_endchar;
-enddef;
-
-
-% punctum
-vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
- false, false, false, false,
- false, false, false, 1.0);
-
-
-% punctum cavum (for OpusTeX compatibility)
-vat_punctum_char ("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
- false, true, false, false,
- false, false, false, 1.0);
-
-
-% linea punctum (for OpusTeX compatibility)
-vat_punctum_char ("Ed. Vat. linea punctum", "vaticana.linea.punctum",
- true, false, false, false,
- false, false, false, 1.0);
-
-
-% linea punctum cavum (for OpusTeX compatibility)
-vat_punctum_char ("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
- true, true, false, false,
- false, false, false, 1.0);
-
-
-% punctum inclinatum
-inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
- false, false, false);
-
-
-% pes lower punctum
-vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
- false, false, true, false,
- true, false, false, 1.0);
-
-
-% pes lower punctum
-vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
- false, false, true, false,
- true, false, true, 1.0);
-
-
-% pes upper punctum
-vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
- false, false, true, false,
- false, false, false, 1.0);
-
-
-% pes upper punctum (shifted variation)
-%
-% This note head is used instead of the regular pes upper punctum to
-% avoid collision with the lower punctum note of the pes when the upper
-% punctum sits directly on top of the lower punctum.
-%
-vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
- false, false, true, false,
- false, true, false, 1.0);
-
-
-% small punctum as used in epiphonus
-vat_punctum_char ("Ed. Vat. plica", "vaticana.plica",
- false, false, false, false,
- false, false, false, 0.6);
-
-
-% small punctum as used in epiphonus
-plica_char ("Ed. Vat. var plica", "vaticana.vplica",
- false, 0.6);
-
-
-% eccentric punctum as used in epiphonus
-epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
- false, true, false, 1.0);
-
-
-% eccentric punctum as used in epiphonus (shifted variation)
-%
-% This note head is used instead of the regular epiphonus punctum to
-% avoid collision with the plica head when the plica sits directly on
-% top of the lower head.
-%
-epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
- false, true, true, 1.0);
-
-
-% small punctum as used in cephalicus
-vat_punctum_char ("Ed. Vat. rev. plica", "vaticana.reverse.plica",
- false, false, false, false,
- true, false, false, 0.6);
-
-
-% small punctum as used in cephalicus
-plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
- true, 0.6);
-
-
-% eccentric punctum as used in cephalicus; without left stem
-epiphonus_char ("Ed. Vat. inner cephalicus", "vaticana.inner.cephalicus",
- false, false, false, 1.0);
-
-
-% eccentric punctum as used in cephalicus; with left stem
-epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
- true, false, false, 1.0);
-
-
-% quilisma
-fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
- save a_b, b_h, a_w;
-
- a_b := 1.54; % b_h * a_b / a_w = wd / ht
- b_h := 0.85;
- a_w := 1.09;
-
- save a, beta, ht, wd;
-
- ht# = noteheight#;
- 2 beta = ht# * b_h;
- a = beta * a_b;
- wd# = 2 a / a_w;
-
- set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
-
- black_notehead_width# := wd#;
-
- define_pixels (ht, wd);
-
- save ellipse, T;
- path ellipse;
- transform T;
-
- T := identity xscaled linethickness
- yscaled 0.44 ht;
- pickup pencircle transformed T;
- ellipse := reverse fullcircle transformed T;
-
- z1 = (rt 0.00 wd, top -0.28 ht);
- z2 = (0.11 wd, -0.14 ht);
- z3 = (0.12 wd, +0.03 ht);
- z4 = (0.25 wd, -0.09 ht);
- z5 = (0.25 wd, +0.08 ht);
- z6 = (lft 0.42 wd, -0.04 ht);
- z7 = (lft 0.40 wd, bot +0.36 ht);
-
- fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
- -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
- -- cycle;
- fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
- -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
- -- cycle;
- fill get_subpath (ellipse, z5 - z6, z6 - z5, z5)
- -- point 0 of get_subpath (ellipse, z6 - z5, z5 - z6, z6)
- -- get_subpath (ellipse, z7 - z6, z6 - z7, z7)
- -- get_subpath (ellipse, z6 - z7, z5 - z6, z6)
- -- cycle;
-
- labels (1, 2, 3, 4, 5, 6, 7);
-fet_endchar;
-
-
-% solesmes punctum inclinatum parvum
-inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
- true, false, false);
-
-
-% solesmes punctum auctum ascendens
-vat_punctum_char ("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
- false, false, false, true,
- true, false, false, 1.0);
-
-
-% solesmes punctum auctum descendens
-vat_punctum_char ("Solesmes punctum auctum descendens", "solesmes.auct.desc",
- false, false, false, true,
- false, false, false, 1.0);
-
-
-% solesmes punctum inclinatum auctum
-inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
- false, false, true);
-
-
-% solesmes stropha
-inclinatum_char ("Solesmes stropha", "solesmes.stropha",
- false, true, false);
-
-
-% solesmes stropha aucta
-inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
- false, true, true);
-
-
-% solesmes oriscus
-fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
- save a_b, b_h, a_w;
-
- a_b := 1.54; % b_h * a_b / a_w = wd / ht
- b_h := 0.85;
- a_w := 1.09;
-
- save a, beta, ht, wd;
-
- ht# = noteheight#;
- 2 beta = ht# * b_h;
- a = beta * a_b;
- wd# = 2 a / a_w;
- black_notehead_width# := wd#;
-
- save convexity;
-
- convexity# = +0.05 ht#;
-
- define_pixels (ht, wd, convexity);
-
- set_char_box (0.00 wd#, 0.50 wd#,
- 0.25 ht# + convexity#, 0.25 ht# + convexity#);
-
- z1 = (0.00 wd + blot_diameter / 2, -convexity);
- z2 = (1/6 wd, +convexity);
- z3 = (2/6 wd, -convexity);
- z4 = (0.50 wd - blot_diameter / 2, +convexity);
-
-
- save height;
-
- height = 2 ypart (directionpoint right of (z1
- .. z2
- .. z3
- .. z4));
-
- save ellipse, T;
- path ellipse;
- transform T;
-
- T := identity xscaled blot_diameter
- yscaled (h + d - height);
- pickup pencircle transformed T;
- ellipse := fullcircle transformed T;
-
- % Adjust vertical coordinates to touch bounding box.
- y1 := top -d;
- y4 := bot h;
-
- save d_;
- pair d_;
-
- d_ := direction 0 of (z1
- .. z2
- .. z3
- .. z4);
-
- fill get_subpath (ellipse, -d_, d_, z1)
- .. bot z2
- .. bot z3
- .. get_subpath (ellipse, d_, -d_, z4)
- .. top z3
- .. top z2
- .. cycle;
-
- labels (1, 2, 3, 4);
-fet_endchar;
-
-
-%%%%%%%%
-%
-%
-%
-% EDITIO MEDICAEA
-%
-%
-%
-
-% inclinatum
-fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
- draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
-fet_endchar;
-
-
-def med_punctum_char (expr verbose_name, internal_name,
- left_up_stem, left_down_stem) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save a, ht, wd;
-
- ht# = 2 staff_space#;
- wd# = ht#;
- black_notehead_width# := wd#;
-
- define_pixels (ht, wd);
-
- save ellipse;
- path ellipse;
-
- ellipse := fullcircle xscaled blot_diameter
- yscaled 0.50 ht;
-
- z1 = (0.00 wd + blot_diameter / 2, 0);
- z2 = (0.4 wd - blot_diameter / 2, 0);
-
- labels (1, 2);
-
- pickup pencircle scaled linethickness;
-
- if left_down_stem:
- z4 = (0.00 wd + linethickness / 2, -1.25 ht);
-
- fill get_subpath (ellipse, left, down, z1)
- -- top lft z4{down}
- .. z4{right}
- .. top rt z4{up}
- -- (rt x4, -.5 ht / 2)
- -- get_subpath (ellipse, right, left, z2)
- -- cycle;
-
- labels (4);
-
- set_char_box (0.0, 0.4 wd#, 1.25 ht#, 0.25 ht#);
- elseif left_up_stem:
- z4 = (0.00 wd + linethickness / 2, +1.25 ht);
-
- fill get_subpath (ellipse, down, right, z1)
- -- get_subpath (ellipse, right, left, z2)
- -- (rt x4, .5 ht / 2)
- -- bot rt z4{up}
- .. z4{left}
- .. bot lft z4{down}
- -- cycle;
-
- labels (4);
-
- set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
- else:
- fill get_subpath (ellipse, left, right, z1)
- -- get_subpath (ellipse, right, left, z2)
- -- cycle;
-
- set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
- fi;
-
- fet_endchar;
-enddef;
-
-
-% punctum
-med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
- false, false);
-
-
-% left up-stemmed punctum
-med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
- true, false);
-
-
-% virga (i.e. left down-stemmed punctum)
-med_punctum_char ("Ed. Med. virga", "medicaea.virga",
- false, true);
-
-
-%%%%%%%%
-%
-%
-%
-% HUFNAGEL
-%
-%
-%
-
-def huf_punctum_char (expr verbose_name, internal_name,
- down_stem) =
- fet_beginchar (verbose_name, "s" & internal_name);
- save alpha;
-
- alpha = 55;
-
- draw_diamond_head (staff_space#, 0, 0, alpha, false);
-
- if down_stem:
- set_char_box (0, head_width#,
- 1.5 staff_space#, head_height# / 2);
-
- save ellipse;
- path ellipse;
-
- ellipse := reverse fullcircle xscaled blot_diameter
- yscaled 0.7 staff_space
- rotated -alpha;
-
- z11 = (head_width / 2, 0);
- z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
- (w / 2, -d), (w / 2, 0));
-
- fill get_subpath (ellipse, up, down, z11)
- -- get_subpath (ellipse, down, up, z12)
- -- cycle;
-
- labels (11, 12);
- fi;
- fet_endchar;
-enddef;
-
-
-% punctum
-huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
-
-
-% virga
-huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
-
-
-% pes lower punctum
-fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
- save width, height, alpha;
-
- width# = 2 * staff_space#;
- height# = 0.7 * staff_space#;
- alpha = 35;
-
- set_char_box (0, width#, height# / 2, height# / 2);
-
- define_pixels (width, height);
-
- save circle;
- path circle;
-
- circle := reverse fullcircle scaled linethickness;
-
- pickup pencircle scaled linethickness;
-
- rt x3 = -lft x1 = width / 2;
- y2 = y3 = height / 2;
- y1 = y4 = -height / 2;
-
- tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
-
- fill get_subpath (circle, left, z2 - z1, z1)
- -- get_subpath (circle, z2 - z1, right, z2)
- -- get_subpath (circle, right, z4 - z3, z3)
- -- get_subpath (circle, z4 - z3, left, z4)
- -- cycle;
-
- currentpicture := currentpicture shifted (width/2, 0);
-
-% labels (1, 2, 3, 4);
-fet_endchar;
-
-
-fet_endgroup ("noteheads");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- ancient note heads
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 2001--2009 Juergen Reuter <reuter@ipd.uka.de>
+%
+% Neo-mensural heads originally by
+% Christian Mondrup and Mats Bengtsson
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+save black_notehead_width;
+numeric black_notehead_width;
+
+fet_begingroup ("noteheads");
+
+%
+% character aligment:
+%
+% The head is assumed to be vertically centered around (0, 0).
+% The left-most edge of the head should touch the vertical line
+% that goes though the point (0, 0).
+%
+% set_char_box() conventions:
+%
+% * breapth: Ignored (as far as I know). Should be set to 0.
+%
+% * width: Should match the head's width.
+%
+% * depth: Should match the bottom edge of the head. Affects vertical
+% collision handling.
+%
+% * height: Should match the top edge of the head. Affects vertical
+% collision handling.
+%
+% TODO: should depth/height include appendages/stems?
+
+overdone_heads = 0;
+noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
+define_pixels (noteheight);
+
+
+%%%%%%%%
+%
+%
+%
+% MENSURAL NOTATION
+%
+%
+%
+
+def draw_neomensural_brevis (expr brevwid) =
+ save beamheight, head_width;
+ save holeheight, stem_width;
+ save serif_size, serif_protrude;
+
+ head_width# = brevwid;
+ holeheight = 3 stafflinethickness;
+ stem_width = 1.4 stafflinethickness;
+
+ define_pixels (head_width);
+
+ set_char_box (0, head_width#,
+ noteheight# / 2, noteheight# / 2);
+
+ 2 beamheight + holeheight = noteheight;
+ serif_size = (holeheight - stafflinethickness) / 2;
+ serif_protrude = 1.5 serif_size;
+
+ z1l = (0, 0);
+ z2l = (0, -stafflinethickness / 2);
+ z3r = z2r + serif_size * (1, -1);
+ y4r = y3r;
+ x4r = head_width / 2;
+ z5l = z3l + (-serif_size, -serif_protrude);
+
+ penpos1 (stem_width, 0);
+ penpos2 (stem_width, 0);
+ penpos3 (beamheight, 90);
+ penpos4 (beamheight, 90);
+ penpos5 (stem_width, 180);
+
+ save pat_in, pat_out;
+ path pat_in, pat_out;
+
+ pat_out := z4l
+ -- z3l{left}
+ .. z5l{down}
+ .. z5r{up}
+ -- z1l;
+ pat_out := pat_out
+ -- reverse pat_out yscaled -1;
+ pat_out := pat_out
+ -- reverse pat_out shifted (-x4r, 0)
+ xscaled -1
+ shifted (x4l, 0)
+ -- cycle;
+ fill pat_out;
+
+ pat_in := z4r
+ -- z3r{left}
+ .. z2r{up}
+ -- z1r;
+ pat_in := pat_in
+ -- reverse pat_in yscaled -1;
+ pat_in := pat_in
+ -- reverse pat_in shifted (-x4r, 0)
+ xscaled -1
+ shifted (x4l, 0)
+ -- cycle;
+ unfill pat_in;
+
+ penlabels (1, 2, 3, 4, 5);
+enddef;
+
+
+%%% This head does not seem to be used anywhere. Junk me? -- jr
+def draw_neomensural_left_stemmed_head (expr wid) =
+ draw_neomensural_brevis (wid);
+
+ x6 = x7 = stem_width / 2;
+ y6 = y5;
+ y7 = y5 - 2.25 staff_space;
+
+ z17 = (x7, y7 - stem_width / 2);
+
+ penpos6 (stem_width, 0);
+ penpos7 (stem_width, 0);
+
+ fill z7l
+ -- z6l
+ -- z6r
+ -- z7r
+ .. z17
+ .. cycle;
+
+ penlabels (6, 7);
+ labels (17);
+enddef;
+
+
+%%% This head does not seem to be used anywhere. Junk me? -- jr
+fet_beginchar ("Left stemmed notehead", "slneomensural");
+ draw_neomensural_left_stemmed_head (2 staff_space#);
+fet_endchar;
+
+
+%
+% Some sources (eg. Musix/OpusTeX) think that the appendage should be on
+% the left, some say right. Right wins democratically.
+%
+def draw_neomensural_longa (expr wid) =
+ draw_neomensural_brevis (wid);
+
+ save theta;
+
+ x7r = head_width;
+ y7 = y5;
+ z6 - z7 = (stem_width / 2, -staff_space);
+ theta = angle (z6 - z7) + 90;
+
+ penpos7 (stem_width, 0);
+ penpos6 (1.2 stem_width, theta);
+
+ z7' = find_tangent (z6l, pat_out,
+ (x7l + 0.5 stem_width, y7l),
+ (x7l - 0.5 stem_width, y7l));
+
+ fill z7r
+ .. z6r{z6 - z7}
+ .. {z7 - z6}z6l
+ -- z7'
+ -- cycle;
+
+ penlabels (6, 7);
+ labels (7');
+enddef;
+
+
+%
+% En wij presenteren U: de opvolgster van Emily
+%
+% (ze is wel breed)
+%
+fet_beginchar ("Neo-mensural maxima notehead", "sM3neomensural");
+ draw_neomensural_longa (2.6 staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Neo-mensural longa notehead", "sM2neomensural");
+ draw_neomensural_longa (2 staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural");
+ draw_neomensural_brevis (2 staff_space#);
+fet_endchar;
+
+
+def draw_neomensural_black_head (expr wid, height) =
+ save head_width;
+ save ne, nw, ne_dist, nw_dist;
+ pair ne, nw, ne_dist, nw_dist;
+
+ head_width# = wid;
+
+ set_char_box (0, head_width#,
+ height / 2, height / 2);
+
+ charwx := head_width# / 2;
+ charwy := height / 2;
+
+ y3 = y1 = 0;
+ x2 = x4 = (x1 + x3) / 2;
+
+ pickup pencircle scaled blot_diameter;
+
+ top y2 = h;
+ bot y4 = -d;
+ lft x1 = 0;
+ rt x3 = w;
+
+ ne := unitvector (z2 - z1);
+ nw_dist := (ne rotated 90) * 0.5 blot_diameter;
+ nw := unitvector (z2 - z3);
+ ne_dist := (nw rotated -90) * 0.5 blot_diameter;
+
+ fill lft z1{up}
+ .. (z1 + nw_dist){ne}
+ -- (z2 + nw_dist){ne}
+ .. top z2{right}
+ .. (z2 + ne_dist){-nw}
+ -- (z3 + ne_dist){-nw}
+ .. rt z3{down}
+ .. (z3 - nw_dist){-ne}
+ -- (z4 - nw_dist){-ne}
+ .. bot z4{left}
+ .. (z4 - ne_dist){nw}
+ -- (z1 - ne_dist){nw}
+ .. cycle;
+
+ labels (1, 2, 3, 4);
+enddef;
+
+
+def draw_neomensural_open_head (expr wid, height)=
+ draw_neomensural_black_head (wid, height);
+
+ save diamNW, diamSW;
+
+ diamNW = length (z2 - z1) + blot_diameter;
+ diamSW = length (z4 - z1) + blot_diameter;
+
+ save hole_widthNW, hole_widthSW;
+
+ hole_widthNW = 0.34 diamNW ;
+ hole_widthSW + 2.6 linethickness = diamSW;
+
+ (z7 + z5) / 2 = (w / 2, 0);
+ (z8 + z6) / 2 = (w / 2, 0);
+ z6 - z5 = hole_widthNW * unitvector (z2 - z1);
+ z7 - z6 = hole_widthSW * unitvector (z4 - z1);
+
+ unfill z5
+ -- z6
+ -- z7
+ -- z8
+ -- cycle;
+
+ labels (5, 6, 7, 8);
+enddef;
+
+
+%
+% WL says the thin lines should be thinner.
+%
+fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic");
+ draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#);
+ charwx := head_width#;
+ charwy := 0;
+fet_endchar;
+
+
+fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic");
+ draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#);
+ charwx := head_width#;
+ charwy := 0;
+fet_endchar;
+
+
+fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural");
+ draw_neomensural_open_head (staff_space#, noteheight#);
+fet_endchar;
+
+
+fet_beginchar ("Neo-mensural minima head", "s1neomensural");
+ draw_neomensural_open_head (staff_space#, noteheight#);
+fet_endchar;
+
+
+fet_beginchar ("Neo-mensural semiminima head", "s2neomensural");
+ draw_neomensural_black_head (staff_space#, noteheight#);
+fet_endchar;
+
+
+def draw_mensural_brevis (expr wid) =
+ % TODO. For the moment, fall back to draw_neomensural_brevis.
+ draw_neomensural_brevis (wid);
+enddef;
+
+
+%%% This head does not seem to be used anywhere. Junk me? -- jr
+def draw_mensural_left_stemmed_head (expr wid) =
+ draw_mensural_brevis (wid);
+
+ x6 = x7 = stem_width / 2;
+ y6 = y5;
+ y7 = y5 - 2.25 staff_space;
+
+ z17 = (x7, y7 - stem_width / 2);
+
+ penpos6 (stem_width, 0);
+ penpos7 (stem_width, 0);
+
+ fill z7l
+ -- z6l
+ -- z6r
+ -- z7r
+ .. z17
+ .. cycle;
+
+ penlabels (6, 7);
+ labels (17);
+enddef;
+
+
+def draw_mensural_longa (expr wid) =
+ draw_mensural_brevis (wid);
+
+ x6 = x7 = head_width - stem_width / 2;
+ y6 = y5;
+ y7 = y5 - 2.25 staff_space;
+
+ z17 = (x7, y7 - stem_width / 2);
+
+ penpos6 (stem_width, 0);
+ penpos7 (stem_width, 0);
+
+ fill z7l
+ -- z6l
+ -- z6r
+ -- z7r
+ .. z17
+ .. cycle;
+
+ penlabels (6, 7);
+ labels (17);
+enddef;
+
+
+%%% This head does not seem to be used anywhere. Junk me? -- jr
+fet_beginchar ("Mensural left stemmed notehead", "slmensural");
+ draw_mensural_left_stemmed_head (staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Mensural maxima notehead", "sM3mensural");
+ draw_mensural_longa (2.0 staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Mensural longa notehead", "sM2mensural");
+ draw_mensural_longa (staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Mensural brevis notehead", "sM1mensural");
+ draw_mensural_brevis (staff_space#);
+fet_endchar;
+
+
+def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) =
+ save head_width, head_height;
+ save ellipse, ellipse_r;
+ path ellipse, ellipse_r, diamond_shape;
+
+ head_height# = head_h;
+ head_width# / head_height# = tand (angle);
+
+ set_char_box (0, head_width#,
+ head_height# / 2, head_height# / 2);
+
+ charwx := head_width# / 2;
+ charwy := head_height# / 2 - linethickness#;
+
+ define_pixels (head_width, head_height);
+
+ ellipse := reverse fullcircle
+ xscaled (max (blot_diameter, pen_w * head_width))
+ yscaled (max (blot_diameter, pen_h * head_width))
+ rotated -angle;
+
+ z1 = find_tangent_shift (((0, h) -- (0, -h)), ellipse,
+ (0, 0), (w / 2, 0));
+ z2 = find_tangent_shift (((0, h) -- (w, h)), ellipse,
+ (w / 2, h), (w / 2, 0));
+ z3 = find_tangent_shift (((w, h) -- (w, -h)), ellipse,
+ (w, 0), (w / 2, 0));
+ z4 = find_tangent_shift (((0, -h) -- (w, -h)), ellipse,
+ (w / 2, -h), (w / 2, 0));
+
+ diamond_shape := get_subpath (ellipse, z1 - z4, z2 - z1, z1)
+ -- get_subpath (ellipse, z2 - z1, z3 - z2, z2)
+ -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
+ -- get_subpath (ellipse, z4 - z3, z1 - z4, z4)
+ -- cycle;
+ fill diamond_shape;
+
+ if open:
+ save l;
+ path l[];
+
+ l12 := (directionpoint (z1 - z2) of ellipse) shifted z1
+ -- (directionpoint (z1 - z2) of ellipse) shifted z2;
+ l23 := (directionpoint (z2 - z3) of ellipse) shifted z2
+ -- (directionpoint (z2 - z3) of ellipse) shifted z3;
+ l34 := (directionpoint (z3 - z4) of ellipse) shifted z3
+ -- (directionpoint (z3 - z4) of ellipse) shifted z4;
+ l41 := (directionpoint (z4 - z1) of ellipse) shifted z4
+ -- (directionpoint (z4 - z1) of ellipse) shifted z1;
+
+ unfill l12 intersectionpoint l23
+ -- l23 intersectionpoint l34
+ -- l34 intersectionpoint l41
+ -- l41 intersectionpoint l12
+ -- cycle;
+ fi;
+
+ labels (1, 2, 3, 4);
+enddef;
+
+
+fet_beginchar ("Mensural semibrevis head", "s0mensural");
+ draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
+fet_endchar;
+
+
+fet_beginchar ("Mensural minima head", "s1mensural");
+ draw_diamond_head (staff_space#, 0.15, 0.30, 30, true);
+fet_endchar;
+
+
+fet_beginchar ("Mensural semiminima head", "s2mensural");
+ draw_diamond_head (staff_space#, 0.15, 0.30, 30, false);
+fet_endchar;
+
+
+fet_beginchar ("Petrucci semibrevis head", "s0petrucci");
+% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
+ draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Petrucci minima head", "s1petrucci");
+% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true);
+ draw_neomensural_open_head (staff_space#, 1.8 staff_space#);
+fet_endchar;
+
+
+fet_beginchar ("Petrucci semiminima head", "s2petrucci");
+% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, false);
+ draw_neomensural_black_head (staff_space#, 1.8 staff_space#);
+fet_endchar;
+
+
+%%%%%%%%
+%
+%
+%
+% EDITIO VATICANA (including solesmes extensions)
+%
+%
+%
+
+def vat_punctum_char (expr verbose_name, internal_name,
+ linea, cavum, straight, auctum,
+ d_up, up_shift, down_shift, mag) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save a_b, b_h, a_w;
+
+ a_b := 1.54; % b_h * a_b / a_w = wd / ht
+ b_h := 0.85;
+ a_w := 1.09;
+
+ save a, beta, ht, wd;
+
+ ht# = noteheight# * mag;
+ 2 beta = ht# * b_h;
+ a = beta * a_b;
+ wd# = 2 a / a_w;
+ black_notehead_width# := wd#;
+
+ % direction
+ save d_, d_sign;
+ pair d_;
+
+ if d_up:
+ d_ := up;
+ d_sign := 1;
+ else:
+ d_ := down;
+ d_sign := -1;
+ fi;
+
+ % convexity and eccentricity
+ save u_convexity, u_eccentricity;
+
+ if straight:
+ u_convexity# := -0.01 ht#;
+ u_eccentricity# := 0.0 ht#; % dummy
+ elseif auctum:
+ u_convexity# := -0.03 ht#;
+ u_eccentricity# := +0.25 ht#;
+ else:
+ u_convexity# := -0.05 ht#;
+ u_eccentricity# := 0.0 ht#; % dummy
+ fi;
+
+ save convexity, eccentricity;
+
+ convexity# := d_sign * u_convexity#;
+ eccentricity# := d_sign * u_eccentricity#;
+
+ % y shift offset
+ save yoffs;
+
+ if up_shift:
+ yoffs# := 0.08 ht#;
+ elseif down_shift:
+ yoffs# := -0.11 ht#;
+ else:
+ yoffs# := 0.00 ht#;
+ fi;
+
+ define_pixels (convexity, eccentricity, yoffs, ht, wd);
+
+ pickup pencircle scaled linethickness;
+
+ save height, yoffs_bt, p, circle, circle_r;
+ path p, circle, circle_r;
+
+ height# = 0.47 ht#;
+ yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
+
+ define_pixels (height, yoffs_bt);
+
+ circle := fullcircle scaled linethickness;
+
+ x1 = x6;
+ x2 = x5;
+ x3 = x4;
+ y1 + height = y6;
+ y2 + height = y5;
+ y3 + height = y4;
+
+ save box_top, box_bt;
+
+ if auctum:
+ z1 = (0.00 wd + linethickness / 2, yoffs_bt);
+ z2 = (0.21 wd, yoffs_bt + convexity);
+ z3 = (0.42 wd - linethickness/ 2,
+ yoffs_bt + eccentricity);
+ box_top# = height# + yoffs_bt# +
+ max (0, convexity#, eccentricity#);
+ box_bt# = yoffs_bt# +
+ min (0, convexity#, eccentricity#);
+ p = z1
+ .. {right}z2
+ .. {d_}z3
+ -- z4{-d_}
+ .. z5{left}
+ .. z6
+ -- cycle;
+ else:
+ z1 = (0.00 wd + linethickness / 2, yoffs_bt);
+ z2 = (0.21 wd, yoffs_bt + convexity);
+ z3 = (0.42 wd - linethickness / 2, yoffs_bt);
+ box_top# = height# + yoffs_bt# + max (0, convexity#);
+ box_bt# = yoffs_bt# + min (0, convexity#);
+ p = z1
+ .. z2
+ .. z3
+ -- z4
+ .. z5
+ .. z6
+ -- cycle;
+ fi;
+
+ labels (1, 2, 3, 4, 5, 6);
+
+ save dirs;
+ pair dirs[];
+
+ dirs12 := direction (0 + epsilon) of p;
+ dirs2 := direction 1 of p;
+ dirs32 := direction (2 - epsilon) of p;
+ dirs45 := direction (3 + epsilon) of p;
+ dirs5 := direction 4 of p;
+ dirs65 := direction (5 - epsilon) of p;
+
+ fill get_subpath (circle, down, dirs12, z1)
+ .. (bot z2){dirs2}
+ .. get_subpath (circle, dirs32, up, z3)
+ -- get_subpath (circle, up, dirs45, z4)
+ .. (top z5){dirs5}
+ .. get_subpath (circle, dirs65, down, z6)
+ -- cycle;
+
+ if cavum:
+ save pat, t;
+ path pat[];
+ numeric t[];
+
+ pat123 := ((directionpoint -dirs12 of circle)
+ shifted z1){dirs12}
+ .. (top z2){dirs2}
+ .. {dirs32}((directionpoint -dirs32 of circle)
+ shifted z3);
+ pat34 := lft z3
+ -- lft z4;
+ pat456 := ((directionpoint -dirs45 of circle)
+ shifted z4){dirs45}
+ .. (bot z5){dirs5}
+ .. {dirs65}((directionpoint -dirs65 of circle)
+ shifted z6);
+ pat61 := rt z6
+ -- rt z1;
+
+ t61 := ypart (pat61 intersectiontimes pat123);
+ t12 := xpart (pat123 intersectiontimes pat34);
+ t34 := ypart (pat34 intersectiontimes pat456);
+ t45 := xpart (pat456 intersectiontimes pat61);
+
+ unfill subpath (t61, t12) of pat123
+ -- subpath (t34, t45) of pat456
+ -- cycle;
+ fi;
+
+ set_char_box (0.00 wd#, 0.42 wd#,
+ max (0, -box_bt#) + linethickness# / 2,
+ max (0, box_top#) + linethickness# / 2);
+
+ if linea:
+ save linea_width, linea_height;
+
+ linea_width# = 0.6 linethickness#;
+ linea_height# = 0.7 ht#;
+
+ define_pixels (linea_width, linea_height);
+
+ pickup pencircle scaled 0.6 linethickness;
+
+ draw_rounded_block ((-0.10 wd - linea_width / 2,
+ -linea_height / 2),
+ (-0.10 wd + linea_width / 2,
+ +linea_height / 2),
+ 0.6 linethickness);
+ draw_rounded_block ((+0.52 wd - linea_width / 2,
+ -linea_height / 2),
+ (+0.52 wd + linea_width / 2,
+ +linea_height / 2),
+ 0.6 linethickness);
+
+ set_char_box (0, 0.62 wd# + linea_width#,
+ linea_height# / 2,
+ linea_height# / 2);
+
+ currentpicture := currentpicture
+ shifted (0.10 wd + linea_width / 2, 0);
+ fi;
+ fet_endchar;
+enddef;
+
+
+def plica_char (expr verbose_name, internal_name,
+ d_up, mag) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save a_b, b_h, a_w;
+
+ a_b := 1.54; % b_h * a_b / a_w = wd / ht
+ b_h := 0.85;
+ a_w := 1.09;
+
+ save a, beta, ht, wd;
+
+ ht# = noteheight# * mag;
+ 2 beta = ht# * b_h;
+ a = beta * a_b;
+ wd# = 2 a / a_w;
+ black_notehead_width# := wd#;
+
+ % direction
+ save d_, d_sign;
+ pair d_;
+
+ if d_up:
+ d_ := up;
+ d_sign := 1;
+ else:
+ d_ := down;
+ d_sign := -1;
+ fi;
+
+ % convexity and eccentricity
+ save convexity, eccentricity;
+
+ convexity# := d_sign * -0.10 ht#;
+ eccentricity# := d_sign * -0.12 ht#;
+
+ % y shift offset
+ save yoffs;
+
+ yoffs# := -0.11 ht#;
+
+ define_pixels (convexity, eccentricity, yoffs, ht, wd);
+
+ pickup pencircle scaled linethickness;
+
+ save height, yoffs_bt, p, circle, circle_r;
+ path p, circle, circle_r;
+
+ height# = 0.47 ht#;
+ yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
+
+ define_pixels (height, yoffs_bt);
+
+ circle := fullcircle scaled linethickness;
+
+ x1 = x6;
+ x2 = x5;
+ x3 = x4;
+ y1 + height = y6;
+ y2 + height = y5;
+ y3 + height = y4;
+
+ save box_top, box_bt;
+
+ z1 = (0.00 wd + linethickness / 2, yoffs_bt);
+ z2 = (0.21 wd, yoffs_bt + convexity);
+ z3 = (0.42 wd - linethickness/ 2, yoffs_bt + eccentricity);
+ box_top# = height# + yoffs_bt# +
+ max (0, convexity#, eccentricity#);
+ box_bt# = yoffs_bt# +
+ min (0, convexity#, eccentricity#);
+ p = z1
+ .. z2{right}
+ .. z3
+ -- z4
+ .. z5{left}
+ .. z6
+ -- cycle;
+
+ labels (1, 2, 3, 4, 5, 6);
+
+ save dirs;
+ pair dirs[];
+
+ dirs12 := direction (0 + epsilon) of p;
+ dirs2 := direction 1 of p;
+ dirs32 := direction (2 - epsilon) of p;
+ dirs45 := direction (3 + epsilon) of p;
+ dirs5 := direction 4 of p;
+ dirs65 := direction (5 - epsilon) of p;
+
+ fill get_subpath (circle, down, dirs12, z1)
+ .. (bot z2){dirs2}
+ .. get_subpath (circle, dirs32, up, z3)
+ -- get_subpath (circle, up, dirs45, z4)
+ .. (top z5){dirs5}
+ .. get_subpath (circle, dirs65, down, z6)
+ -- cycle;
+
+ pickup pencircle scaled 0.6 linethickness;
+
+ save stem_bt;
+
+ set_char_box (0.00 wd#, 0.42 wd#,
+ max (0, -box_bt#) + linethickness# / 2,
+ max (0, box_top#) + linethickness# / 2);
+
+ fet_endchar;
+enddef;
+
+
+def epiphonus_char (expr verbose_name, internal_name,
+ left_stem, d_up, down_shift, mag) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save a_b, b_h, a_w;
+
+ a_b := 1.54; % b_h * a_b / a_w = wd / ht
+ b_h := 0.85;
+ a_w := 1.09;
+
+ save a, beta, ht, wd;
+
+ ht# = noteheight# * mag;
+ 2 beta = ht# * b_h;
+ a = beta * a_b;
+ wd# = 2 a / a_w;
+ black_notehead_width# := wd#;
+
+ % direction
+ save d_, d_sign;
+ pair d_;
+
+ if d_up:
+ d_ := up;
+ d_sign := 1;
+ else:
+ d_ := down;
+ d_sign := -1;
+ fi;
+
+ % convexity and eccentricity
+ save convexity;
+
+ convexity# := d_sign * -0.05ht#;
+
+ % y shift offset
+ save yoffs;
+
+ if down_shift:
+ yoffs# := -0.11 ht#;
+ else:
+ yoffs# := 0.00 ht#;
+ fi;
+
+ define_pixels (convexity, yoffs, ht, wd);
+
+ pickup pencircle scaled linethickness;
+
+ save height, yoffs_bt, p, circle, circle_r;
+ path p, circle, circle_r;
+
+ height# = 0.47 ht#;
+ yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
+
+ define_pixels (height, yoffs_bt);
+
+ circle := fullcircle scaled linethickness;
+
+ x1 = x6;
+ x2 = x5;
+ x3 = x4;
+ y1 + height = y6;
+ y2 + height = y5;
+ y3 + height = y4;
+
+ save box_top, box_bt;
+
+ z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
+ z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
+ z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
+ box_top# = height# + yoffs_bt# +
+ max (-1.0 convexity#, 1.4 convexity#, 0);
+ box_bt# = yoffs_bt# +
+ min (-1.0 convexity#, 1.4 convexity#, 0);
+ p = z1{-d_}
+ .. {curl 1}z2{right}
+ .. z3
+ -- z4
+ .. {left}z5{curl 1}
+ .. {d_}z6
+ -- cycle;
+
+ labels (1, 2, 3, 4, 5, 6);
+
+ save dirs;
+ pair dirs[];
+
+ dirs12 := direction (0 + epsilon) of p;
+ dirs21 := direction (1 - epsilon) of p;
+ dirs23 := direction (1 + epsilon) of p;
+ dirs32 := direction (2 - epsilon) of p;
+ dirs45 := direction (3 + epsilon) of p;
+ dirs54 := direction (4 - epsilon) of p;
+ dirs56 := direction (4 + epsilon) of p;
+ dirs65 := direction (5 - epsilon) of p;
+
+ fill get_subpath (circle, down, dirs12, z1)
+ .. get_subpath (circle, dirs21, dirs23, z2)
+ .. get_subpath (circle, dirs32, up, z3)
+ -- get_subpath (circle, up, dirs45, z4)
+ .. get_subpath (circle, dirs54, dirs56, z5)
+ .. get_subpath (circle, dirs65, down, z6)
+ -- cycle;
+
+ save stem_bt;
+
+ if left_stem:
+ pickup pencircle scaled 0.6 linethickness;
+
+ lft x11 = x1 - linethickness / 2;
+ bot y11 = yoffs - 1.1 ht - linethickness / 2;
+ x12 = x11;
+ y12 = y1;
+
+ draw_rounded_block (bot lft z11, top rt z12,
+ 0.6 linethickness);
+ stem_bt# = yoffs# - 1.1 ht#;
+
+ labels (11, 12);
+ else:
+ stem_bt# = 0;
+ fi;
+
+ set_char_box (0.00 wd#, 0.42 wd#,
+ max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
+ max (0, box_top#) + linethickness# / 2);
+ fet_endchar;
+enddef;
+
+
+def inclinatum_char (expr verbose_name, internal_name,
+ small, stropha, auctum) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save ht, alpha;
+
+ alpha := 35;
+
+ if small:
+ ht# = 0.50 noteheight#;
+ else:
+ ht# = 0.80 noteheight#;
+ fi;
+
+ draw_diamond_head (ht#, 0, 0, alpha, false);
+
+ save off_angle;
+
+ off_angle := alpha + 15;
+
+ save stropha_ellipse, auctum_hook, circle;
+ path stropha_ellipse, auctum_hook, circle;
+
+ circle := reverse fullcircle scaled linethickness;
+
+ stropha_ellipse := fullcircle xscaled 0.25 head_height
+ yscaled 0.55 head_height
+ rotated alpha;
+
+ z11 = z12
+ + linethickness / 2 * dir (180 - off_angle)
+ - directionpoint dir (90 - off_angle)
+ of stropha_ellipse;
+ z12 = directionpoint -dir (90 - off_angle) of diamond_shape +
+ linethickness / 2 * dir (180 - off_angle);
+ z13 = (0, -0.5 head_height + linethickness);
+
+ auctum_hook := z12{-dir (90 - off_angle)}
+ .. {dir (90 + alpha)}z13;
+
+ labels (12);
+
+ if (stropha and not auctum):
+ clearit;
+
+ save t_in, t_out;
+
+ t_in := xpart ((stropha_ellipse shifted z11)
+ intersectiontimes
+ get_subpath (diamond_shape,
+ left, up,
+ (0, 0)));
+ t_out := xpart ((stropha_ellipse shifted z11)
+ intersectiontimes
+ get_subpath (diamond_shape,
+ up, right,
+ (0, 0)));
+
+ % the addition or subtraction of `1' is necessary
+ % so that we get the right starting point
+ fill get_subpath_i (diamond_shape,
+ dir (angle (z2 - z1) - 1),
+ dir (angle (z1 - z4) + 1),
+ (0, 0))
+ -- get_subpath (stropha_ellipse,
+ direction t_in of stropha_ellipse,
+ direction t_out of stropha_ellipse,
+ z11)
+ -- cycle;
+
+ labels (11);
+ fi;
+
+ if (auctum and not stropha):
+ clearit;
+
+ fill get_subpath (diamond_shape,
+ left,
+ -dir (90 - off_angle),
+ (0, 0))
+ .. get_subpath (circle,
+ dir (90 + alpha),
+ -dir (90 + alpha),
+ z13)
+ .. get_subpath (circle,
+ dir (90 - off_angle),
+ right,
+ z12)
+ -- cycle;
+
+ labels (13);
+ fi;
+
+ if (auctum and stropha):
+ clearit;
+
+ save t;
+
+ t := xpart ((stropha_ellipse shifted z11)
+ intersectiontimes
+ get_subpath (diamond_shape, up, right,
+ (0, 0)));
+
+ % the addition or subtraction of `1' is necessary
+ % so that we get the right starting point
+ fill get_subpath_i (diamond_shape,
+ dir (angle (z2 - z1) - 1),
+ -dir (90 - off_angle),
+ (0, 0))
+ .. get_subpath (circle,
+ dir (90 + alpha),
+ -dir (90 + alpha),
+ z13)
+ .. get_subpath (stropha_ellipse,
+ dir (90 - off_angle),
+ direction t of stropha_ellipse,
+ z11)
+ -- cycle;
+
+ labels (11, 13);
+ fi;
+ fet_endchar;
+enddef;
+
+
+% punctum
+vat_punctum_char ("Ed. Vat. punctum", "vaticana.punctum",
+ false, false, false, false,
+ false, false, false, 1.0);
+
+
+% punctum cavum (for OpusTeX compatibility)
+vat_punctum_char ("Ed. Vat. punctum cavum", "vaticana.punctum.cavum",
+ false, true, false, false,
+ false, false, false, 1.0);
+
+
+% linea punctum (for OpusTeX compatibility)
+vat_punctum_char ("Ed. Vat. linea punctum", "vaticana.linea.punctum",
+ true, false, false, false,
+ false, false, false, 1.0);
+
+
+% linea punctum cavum (for OpusTeX compatibility)
+vat_punctum_char ("Ed. Vat. linea punctum cavum", "vaticana.linea.punctum.cavum",
+ true, true, false, false,
+ false, false, false, 1.0);
+
+
+% punctum inclinatum
+inclinatum_char ("Ed. Vat. inclinatum", "vaticana.inclinatum",
+ false, false, false);
+
+
+% pes lower punctum
+vat_punctum_char ("Ed. Vat. pes lower punctum", "vaticana.lpes",
+ false, false, true, false,
+ true, false, false, 1.0);
+
+
+% pes lower punctum
+vat_punctum_char ("Ed. Vat. pes var lower punctum", "vaticana.vlpes",
+ false, false, true, false,
+ true, false, true, 1.0);
+
+
+% pes upper punctum
+vat_punctum_char ("Ed. Vat. pes upper punctum", "vaticana.upes",
+ false, false, true, false,
+ false, false, false, 1.0);
+
+
+% pes upper punctum (shifted variation)
+%
+% This note head is used instead of the regular pes upper punctum to
+% avoid collision with the lower punctum note of the pes when the upper
+% punctum sits directly on top of the lower punctum.
+%
+vat_punctum_char ("Ed. Vat. var pes upper punctum", "vaticana.vupes",
+ false, false, true, false,
+ false, true, false, 1.0);
+
+
+% small punctum as used in epiphonus
+vat_punctum_char ("Ed. Vat. plica", "vaticana.plica",
+ false, false, false, false,
+ false, false, false, 0.6);
+
+
+% small punctum as used in epiphonus
+plica_char ("Ed. Vat. var plica", "vaticana.vplica",
+ false, 0.6);
+
+
+% eccentric punctum as used in epiphonus
+epiphonus_char ("Ed. Vat. epiphonus", "vaticana.epiphonus",
+ false, true, false, 1.0);
+
+
+% eccentric punctum as used in epiphonus (shifted variation)
+%
+% This note head is used instead of the regular epiphonus punctum to
+% avoid collision with the plica head when the plica sits directly on
+% top of the lower head.
+%
+epiphonus_char ("Ed. Vat. var epiphonus", "vaticana.vepiphonus",
+ false, true, true, 1.0);
+
+
+% small punctum as used in cephalicus
+vat_punctum_char ("Ed. Vat. rev. plica", "vaticana.reverse.plica",
+ false, false, false, false,
+ true, false, false, 0.6);
+
+
+% small punctum as used in cephalicus
+plica_char ("Ed. Vat. rev. var plica", "vaticana.reverse.vplica",
+ true, 0.6);
+
+
+% eccentric punctum as used in cephalicus; without left stem
+epiphonus_char ("Ed. Vat. inner cephalicus", "vaticana.inner.cephalicus",
+ false, false, false, 1.0);
+
+
+% eccentric punctum as used in cephalicus; with left stem
+epiphonus_char ("Ed. Vat. cephalicus", "vaticana.cephalicus",
+ true, false, false, 1.0);
+
+
+% quilisma
+fet_beginchar ("Ed. Vat. quilisma", "svaticana.quilisma");
+ save a_b, b_h, a_w;
+
+ a_b := 1.54; % b_h * a_b / a_w = wd / ht
+ b_h := 0.85;
+ a_w := 1.09;
+
+ save a, beta, ht, wd;
+
+ ht# = noteheight#;
+ 2 beta = ht# * b_h;
+ a = beta * a_b;
+ wd# = 2 a / a_w;
+
+ set_char_box (0, 0.42 wd#, 0.28 ht#, 0.36 ht#);
+
+ black_notehead_width# := wd#;
+
+ define_pixels (ht, wd);
+
+ save ellipse, T;
+ path ellipse;
+ transform T;
+
+ T := identity xscaled linethickness
+ yscaled 0.44 ht;
+ pickup pencircle transformed T;
+ ellipse := reverse fullcircle transformed T;
+
+ z1 = (rt 0.00 wd, top -0.28 ht);
+ z2 = (0.11 wd, -0.14 ht);
+ z3 = (0.12 wd, +0.03 ht);
+ z4 = (0.25 wd, -0.09 ht);
+ z5 = (0.25 wd, +0.08 ht);
+ z6 = (lft 0.42 wd, -0.04 ht);
+ z7 = (lft 0.40 wd, bot +0.36 ht);
+
+ fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+ -- get_subpath (ellipse, z2 - z1, z1 - z2, z2)
+ -- cycle;
+ fill get_subpath (ellipse, z3 - z4, z4 - z3, z3)
+ -- get_subpath (ellipse, z4 - z3, z3 - z4, z4)
+ -- cycle;
+ fill get_subpath (ellipse, z5 - z6, z6 - z5, z5)
+ -- point 0 of get_subpath (ellipse, z6 - z5, z5 - z6, z6)
+ -- get_subpath (ellipse, z7 - z6, z6 - z7, z7)
+ -- get_subpath (ellipse, z6 - z7, z5 - z6, z6)
+ -- cycle;
+
+ labels (1, 2, 3, 4, 5, 6, 7);
+fet_endchar;
+
+
+% solesmes punctum inclinatum parvum
+inclinatum_char ("Solesmes punctum inclinatum parvum", "solesmes.incl.parvum",
+ true, false, false);
+
+
+% solesmes punctum auctum ascendens
+vat_punctum_char ("Solesmes punctum auctum ascendens", "solesmes.auct.asc",
+ false, false, false, true,
+ true, false, false, 1.0);
+
+
+% solesmes punctum auctum descendens
+vat_punctum_char ("Solesmes punctum auctum descendens", "solesmes.auct.desc",
+ false, false, false, true,
+ false, false, false, 1.0);
+
+
+% solesmes punctum inclinatum auctum
+inclinatum_char ("Solesmes punctum incl. auctum", "solesmes.incl.auctum",
+ false, false, true);
+
+
+% solesmes stropha
+inclinatum_char ("Solesmes stropha", "solesmes.stropha",
+ false, true, false);
+
+
+% solesmes stropha aucta
+inclinatum_char ("Solesmes stropha aucta", "solesmes.stropha.aucta",
+ false, true, true);
+
+
+% solesmes oriscus
+fet_beginchar ("Solesmes oriscus", "ssolesmes.oriscus");
+ save a_b, b_h, a_w;
+
+ a_b := 1.54; % b_h * a_b / a_w = wd / ht
+ b_h := 0.85;
+ a_w := 1.09;
+
+ save a, beta, ht, wd;
+
+ ht# = noteheight#;
+ 2 beta = ht# * b_h;
+ a = beta * a_b;
+ wd# = 2 a / a_w;
+ black_notehead_width# := wd#;
+
+ save convexity;
+
+ convexity# = +0.05 ht#;
+
+ define_pixels (ht, wd, convexity);
+
+ set_char_box (0.00 wd#, 0.50 wd#,
+ 0.25 ht# + convexity#, 0.25 ht# + convexity#);
+
+ z1 = (0.00 wd + blot_diameter / 2, -convexity);
+ z2 = (1/6 wd, +convexity);
+ z3 = (2/6 wd, -convexity);
+ z4 = (0.50 wd - blot_diameter / 2, +convexity);
+
+
+ save height;
+
+ height = 2 ypart (directionpoint right of (z1
+ .. z2
+ .. z3
+ .. z4));
+
+ save ellipse, T;
+ path ellipse;
+ transform T;
+
+ T := identity xscaled blot_diameter
+ yscaled (h + d - height);
+ pickup pencircle transformed T;
+ ellipse := fullcircle transformed T;
+
+ % Adjust vertical coordinates to touch bounding box.
+ y1 := top -d;
+ y4 := bot h;
+
+ save d_;
+ pair d_;
+
+ d_ := direction 0 of (z1
+ .. z2
+ .. z3
+ .. z4);
+
+ fill get_subpath (ellipse, -d_, d_, z1)
+ .. bot z2
+ .. bot z3
+ .. get_subpath (ellipse, d_, -d_, z4)
+ .. top z3
+ .. top z2
+ .. cycle;
+
+ labels (1, 2, 3, 4);
+fet_endchar;
+
+
+%%%%%%%%
+%
+%
+%
+% EDITIO MEDICAEA
+%
+%
+%
+
+% inclinatum
+fet_beginchar ("Ed. Med. inclinatum", "smedicaea.inclinatum");
+ draw_diamond_head (1.2 staff_space#, 0, 0, 35, false);
+fet_endchar;
+
+
+def med_punctum_char (expr verbose_name, internal_name,
+ left_up_stem, left_down_stem) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save a, ht, wd;
+
+ ht# = 2 staff_space#;
+ wd# = ht#;
+ black_notehead_width# := wd#;
+
+ define_pixels (ht, wd);
+
+ save ellipse;
+ path ellipse;
+
+ ellipse := fullcircle xscaled blot_diameter
+ yscaled 0.50 ht;
+
+ z1 = (0.00 wd + blot_diameter / 2, 0);
+ z2 = (0.4 wd - blot_diameter / 2, 0);
+
+ labels (1, 2);
+
+ pickup pencircle scaled linethickness;
+
+ if left_down_stem:
+ z4 = (0.00 wd + linethickness / 2, -1.25 ht);
+
+ fill get_subpath (ellipse, left, down, z1)
+ -- top lft z4{down}
+ .. z4{right}
+ .. top rt z4{up}
+ -- (rt x4, -.5 ht / 2)
+ -- get_subpath (ellipse, right, left, z2)
+ -- cycle;
+
+ labels (4);
+
+ set_char_box (0.0, 0.4 wd#, 1.25 ht#, 0.25 ht#);
+ elseif left_up_stem:
+ z4 = (0.00 wd + linethickness / 2, +1.25 ht);
+
+ fill get_subpath (ellipse, down, right, z1)
+ -- get_subpath (ellipse, right, left, z2)
+ -- (rt x4, .5 ht / 2)
+ -- bot rt z4{up}
+ .. z4{left}
+ .. bot lft z4{down}
+ -- cycle;
+
+ labels (4);
+
+ set_char_box (0.0, 0.4 wd#, 0.25 ht#, 1.25 ht#);
+ else:
+ fill get_subpath (ellipse, left, right, z1)
+ -- get_subpath (ellipse, right, left, z2)
+ -- cycle;
+
+ set_char_box (0.0, 0.4 wd#, 0.25 ht#, 0.25 ht#);
+ fi;
+
+ fet_endchar;
+enddef;
+
+
+% punctum
+med_punctum_char ("Ed. Med. punctum", "medicaea.punctum",
+ false, false);
+
+
+% left up-stemmed punctum
+med_punctum_char ("Ed. Med. reverse virga", "medicaea.rvirga",
+ true, false);
+
+
+% virga (i.e. left down-stemmed punctum)
+med_punctum_char ("Ed. Med. virga", "medicaea.virga",
+ false, true);
+
+
+%%%%%%%%
+%
+%
+%
+% HUFNAGEL
+%
+%
+%
+
+def huf_punctum_char (expr verbose_name, internal_name,
+ down_stem) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save alpha;
+
+ alpha = 55;
+
+ draw_diamond_head (staff_space#, 0, 0, alpha, false);
+
+ if down_stem:
+ set_char_box (0, head_width#,
+ 1.5 staff_space#, head_height# / 2);
+
+ save ellipse;
+ path ellipse;
+
+ ellipse := reverse fullcircle xscaled blot_diameter
+ yscaled 0.7 staff_space
+ rotated -alpha;
+
+ z11 = (head_width / 2, 0);
+ z12 = find_tangent_shift (((0, -d) -- (w, -d)), ellipse,
+ (w / 2, -d), (w / 2, 0));
+
+ fill get_subpath (ellipse, up, down, z11)
+ -- get_subpath (ellipse, down, up, z12)
+ -- cycle;
+
+ labels (11, 12);
+ fi;
+ fet_endchar;
+enddef;
+
+
+% punctum
+huf_punctum_char ("Hufnagel punctum", "hufnagel.punctum", false)
+
+
+% virga
+huf_punctum_char ("Hufnagel virga", "hufnagel.virga", true)
+
+
+% pes lower punctum
+fet_beginchar ("Hufnagel pes lower punctum", "shufnagel.lpes")
+ save width, height, alpha;
+
+ width# = 2 * staff_space#;
+ height# = 0.7 * staff_space#;
+ alpha = 35;
+
+ set_char_box (0, width#, height# / 2, height# / 2);
+
+ define_pixels (width, height);
+
+ save circle;
+ path circle;
+
+ circle := reverse fullcircle scaled linethickness;
+
+ pickup pencircle scaled linethickness;
+
+ rt x3 = -lft x1 = width / 2;
+ y2 = y3 = height / 2;
+ y1 = y4 = -height / 2;
+
+ tand (alpha) * (y2 - y1) = x2 - x1 = x3 - x4;
+
+ fill get_subpath (circle, left, z2 - z1, z1)
+ -- get_subpath (circle, z2 - z1, right, z2)
+ -- get_subpath (circle, right, z4 - z3, z3)
+ -- get_subpath (circle, z4 - z3, left, z4)
+ -- cycle;
+
+ currentpicture := currentpicture shifted (width/2, 0);
+
+% labels (1, 2, 3, 4);
+fet_endchar;
+
+
+fet_endgroup ("noteheads");
+++ /dev/null
-% Feta (not the Font-En-Tja) music font -- ancient time signatures
-% This file is part of LilyPond, the GNU music typesetter.
-%
-% Copyright (C) 1998--2009 Mats Bengtsson <matsb@s3.kth.se>,
-% Christian Mondrup <scancm@biobase.dk>
-% Copyright (C) 2002--2009 Juergen Reuter <reuter@ipd.uka.de>
-%
-%
-% LilyPond is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
-%
-% LilyPond is distributed in the hope that it will be useful,
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-% GNU General Public License for more details.
-%
-% You should have received a copy of the GNU General Public License
-% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-
-fet_begingroup ("timesig");
-
-
-path threequartercircle;
-
-threequartercircle := halfcircle & quartercircle rotated 180;
-
-save mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin;
-
-mensural_Cdiameter# := 3/2 staff_space#;
-mensural_Cthickness# := 2 linethickness#;
-mensural_Chairpin# := 0.5 linethickness#;
-
-define_pixels (mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin);
-
-
-%%%%%%%%
-%
-%
-%
-% MENSURAL NOTATION
-%
-%
-%
-
-def draw_nail (expr bottom_left, top_right) =
- save round;
-
- round = floor min (blot_diameter,
- xpart (top_right-bottom_left),
- ypart (top_right-bottom_left));
-
- pickup pencircle scaled round;
-
- z2 + (round / 2, round / 2) = top_right +
- (mensural_Cthickness / 2, 0);
- z4 - (round / 2,round / 2) = bottom_left;
- y3 = y2;
- y4 = y1;
- x2 = x1 + mensural_Cthickness / 2;
- x2 - x1 = x4 - x3;
- x5 = x1;
- x6 = x4;
- y5 = y6 = y2 - 2 mensural_Cthickness;
-
- fill bot z1{right}
- .. rt z1{up}
- -- rt z5{up}
- .. rt z2
- .. top z2{left}
- -- top z3{left}
- .. lft z3
- .. lft z6{down}
- -- lft z4{down}
- .. bot z4{right}
- -- cycle;
-
-% labels (1, 2, 3, 4, 5, 6);
-enddef;
-
-
-def mensural_timesig (expr verbose_name, internal_name,
- full_circle, reverse_circle, slashed, dotted) =
- fet_beginchar (verbose_name, internal_name);
- if slashed:
- set_char_box (
- 0,
- mensural_Cdiameter# + mensural_Cthickness#,
- .75 (mensural_Cdiameter# + mensural_Cthickness#),
- .75 (mensural_Cdiameter# + mensural_Cthickness#));
-
- if (full_circle or dotted):
- draw_nail ((-mensural_Cthickness / 2, -d),
- (mensural_Cthickness / 2, h));
- elseif reverse_circle:
- draw_nail ((0, -d), (mensural_Cthickness, h));
- else:
- draw_nail ((-mensural_Cthickness, -d), (0, h));
- fi;
- else:
- set_char_box (
- 0,
- mensural_Cdiameter# + mensural_Cthickness#,
- .5 (mensural_Cdiameter# + mensural_Cthickness#),
- .5 (mensural_Cdiameter# + mensural_Cthickness#));
- fi;
-
- save ellipse, pat;
- path ellipse, pat;
-
- ellipse := fullcircle xscaled mensural_Cthickness
- yscaled mensural_Chairpin;
-
- save rot;
-
- if reverse_circle:
- rot := 225;
- else:
- rot := 45;
- fi;
-
- if full_circle:
- pat := fullcircle scaled mensural_Cdiameter;
-
- fill get_subpoint (ellipse,
- direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until length pat:
- .. get_subpoint (ellipse,
- direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- unfill get_subpoint (ellipse,
- -direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until length pat:
- .. get_subpoint (ellipse,
- -direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- else:
- pat := threequartercircle rotated rot
- scaled mensural_Cdiameter;
-
- fill get_subpath (ellipse,
- -direction 0 of pat,
- direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until (length pat - 1):
- .. get_subpoint (ellipse,
- direction i of pat,
- point i of pat)
- endfor
- .. get_subpath (ellipse,
- direction infinity of pat,
- -direction infinity of pat,
- point infinity of pat)
- for i = (length pat - 1) step -1 until 1:
- .. get_subpoint (ellipse,
- -direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- fi;
-
- if dotted:
- pickup pencircle scaled 4 linethickness;
- drawdot (0, 0);
- fi;
-
- currentpicture := currentpicture
- shifted 0.5 (mensural_Cdiameter
- + mensural_Cthickness, 0);
- fet_endchar;
-enddef;
-
-
-%% tempus imperfectum cum prolatione imperfecta
-mensural_timesig ("Mensural 4/4 meter", "mensural44",
- false, false, false, false);
-
-
-%% tempus imperfectum cum prolatione imperfecta proportio dupla
-mensural_timesig ("Mensural 2/2 meter", "mensural22",
- false, false, true, false);
-
-
-%% tempus perfectum cum prolatione imperfecta
-mensural_timesig ("Mensural 3/2 meter", "mensural32",
- true, false, false, false);
-
-
-%% tempus imperfectum cum prolatione perfecta
-mensural_timesig ("Mensural 6/4 meter", "mensural64",
- false, false, false, true);
-
-
-%% tempus perfectum cum prolatione perfecta
-mensural_timesig ("Mensural 9/4 meter", "mensural94",
- true, false, false, true);
-
-
-%% tempus perfectum cum prolatione imperfecta proportio dupla
-mensural_timesig ("Mensural 3/4 meter", "mensural34",
- true, false, true, false);
-
-
-%% tempus imperfectum cum prolatione perfecta proportio dupla
-mensural_timesig ("Mensural 6/8 meter", "mensural68",
- false, false, true, true);
-
-
-%% tempus perfectum cum prolatione perfecta proportio dupla
-mensural_timesig ("Mensural 9/8 meter", "mensural98",
- true, false, true, true);
-
-
-%% tempus imperfectum cum prolatione imperfecta diminutio simplex
-mensural_timesig ("Mensural 4/8 meter", "mensural48",
- false, true, false, false);
-
-
-%% tempus imperfectum cum prolatione perfecta diminutio simplex
-mensural_timesig ("Mensural 6/8 meter", "mensural68alt",
- false, true, false, true);
-
-
-%% tempus imperfectum cum prolatione imperfecta diminutio duplex
-mensural_timesig ("Mensural 2/4 meter", "mensural24",
- false, true, true, false);
-
-
-%%%%%%%%
-%
-%
-%
-% NEO-MENSURAL NOTATION
-%
-%
-%
-
-save neomensural_Cdiameter, neomensural_Cthickness;
-
-neomensural_Cdiameter# := 3/2 staff_space#;
-neomensural_Cthickness# := 2 linethickness#;
-
-define_pixels (neomensural_Cdiameter, neomensural_Cthickness);
-
-
-def neomensural_timesig (expr verbose_name, internal_name,
- full_circle, reverse_circle, slashed, dotted) =
- fet_beginchar (verbose_name, internal_name);
- set_char_box (
- 0,
- neomensural_Cdiameter# + neomensural_Cthickness#,
- .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
- .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
-
- if slashed:
- pickup penrazor scaled neomensural_Cthickness;
-
- save t;
- t := neomensural_Cthickness / 2;
-
- if (full_circle or dotted):
- draw (0, -d + t)
- -- (0, h - t);
- elseif reverse_circle:
- draw (t, -d + t)
- -- (t, h - t);
- else:
- draw (-t, -d + t)
- -- (-t, h - t);
- fi;
- fi;
-
- save ellipse, pat;
- path ellipse, pat;
-
- ellipse := fullcircle scaled neomensural_Cthickness;
-
- save rot;
-
- if reverse_circle:
- rot := 225;
- else:
- rot := 45;
- fi;
-
- if full_circle:
- pat := fullcircle scaled neomensural_Cdiameter;
-
- fill get_subpoint (ellipse,
- direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until length pat:
- .. get_subpoint (ellipse,
- direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- unfill get_subpoint (ellipse,
- -direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until length pat:
- .. get_subpoint (ellipse,
- -direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- else:
- pat := threequartercircle rotated rot
- scaled neomensural_Cdiameter;
-
- fill get_subpath (ellipse,
- -direction 0 of pat,
- direction 0 of pat,
- point 0 of pat)
- for i = 1 step 1 until (length pat - 1):
- .. get_subpoint (ellipse,
- direction i of pat,
- point i of pat)
- endfor
- .. get_subpath (ellipse,
- direction infinity of pat,
- -direction infinity of pat,
- point infinity of pat)
- for i = (length pat - 1) step -1 until 1:
- .. get_subpoint (ellipse,
- -direction i of pat,
- point i of pat)
- endfor
- .. cycle;
- fi;
-
- if dotted:
- pickup pencircle scaled 4 linethickness;
- drawdot (0, 0);
- fi;
-
- currentpicture := currentpicture
- shifted 0.5 (neomensural_Cdiameter
- + neomensural_Cthickness, 0);
- fet_endchar;
-enddef;
-
-
-%% tempus imperfectum cum prolatione imperfecta
-neomensural_timesig ("Mensural 4/4 meter", "neomensural44",
- false, false, false, false);
-
-
-%% tempus imperfectum cum prolatione imperfecta proportio dupla
-neomensural_timesig ("Mensural 2/2 meter", "neomensural22",
- false, false, true, false);
-
-
-%% tempus perfectum cum prolatione imperfecta
-neomensural_timesig ("Mensural 3/2 meter", "neomensural32",
- true, false, false, false);
-
-
-%% tempus imperfectum cum prolatione perfecta
-neomensural_timesig ("Mensural 6/4 meter", "neomensural64",
- false, false, false, true);
-
-
-%% tempus perfectum cum prolatione perfecta
-neomensural_timesig ("Mensural 9/4 meter", "neomensural94",
- true, false, false, true);
-
-
-%% tempus perfectum cum prolatione imperfecta proportio dupla
-neomensural_timesig ("Mensural 3/4 meter", "neomensural34",
- true, false, true, false);
-
-
-%% tempus imperfectum cum prolatione perfecta proportio dupla
-neomensural_timesig ("Mensural 6/8 meter", "neomensural68",
- false, false, true, true);
-
-
-%% tempus perfectum cum prolatione perfecta proportio dupla
-neomensural_timesig ("Mensural 9/8 meter", "neomensural98",
- true, false, true, true);
-
-
-%% tempus imperfectum cum prolatione imperfecta diminutio simplex
-neomensural_timesig ("Mensural 4/8 meter", "neomensural48",
- false, true, false, false);
-
-
-%% tempus imperfectum cum prolatione perfecta diminutio simplex
-neomensural_timesig ("Mensural 6/8 meter", "neomensural68alt",
- false, true, false, true);
-
-
-%% tempus imperfectum cum prolatione imperfecta diminutio duplex
-neomensural_timesig ("Mensural 2/4 meter", "neomensural24",
- false, true, true, false);
-
-
-fet_endgroup ("timesig");
--- /dev/null
+% Feta (not the Font-En-Tja) music font -- ancient time signatures
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1998--2009 Mats Bengtsson <matsb@s3.kth.se>,
+% Christian Mondrup <scancm@biobase.dk>
+% Copyright (C) 2002--2009 Juergen Reuter <reuter@ipd.uka.de>
+%
+%
+% LilyPond is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("timesig");
+
+
+path threequartercircle;
+
+threequartercircle := halfcircle & quartercircle rotated 180;
+
+save mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin;
+
+mensural_Cdiameter# := 3/2 staff_space#;
+mensural_Cthickness# := 2 linethickness#;
+mensural_Chairpin# := 0.5 linethickness#;
+
+define_pixels (mensural_Cdiameter, mensural_Cthickness, mensural_Chairpin);
+
+
+%%%%%%%%
+%
+%
+%
+% MENSURAL NOTATION
+%
+%
+%
+
+def draw_nail (expr bottom_left, top_right) =
+ save round;
+
+ round = floor min (blot_diameter,
+ xpart (top_right-bottom_left),
+ ypart (top_right-bottom_left));
+
+ pickup pencircle scaled round;
+
+ z2 + (round / 2, round / 2) = top_right +
+ (mensural_Cthickness / 2, 0);
+ z4 - (round / 2,round / 2) = bottom_left;
+ y3 = y2;
+ y4 = y1;
+ x2 = x1 + mensural_Cthickness / 2;
+ x2 - x1 = x4 - x3;
+ x5 = x1;
+ x6 = x4;
+ y5 = y6 = y2 - 2 mensural_Cthickness;
+
+ fill bot z1{right}
+ .. rt z1{up}
+ -- rt z5{up}
+ .. rt z2
+ .. top z2{left}
+ -- top z3{left}
+ .. lft z3
+ .. lft z6{down}
+ -- lft z4{down}
+ .. bot z4{right}
+ -- cycle;
+
+% labels (1, 2, 3, 4, 5, 6);
+enddef;
+
+
+def mensural_timesig (expr verbose_name, internal_name,
+ full_circle, reverse_circle, slashed, dotted) =
+ fet_beginchar (verbose_name, internal_name);
+ if slashed:
+ set_char_box (
+ 0,
+ mensural_Cdiameter# + mensural_Cthickness#,
+ .75 (mensural_Cdiameter# + mensural_Cthickness#),
+ .75 (mensural_Cdiameter# + mensural_Cthickness#));
+
+ if (full_circle or dotted):
+ draw_nail ((-mensural_Cthickness / 2, -d),
+ (mensural_Cthickness / 2, h));
+ elseif reverse_circle:
+ draw_nail ((0, -d), (mensural_Cthickness, h));
+ else:
+ draw_nail ((-mensural_Cthickness, -d), (0, h));
+ fi;
+ else:
+ set_char_box (
+ 0,
+ mensural_Cdiameter# + mensural_Cthickness#,
+ .5 (mensural_Cdiameter# + mensural_Cthickness#),
+ .5 (mensural_Cdiameter# + mensural_Cthickness#));
+ fi;
+
+ save ellipse, pat;
+ path ellipse, pat;
+
+ ellipse := fullcircle xscaled mensural_Cthickness
+ yscaled mensural_Chairpin;
+
+ save rot;
+
+ if reverse_circle:
+ rot := 225;
+ else:
+ rot := 45;
+ fi;
+
+ if full_circle:
+ pat := fullcircle scaled mensural_Cdiameter;
+
+ fill get_subpoint (ellipse,
+ direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until length pat:
+ .. get_subpoint (ellipse,
+ direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ unfill get_subpoint (ellipse,
+ -direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until length pat:
+ .. get_subpoint (ellipse,
+ -direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ else:
+ pat := threequartercircle rotated rot
+ scaled mensural_Cdiameter;
+
+ fill get_subpath (ellipse,
+ -direction 0 of pat,
+ direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until (length pat - 1):
+ .. get_subpoint (ellipse,
+ direction i of pat,
+ point i of pat)
+ endfor
+ .. get_subpath (ellipse,
+ direction infinity of pat,
+ -direction infinity of pat,
+ point infinity of pat)
+ for i = (length pat - 1) step -1 until 1:
+ .. get_subpoint (ellipse,
+ -direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ fi;
+
+ if dotted:
+ pickup pencircle scaled 4 linethickness;
+ drawdot (0, 0);
+ fi;
+
+ currentpicture := currentpicture
+ shifted 0.5 (mensural_Cdiameter
+ + mensural_Cthickness, 0);
+ fet_endchar;
+enddef;
+
+
+%% tempus imperfectum cum prolatione imperfecta
+mensural_timesig ("Mensural 4/4 meter", "mensural44",
+ false, false, false, false);
+
+
+%% tempus imperfectum cum prolatione imperfecta proportio dupla
+mensural_timesig ("Mensural 2/2 meter", "mensural22",
+ false, false, true, false);
+
+
+%% tempus perfectum cum prolatione imperfecta
+mensural_timesig ("Mensural 3/2 meter", "mensural32",
+ true, false, false, false);
+
+
+%% tempus imperfectum cum prolatione perfecta
+mensural_timesig ("Mensural 6/4 meter", "mensural64",
+ false, false, false, true);
+
+
+%% tempus perfectum cum prolatione perfecta
+mensural_timesig ("Mensural 9/4 meter", "mensural94",
+ true, false, false, true);
+
+
+%% tempus perfectum cum prolatione imperfecta proportio dupla
+mensural_timesig ("Mensural 3/4 meter", "mensural34",
+ true, false, true, false);
+
+
+%% tempus imperfectum cum prolatione perfecta proportio dupla
+mensural_timesig ("Mensural 6/8 meter", "mensural68",
+ false, false, true, true);
+
+
+%% tempus perfectum cum prolatione perfecta proportio dupla
+mensural_timesig ("Mensural 9/8 meter", "mensural98",
+ true, false, true, true);
+
+
+%% tempus imperfectum cum prolatione imperfecta diminutio simplex
+mensural_timesig ("Mensural 4/8 meter", "mensural48",
+ false, true, false, false);
+
+
+%% tempus imperfectum cum prolatione perfecta diminutio simplex
+mensural_timesig ("Mensural 6/8 meter", "mensural68alt",
+ false, true, false, true);
+
+
+%% tempus imperfectum cum prolatione imperfecta diminutio duplex
+mensural_timesig ("Mensural 2/4 meter", "mensural24",
+ false, true, true, false);
+
+
+%%%%%%%%
+%
+%
+%
+% NEO-MENSURAL NOTATION
+%
+%
+%
+
+save neomensural_Cdiameter, neomensural_Cthickness;
+
+neomensural_Cdiameter# := 3/2 staff_space#;
+neomensural_Cthickness# := 2 linethickness#;
+
+define_pixels (neomensural_Cdiameter, neomensural_Cthickness);
+
+
+def neomensural_timesig (expr verbose_name, internal_name,
+ full_circle, reverse_circle, slashed, dotted) =
+ fet_beginchar (verbose_name, internal_name);
+ set_char_box (
+ 0,
+ neomensural_Cdiameter# + neomensural_Cthickness#,
+ .5 (neomensural_Cdiameter# + neomensural_Cthickness#),
+ .5 (neomensural_Cdiameter# + neomensural_Cthickness#));
+
+ if slashed:
+ pickup penrazor scaled neomensural_Cthickness;
+
+ save t;
+ t := neomensural_Cthickness / 2;
+
+ if (full_circle or dotted):
+ draw (0, -d + t)
+ -- (0, h - t);
+ elseif reverse_circle:
+ draw (t, -d + t)
+ -- (t, h - t);
+ else:
+ draw (-t, -d + t)
+ -- (-t, h - t);
+ fi;
+ fi;
+
+ save ellipse, pat;
+ path ellipse, pat;
+
+ ellipse := fullcircle scaled neomensural_Cthickness;
+
+ save rot;
+
+ if reverse_circle:
+ rot := 225;
+ else:
+ rot := 45;
+ fi;
+
+ if full_circle:
+ pat := fullcircle scaled neomensural_Cdiameter;
+
+ fill get_subpoint (ellipse,
+ direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until length pat:
+ .. get_subpoint (ellipse,
+ direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ unfill get_subpoint (ellipse,
+ -direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until length pat:
+ .. get_subpoint (ellipse,
+ -direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ else:
+ pat := threequartercircle rotated rot
+ scaled neomensural_Cdiameter;
+
+ fill get_subpath (ellipse,
+ -direction 0 of pat,
+ direction 0 of pat,
+ point 0 of pat)
+ for i = 1 step 1 until (length pat - 1):
+ .. get_subpoint (ellipse,
+ direction i of pat,
+ point i of pat)
+ endfor
+ .. get_subpath (ellipse,
+ direction infinity of pat,
+ -direction infinity of pat,
+ point infinity of pat)
+ for i = (length pat - 1) step -1 until 1:
+ .. get_subpoint (ellipse,
+ -direction i of pat,
+ point i of pat)
+ endfor
+ .. cycle;
+ fi;
+
+ if dotted:
+ pickup pencircle scaled 4 linethickness;
+ drawdot (0, 0);
+ fi;
+
+ currentpicture := currentpicture
+ shifted 0.5 (neomensural_Cdiameter
+ + neomensural_Cthickness, 0);
+ fet_endchar;
+enddef;
+
+
+%% tempus imperfectum cum prolatione imperfecta
+neomensural_timesig ("Mensural 4/4 meter", "neomensural44",
+ false, false, false, false);
+
+
+%% tempus imperfectum cum prolatione imperfecta proportio dupla
+neomensural_timesig ("Mensural 2/2 meter", "neomensural22",
+ false, false, true, false);
+
+
+%% tempus perfectum cum prolatione imperfecta
+neomensural_timesig ("Mensural 3/2 meter", "neomensural32",
+ true, false, false, false);
+
+
+%% tempus imperfectum cum prolatione perfecta
+neomensural_timesig ("Mensural 6/4 meter", "neomensural64",
+ false, false, false, true);
+
+
+%% tempus perfectum cum prolatione perfecta
+neomensural_timesig ("Mensural 9/4 meter", "neomensural94",
+ true, false, false, true);
+
+
+%% tempus perfectum cum prolatione imperfecta proportio dupla
+neomensural_timesig ("Mensural 3/4 meter", "neomensural34",
+ true, false, true, false);
+
+
+%% tempus imperfectum cum prolatione perfecta proportio dupla
+neomensural_timesig ("Mensural 6/8 meter", "neomensural68",
+ false, false, true, true);
+
+
+%% tempus perfectum cum prolatione perfecta proportio dupla
+neomensural_timesig ("Mensural 9/8 meter", "neomensural98",
+ true, false, true, true);
+
+
+%% tempus imperfectum cum prolatione imperfecta diminutio simplex
+neomensural_timesig ("Mensural 4/8 meter", "neomensural48",
+ false, true, false, false);
+
+
+%% tempus imperfectum cum prolatione perfecta diminutio simplex
+neomensural_timesig ("Mensural 6/8 meter", "neomensural68alt",
+ false, true, false, true);
+
+
+%% tempus imperfectum cum prolatione imperfecta diminutio duplex
+neomensural_timesig ("Mensural 2/4 meter", "neomensural24",
+ false, true, true, false);
+
+
+fet_endgroup ("timesig");
"version taken from the \\version command, to the current LilyPond version."
msgstr ""
"Actualiseer LilyPond invoer naar nieuwere versie. Standaard, actualiseer\n"
-"vanaf versie uit de \\versie uitdrukking, naar de huidige LilyPond versie."
+"vanaf versie uit het \\version commando, naar de huidige LilyPond versie."
#: convert-ly.py:34 lilypond-book.py:59
msgid "Examples:"
msgstr "toon garantie en auteursrechten"
#: lilypond-book.py:57
-msgid ""
-"Process LilyPond snippets in hybrid HTML, LaTeX, texinfo or DocBook document."
+msgid "Process LilyPond snippets in hybrid HTML, LaTeX, texinfo or DocBook document."
msgstr ""
"Verwerk LilyPond snippers in hybride HTML, LaTeX, texinfo of DocBook "
"document."
msgstr "pijp snippers door FILTER [convert-ly -n -]"
#: lilypond-book.py:120
-msgid ""
-"use output format FORMAT (texi [default], texi-html, latex, html, docbook)"
+msgid "use output format FORMAT (texi [default], texi-html, latex, html, docbook)"
msgstr ""
"gebruik uitvoerformat FORMAT (texi [standaard], texi-html, latex, html, "
"docbook)"
#: lilypond-book.py:1400
msgid "The error log is as follows:"
-msgstr "De foutlog is als volgend:"
+msgstr "De foutlog is als volgt:"
#: lilypond-book.py:1472
msgid "cannot find \\begin{document} in LaTeX document"
#: midi2ly.py:891
msgid "treat every text as a lyric"
-msgstr "behandel elke tekst als liedtekts"
+msgstr "behandel elke tekst als liedtekst"
#: midi2ly.py:894
msgid "Examples"
#: align-interface.cc:322
msgid "tried to get a translation for something that is no child of mine"
-msgstr ""
-"probeerde een verplaatsing te verkrijgen voor iets wat geen kind van mij is"
+msgstr "probeerde een verplaatsing te verkrijgen voor iets wat geen kind van mij is"
#: all-font-metrics.cc:143
#, c-format
msgid "no viable initial configuration found: may not find good beam slope"
msgstr ""
"geen werkbare initiële configuratie gevonden: kan wellicht geen goede "
-"waardestreephelling kunnen vinden"
+"waardestreephelling vinden"
#: break-alignment-interface.cc:195
#, c-format
#: dispatcher.cc:71
msgid "Event class should be a symbol"
-msgstr "Gebeurtenis klasse zou hoort een symbool te zijn"
+msgstr "Gebeurtenis klasse hoort een symbool te zijn"
#: dispatcher.cc:78
#, c-format
#: glissando-engraver.cc:94
msgid "unterminated glissando"
-msgstr "onbeëindigde glissando"
+msgstr "onbeëindigd glissando"
#: global-context-scheme.cc:87 global-context-scheme.cc:105
msgid "no music found in score"
#: main.cc:342
#, c-format
msgid "cannot change user id to: %d: %s"
-msgstr "kan kan gebruiker id niet veranderen in: %d: %s"
+msgstr "kan gebruiker id niet veranderen in: %d: %s"
#: main.cc:348
#, c-format
#: mensural-ligature-engraver.cc:150
msgid "mensural ligature: duration none of Mx, L, B, S -> skipping"
-msgstr "mensural ligature: lengte geen van Mx, L, S -> overslaan"
+msgstr "mensurale ligatuur: lengte geen van Mx, L, S -> overslaan"
#: mensural-ligature-engraver.cc:198
msgid "semibrevis must be followed by another one -> skipping"
#: new-fingering-engraver.cc:96
msgid "cannot add text scripts to individual note heads"
-msgstr "can tekstscripts niet toevoegen aan individuele notenbolletjes"
+msgstr "kan tekstscripts niet toevoegen aan individuele notenbolletjes"
#: new-fingering-engraver.cc:239
msgid "no placement found for fingerings"
-msgstr "geen plaatsing gevonden voor vingers"
+msgstr "geen plaatsing gevonden voor vingerzetting"
#: new-fingering-engraver.cc:240
msgid "placing below"
#: open-type-font.cc:33
#, c-format
msgid "cannot allocate %lu bytes"
-msgstr "kan geen %lu bytes alloceren"
+msgstr "kan geen %lu bytes toewijzen"
#: open-type-font.cc:37
#, c-format
#: rest-collision.cc:145
msgid "cannot resolve rest collision: rest direction not set"
-msgstr "kan rust bosting niet oplossen: richting van de rust is niet gezet"
+msgstr "kan rust botsing niet oplossen: richting van de rust is niet gezet"
#: rest-collision.cc:159 rest-collision.cc:204
msgid "too many colliding rests"
#: vaticana-ligature-engraver.cc:714
#, c-format
msgid "Vaticana_ligature_engraver: setting `spacing-increment = %f': ptr =%ul"
-msgstr ""
-"Vaticana_ligature_engraver: instelling `spacing-increment = %f': ptr=%ul"
+msgstr "Vaticana_ligature_engraver: instelling `spacing-increment = %f': ptr=%ul"
#: vaticana-ligature.cc:84
msgid "flexa-height undefined; assuming 0"
#: music-functions.scm:228
msgid "More alternatives than repeats. Junking excess alternatives"
-msgstr ""
-"Meer alternatieven dan herhalingen. Verschroten van overtollige "
-"alternatieven"
+msgstr "Meer alternatieven dan herhalingen. Verschroten van overtollige alternatieven"
#: music-functions.scm:250
#, scheme-format
#: output-ps.scm:276
msgid "utf-8-string encountered in PS backend"
-msgstr "utf-8-string tegengekomen in in PS achtereinde"
+msgstr "utf-8-string tegengekomen in in PS backend"
#: output-svg.scm:42
#, scheme-format
((?!Compiling-from-source.html")[^/][.]*[^.:'"]*)\
([.]html)(#[^"']*|)['"]''')
offline_links_re = re.compile ('href=[\'"]\
-((?!Compiling-from-source.html")[^/][.]*[^.:\'"]*)([.]html)(#[^"\']*|)[\'"]')
+((?!Compiling-from-source.html")(?![.]{2}/contributor)[^/][.]*[^.:\'"]*)([.]html)(#[^"\']*|)[\'"]')
big_page_name_re = re.compile ('''(.+?)-big-page''')
def process_i18n_big_page_links (match, prefix, lang_ext):
(forceClef ,boolean? "Show clef symbol, even if it has not
changed. Only active for the first clef after the property is set, not
for the full staff.")
+ (fretLabels ,list? "A list of strings or Scheme-formatted markups
+containing, in the correct order, the labels to be used for lettered
+frets in tablature.")
(gridInterval ,ly:moment? "Interval for which to generate
;;
(when ,ly:moment? "Global time step associated with this column
happen?")
+ (whiteout ,boolean? "If true, the grob is printed over a white
+background to white-out underlying material. Usually #f by default.")
(width ,ly:dimension? "The width of a grob measured in staff
space.")
(word-space ,ly:dimension? "Space to insert between words in
(font-size . -2)
(stem-attachment . (0.0 . 1.35))
(stencil . ,ly:text-interface::print)
+ (whiteout . #t)
(X-offset . ,ly:self-alignment-interface::x-aligned-on-self)
(Y-offset . ,ly:staff-symbol-referencer::callback)
(meta . ((class . Item)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tablature
-;; The TabNoteHead tablatureFormat callback.
-;; Compute the text grob-property
-(define-public (fret-number-tablature-format string context event)
+;; The TabNoteHead tablatureFormat callbacks.
+
+;; Calculate the fret from pitch and string number as letter
+;; The fret letter is taken from 'fretLabels if present
+(define-public (fret-letter-tablature-format string-number context event)
+ (let* ((tuning (ly:context-property context 'stringTunings))
+ (pitch (ly:event-property event 'pitch))
+ (labels (ly:context-property context 'fretLabels))
+ (fret (- (ly:pitch-semitones pitch)
+ (list-ref tuning (- string-number 1)))))
+ (make-vcenter-markup
+ (cond
+ ((= 0 (length labels))
+ (string (integer->char (+ fret (char->integer #\a)))))
+ ((and (<= 0 fret) (< fret (length labels)))
+ (list-ref labels fret))
+ (else
+ (ly:warning "No label for fret ~a (~a on string ~a);
+only ~a fret labels provided"
+ fret pitch string-number (length labels))
+ ".")))))
+
+;; Calculate the fret from pitch and string number as number
+(define-public (fret-number-tablature-format string-number context event)
(let* ((tuning (ly:context-property context 'stringTunings))
(pitch (ly:event-property event 'pitch)))
-
- (make-whiteout-markup
- (make-vcenter-markup
- (format
- "~a"
- (- (ly:pitch-semitones pitch)
- (list-ref tuning
- ;; remove 1 because list index starts at 0
- ;;and guitar string at 1.
- (1- string))))))))
+ (make-vcenter-markup
+ (format
+ "~a"
+ (- (ly:pitch-semitones pitch)
+ (list-ref tuning
+ ;; remove 1 because list index starts at 0
+ ;;and guitar string at 1.
+ (1- string-number)))))))
;; The 5-string banjo has got a extra string, the fifth (duh), which
;; starts at the fifth fret on the neck. Frets on the fifth string
;; the "first fret" on the fifth string is really the sixth fret
;; on the banjo neck.
;; We solve this by defining a new fret-number-tablature function:
-(define-public (fret-number-tablature-format-banjo string context event)
+(define-public (fret-number-tablature-format-banjo string-number context event)
(let* ((tuning (ly:context-property context 'stringTunings))
(pitch (ly:event-property event 'pitch)))
-
- (make-whiteout-markup
- (make-vcenter-markup
- (let ((fret (- (ly:pitch-semitones pitch) (list-ref tuning (1- string)))))
- (number->string (cond
- ((and (> fret 0) (= string 5))
- (+ fret 5))
- (else fret))))))))
+ (make-vcenter-markup
+ (let ((fret (- (ly:pitch-semitones pitch)
+ (list-ref tuning (1- string-number)))))
+ (number->string (cond
+ ((and (> fret 0) (= string-number 5))
+ (+ fret 5))
+ (else fret)))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
import os
import glob
-## these links are relative from /~graham/web/
-#WEB_DOCLINK_STABLE = "../../doc/v2.12/Documentation/user/lilypond-"
-#WEB_DOCLINK_DEVEL = "../../doc/v2.13/Documentation/"
-
+### just like depth in our GNUmakefiles
+# these links are relative from /~graham/web/
+depth = "../../"
# these links are relative from the v2.13 docs
-WEB_DOCLINK_STABLE = "../../../v2.12/Documentation/user/lilypond-"
-WEB_DOCLINK_DEVEL = "../../../v2.13/Documentation/"
+#depth = "../../../../"
+
+# FIXME: remove the user/lilypond- when 2.14 becomes stable
+WEB_DOCLINK_STABLE = depth + "doc/v2.12/Documentation/user/lilypond-"
+WEB_DOCLINK_DEVEL = depth + "doc/v2.13/Documentation/"
TEXI2HTML_INIT = --init-file=$(top-src-dir)/Documentation/lilypond-texi2html.init
-DOC_TEXI2HTML_SPLIT = --prefix=index --split=section
-WEB_TEXI2HTML_SPLIT = --prefix=index --split=node --node-files
-TEXI2HTML_SPLIT = $(DOC_TEXI2HTML_SPLIT)
+TEXI2HTML_SPLIT = --prefix=index --split=section
TEXI2HTML_INCLUDES += --I=$(src-dir) --I=$(outdir) $(DOCUMENTATION_INCLUDES) --I=$(XREF_MAPS_DIR)
TEXI2HTML_FLAGS += $(TEXI2HTML_INCLUDES) $(TEXI2HTML_INIT) $(TEXI2HTML_LANG)