From a639c6d842fbd534d8a15fccd104b42f2870696b Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:58:42 +0000 Subject: [PATCH] lilypond-0.1.17 --- lily/tex-beam.cc | 31 +++++++++++++++++++------------ tex/taupindefs.tex | 26 ++++++++++++-------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/lily/tex-beam.cc b/lily/tex-beam.cc index 5bc8ebbfcc..193e6d4e6f 100644 --- a/lily/tex-beam.cc +++ b/lily/tex-beam.cc @@ -18,11 +18,14 @@ #include "dimen.hh" #include "debug.hh" #include "lookup.hh" +#include "misc.hh" Atom Lookup::beam_element (int sidx, int widx, Real slope) const { - Atom bs=(*symtables_)("beamslopes")->lookup ("slope"); + char dir_char = slope >0 ? 'u' : 'd'; + String name = dir_char + String("slope"); + Atom bs=(*symtables_)("beamslopes")->lookup (name); Array args; args.push (sidx); @@ -39,7 +42,7 @@ Lookup::beam_element (int sidx, int widx, Real slope) const static int slope_index (Real &s) { - if (abs (s) > 0.5) + if (abs (s) > 0.5) { WARN << "beam steeper than 0.5 (" << s << ")\n"; s = sign (s) * 0.5; @@ -49,9 +52,9 @@ slope_index (Real &s) s = i/20.0; if (s>0) - return 6*i +122; + return 6*i; else - return -6 * i+ 186; + return -6 * i; } Atom @@ -73,13 +76,18 @@ Lookup::beam (Real &slope, Real width) const int sidx = slope_index (slope); if (!slope) return rule_symbol (2 PT, width); - if (width < 2 PT) + + Interval xdims = (*symtables_)("beamslopes")->lookup ("uslope").dim_[X_AXIS]; + Real min_wid = xdims[LEFT]; + Real max_wid = xdims[RIGHT]; + + if (width < min_wid) { WARN<<"Beam too narrow. (" << print_dimen (width) <<")\n"; - width = 2 PT; + width = min_wid; } - Real elemwidth = 64 PT; - int widx = 5; + Real elemwidth = max_wid; + int widx = intlog2 (int (max_wid/min_wid)); Molecule m; @@ -92,16 +100,15 @@ Lookup::beam (Real &slope, Real width) const Real last_x = width - elemwidth; Real x = overlap; Atom elem (beam_element (sidx, widx, slope)); - Atom a (elem); - m.add (a); + m.add (elem); while (x < last_x) { - a=elem; + Atom a(elem); a.translate (Offset (x-overlap, (x-overlap)*slope)); m.add (a); x += elemwidth - overlap; } - a=elem; + Atom a(elem); a.translate (Offset (last_x, (last_x) * slope)); m.add (a); diff --git a/tex/taupindefs.tex b/tex/taupindefs.tex index 769d2a4880..290e711cb9 100644 --- a/tex/taupindefs.tex +++ b/tex/taupindefs.tex @@ -1,8 +1,8 @@ - +\input fetdefs \def\musixtwentyfonts{ \font\normaltextfont=cmr10 %\textfont is a primitive \font\smalltextfont=cmr8 - \font\meterfont=cmbx12 + \font\meterfont=cmbx15 \font\slurufont=xslu20 \font\slurdfont=xsld20 \font\slurhfont=xslz20 @@ -14,7 +14,7 @@ \font\italicfont=cmti10 \font\dynfont=dyn10 scaled \magstep2 \font\musicmathfont=cmsy10 - \font\fontentja=font-en-tja20 + \fettwentydefs } @@ -33,21 +33,11 @@ \font\dynfont=dyn10 scaled \magstep1 \font\musicdraw=musixsps \font\musicmathfont=cmsy8 - \font\fontentja=font-en-tja16 + \fetsixteendefs } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % provide interface to musixtex fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \def\fetdef#1#2{\def#1{\fetchar{#2}}} -% ugh, linewidth, ugh, tablexx.ly balldims not used! -\def\fetdef#1#2{\def#1{\lower.5\staffrulethickness\hbox{\fetchar{#2}}}} -\def\fetchar#1{\fontentja\char#1} -% \musicdef\quartball{'007} -% \musicdef\halfball{'010} -% \musicdef\wholeball{'011} -\fetdef\quartball{'002} -\fetdef\halfball{'001} -\fetdef\wholeball{'000} \musicdef\breveball{'040} \musicdef\longaball{'047} \musicdef\halfrest{'074} @@ -134,3 +124,11 @@ \musicdef\downbow{22} \def\tr{{\it tr}} + +\def\beamuslope#1#2{{\count0=#2\advance\count0 by#1 + \advance\count0 by 122 + \musicfnt\char\count0}} +\def\beamdslope#1#2{{\count0=#2\advance\count0 by#1 + \advance\count0 by 186 + \musicfnt\char\count0}} + -- 2.39.5