From: fred Date: Fri, 24 Apr 1998 22:31:22 +0000 (+0000) Subject: lilypond-0.1.60 X-Git-Tag: release/1.5.59~5960 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=63f6a9fc093d9df8e76e04a93cc8fb78b61b238a;p=lilypond.git lilypond-0.1.60 --- diff --git a/Documentation/tex/fonts.doc b/Documentation/tex/fonts.doc new file mode 100644 index 0000000000..a9e1940fbe --- /dev/null +++ b/Documentation/tex/fonts.doc @@ -0,0 +1,210 @@ +\documentclass{article} +\def\kdots{,\ldots,} +\title{Not the Font-En-Tja font} +\author{HWN \& JCN} +\begin{document} +\maketitle + + +\section{Introduction} + +This document are some design notes of the Feta font. Feta (not an +abbreviation of Font-En-Tja) is a font of music symbols. All MetaFont +sources are original. The symbols are modelled after various editions +of music, notably +\begin{itemize} +\item B\"arenreiter +\item Hofmeister +\item Breitkopf +\item Durand \& C'ie +\end{itemize} + +The best references on Music engraving are Wanske\cite{wanske} and +Ross\cite{ross} quite some of their insights were used. Although it +is a matter of taste, I'd say that B\"arenreiter has the finest +typography of all. + + +\section{Bezier curves for slurs} + +Objective: slurs in music are curved objects designating that notes +should fluently bound. They are drawn as smooth curves, with their +center thicker and the endings tapered. + +There are some variants: the simplest slur shape only has the width as +parameter. Then we give some suggestions for tuning the shapes. The +simple slur algorithm is used for drawing ties as well. + + + +\subsection{Simple slurs} + +Long slurs are flat, whereas short slurs look like small circle arcs. +Details are given in Wanske\cite{ross} and Ross\cite{wanske}. The +shape of a slur can be given as a Bezier curve with four control +points: + +\begin{eqnarray*} + B(t) &=& (1-t)^3c_1 +3(1-t)^2tc_2 + 3(1-t)t^2c_3 + t^3c_4. +\end{eqnarray*} + +We will assume that the slur connects two notes of the same +pitch. Different slurs can be created by rotating the derived shape. +We will also assume that the slur has a vertical axis of symmetry +through its center. The left point will be the origin. So we have +the following equations for the control points $c_1\kdots c_4$. + +\begin{eqnarray*} +c_1&=& (0,0)\\ +c_2&=& (i, h)\\ +c_3&=& (b-i, h)\\ +c_4&=& (b, 0) +\end{eqnarray*} + +The quantity $b$ is given, it is the width of the slur. The +conditions on the shape of the slur for small and large $b$ transform +to +\begin{eqnarray*} + h \to h_{\infty} , &&\quad b \to \infty\\ + h \approx r_{0} b, &&\quad b \to 0. +\end{eqnarray*} +To tackle this, we will assume that $h = F(b)$, for some kind of +$F(\cdot)$. One function that satisfies the above conditions is +$$ +F(b) = h_{\infty} \frac{2}{\pi} \arctan \left( \frac{\pi r_0}{2 +h_{\infty}} b \right). +$$ + +For satisfying results we choose $h_{\infty} = 2\cdot \texttt{interline}$ +and $r_0 = \frac 13$. + +\subsection{Height correction} + +Aside from being a smooth curve, slurs should avoid crossing +enclosed notes and their stems. + +An easy way to achieve this is to extend the slur's height, +so that the slur will curve just above any disturbing notes. + +The parameter $i$ determines the flatness of the curve. Satisfying +results have been obtained with $i = h$. + +The formula can be generalised to allow for corrections in the shape, +\begin{eqnarray*} +c_1&=& (0,0)\\ +c_2&=& (i', h')\\ +c_3&=& (b-i', h')\\ +c_4&=& (b, 0) +\end{eqnarray*} +Where +$$ +i' = h(b) (1 + i_{corr}), \quad h' = h(b) (1 + h_{corr}). +$$ + +The default values for these corrections are $0$. A $h_{corr}$ that is +negative, makes the curve flatter in the center. A $h_{corr}$ that is +positive make the curve higher. + +At every encompassed note's x position the difference $\delta _y$ +between the slur's height and the note is calculated. The greatest +$\delta _y$ is used to calculate $h_{corr}$ is by lineair extrapolation. + +However, this simple method produces satisfactory results only for +small and symmetric disturbances. + + +\subsection{Tangent method correction} + +A somewhat more elaborate\footnote{While staying in the realm +of emperic computer science} way of having a slur avoid +disturbing notes is by first defining the slur's ideal shape +and then using the height correction. The ideal shape of a +slur can be guessed by calculating the tangents of the disturbing +notes: +% a picture wouldn't hurt... +\begin{eqnarray*} + y_{disturb,l} &=& \rm{rc}_l x\\ + y_{disturb,r} &=& \rm{rc}_r + c_{3,x}, +\end{eqnarray*} +where +\begin{eqnarray*} + \rm{rc}_l &=& \frac{y_{disturb,l} - y_{encompass,1}} + {x_{disturb,l} - x_{encompass,1}}\dot x\\ + \rm{rc}_r &=& \frac{y_{encompass,n} - y_{disturb,r}} + {x_{encompass,n} - x_{disturb,r}} \dot x + c_{3,x}. +\end{eqnarray*} + +We assume that having the control points $c_2$ and $c_3$ located +on tangent$_1$ and tangent$_2$ resp. +% t: tangent +\begin{eqnarray*} + y_{tangent,l} &=& \alpha \rm{rc}_l x\\ + y_{tangent,r} &=& \alpha \rm{rc}_r + c_{3,x}. +\end{eqnarray*} + +Beautiful slurs have rather strong curvature at the extreme +control points. That's why we'll have $\alpha > 1$. +Satisfactory resulsts have been obtained with +$$ + \alpha \approx 2.4. +$$ + +The positions of control points $c_2$ and $c_3$ are obtained +by solving with the height-line +\begin{eqnarray*} + y_h &=& \rm{rc}_h + c_h. +\end{eqnarray*} + +The top-line runs through the points disturb$_{left}$ and +disturb$_{right}$. In the case that +$$ +z_{disturb,l} = z_{disturb,r}, +$$ +we'll have +$$ + \angle(y_{tangent,l},y_h) = \angle(y_{tangent,r},y_h). +$$ + + + +\section{Sizes} + +Traditional engraving uses a set of 9 standardised sizes for Staffs +(running from 0 to 8). + +We have tried to measure these (helped by a magnifying glass), and +found the staffsizes in table~\ref{fonts:staff-size}. One should note that +these are estimates, so I think there could be a measuring error of ~ +.5 pt. Moreover [Ross] states that not all engravers use exactly +those sizes. + +\begin{table}[h] + \begin{center} + \begin{tabular}{lll} +Staffsize &Numbers &Name\\ +\hline\\ +26.2pt &No. 0\\ +22.6pt &No. 1 &Giant/English\\ +21.3pt &No. 2 &Giant/English\\ +19.9pt &No. 3 &Regular, Ordinary, Common\\ +19.1pt &No. 4 &Peter\\ +17.1pt &No. 5 &Large middle\\ +15.9pt &No. 6 &Small middle\\ +13.7pt &No. 7 &Cadenza\\ +11.1pt &No. 8 &Pearl\\ + + \end{tabular} + \caption{Foo} + \label{fonts:staff-size} + \end{center} +\end{table} + +Ross states that the dies (the stamps to make the symbols) come in +12 different sizes. + +\bibliographystyle{plain} +\bibliography{engraving} + + + +\end{document}