From: Jan Nieuwenhuizen Date: Fri, 27 Apr 2001 19:42:59 +0000 (+0200) Subject: patch::: 1.3.151.jcn1 X-Git-Tag: release/1.3.152~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0c1ce854cfb2b9ad594526e359ec206fdd9b21fe;p=lilypond.git patch::: 1.3.151.jcn1 1.3.151.jcn1 ============ * Fixed feta-braces: more symbols again, but all paper sizes use same font. Also fixed lookup. * Maximum length for lyric-hyphen. * Two forgotten note corrections to Standchen. * Website compilation fix. --- diff --git a/CHANGES b/CHANGES index bc44eaf674..0a0786fd57 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,15 @@ +1.3.151.jcn1 +============ + +* Fixed feta-braces: more symbols again, but all paper sizes use same +font. Also fixed lookup. + +* Maximum length for lyric-hyphen. + +* Two forgotten note corrections to Standchen. + +* Website compilation fix. + 1.3.150.jcn3 ============ diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 9ef6f3c315..ae3deb3250 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -347,6 +347,26 @@ apt-get as root: apt-get install lilypond1.3 @end example + +Debian's tex installation is a bit short on memory, you may want to +increase it like this: +@example +--- /etc/texmf/texmf.cnf.dpkg Sun Jan 28 14:12:14 2001 ++++ /etc/texmf/texmf.cnf Fri Apr 27 11:09:35 2001 +@@ -384,8 +384,8 @@ + main_memory.context = 1500000 + main_memory.mpost = 1000000 + main_memory = 263000 % words of inimemory available; also applies to inimf&mp +-extra_mem_top = 0 % extra high memory for chars, tokens, etc. +-extra_mem_bot = 0 % extra low memory for boxes, glue, breakpoints, etc. ++extra_mem_top = 100000 % extra high memory for chars, tokens, etc. ++extra_mem_bot = 100000 % extra low memory for boxes, glue, breakpoints, etc. + + obj_tab_size.context = 256000 + + +@end example + Alternatively, visit @itemize @bullet diff --git a/VERSION b/VERSION index 90d8cc214b..b8f0c8a935 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=151 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/afm.cc b/lily/afm.cc index aa569951ea..453dcbf057 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -73,6 +73,11 @@ Adobe_font_metric::find_char_metric (String nm, bool warn) const return font_inf_->cmi + (*ai).second; } +int +Adobe_font_metric::count () const +{ + return ascii_to_metric_idx_.size (); +} Box Adobe_font_metric::get_char (int code) const diff --git a/lily/font-metric.cc b/lily/font-metric.cc index b421075119..930d5f3b2c 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -90,6 +90,11 @@ Font_metric::Font_metric (Font_metric const &s) { } +int +Font_metric::count () const +{ + return 0; +} Box Font_metric::get_char (int)const diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index cd676ff44a..1a35efaaed 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -48,7 +48,10 @@ Hyphen_spanner::brew_molecule (SCM smob) Real lt = sp->paper_l ()->get_var ("stafflinethickness"); Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ; Real h = gh_scm2double (sp->get_grob_property ("height")); + + // interval? Real l = gh_scm2double (sp->get_grob_property ("minimum-length")); + Real x = gh_scm2double (sp->get_grob_property ("maximum-length")); // The hyphen can exist in the word space of the left lyric ... SCM space = sp->get_bound (LEFT)->get_grob_property ("word-space"); if (gh_number_p (space)) @@ -56,10 +59,16 @@ Hyphen_spanner::brew_molecule (SCM smob) bounds[LEFT] -= gh_scm2double (space); } Real w = bounds.length (); + + /* for length, use a geometric mean of the available space and some minimum - */ + */ if (l < w) - l = sqrt (l*w); + { + l = sqrt (l*w); + if (l > x) + l = x; + } else { /* OK, we have a problem. Usually this means that we're on the diff --git a/lily/include/afm.hh b/lily/include/afm.hh index b62d34fa54..2f8b07ae02 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -22,6 +22,7 @@ struct Adobe_font_metric : Font_metric { AFM_Font_info * font_inf_; + virtual int count () const; virtual Box get_char (int) const; AFM_CharMetricInfo const *find_char_metric (String name, bool warn=true) const; AFM_CharMetricInfo const *find_ascii_metric (int, bool warn=true) const; diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 0bea74247e..87137221c3 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -21,6 +21,8 @@ struct Font_metric public: SCM description_; String path_; + + virtual int count () const; virtual Box get_char (int ascii) const; virtual Box text_dimension (String) const; virtual Molecule find_by_name (String) const; diff --git a/lily/include/tfm.hh b/lily/include/tfm.hh index 93deefc106..8eb633a9e5 100644 --- a/lily/include/tfm.hh +++ b/lily/include/tfm.hh @@ -150,7 +150,8 @@ class Tex_font_metric : public Font_metric public: static SCM make_tfm (String filename); - Box get_char (int) const; + virtual int count () const; + virtual Box get_char (int) const; Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const; String str () const; diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 72a444a532..22b993ba31 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -138,25 +138,17 @@ System_start_delimiter::brew_molecule (SCM smob) } Molecule -System_start_delimiter::staff_brace (Grob*me,Real y) +System_start_delimiter::staff_brace (Grob*me, Real y) { - - /* - FIXME: - * should look at afm/tfm file for dimensions. - (This breaks ascii-art output: it hasn't got 255 symbols) - - * more glyphs (or maybe just better sized (fixed # of staff-spaces)), - the size mismatches with the staffs are very ugly - - */ - - // ugrhn - int lo = 0; - int hi = 255; - Font_metric *fm = Font_interface::get_default_font (me); Box b; + int lo = 0; + int hi = 255; //arg, urg == 0: fm->count () >? 2; + + int big = 1; + SCM bigger = gh_list (me->mutable_property_alist_, + me->immutable_property_alist_, + SCM_UNDEFINED); /* do a binary search for each Y, not very efficient, but passable? */ do @@ -165,9 +157,35 @@ System_start_delimiter::staff_brace (Grob*me,Real y) b = fm->get_char (cmp); if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y) - hi = cmp; + { + hi = cmp; + } else - lo = cmp; + { + /* + ugh: 7 + We have four fonts: feta-braces0-3.mf + + In the style-sheet, all paper relative sizes need to start + looking at the feta-braces0 font. + + The smallest paper size, feta11 or -3, has to make 5 steps + to get to feta26 or +2. Only after that, from +3 to +5 are + the real bigger sizes, so worst case we need 8 steps to get + to the font we need. */ + if (big < 8) + { + bigger = gh_cons (gh_cons (ly_symbol2scm ("font-relative-size"), + gh_int2scm (big++)), + bigger); + me->set_grob_property ("font", bigger); + fm = Font_interface::get_default_font (me); + lo = 0; + hi = 255; //fm->count () >? 2; + } + else + lo = cmp; + } } while (hi - lo > 1); diff --git a/lily/tfm.cc b/lily/tfm.cc index 3bf4f94632..0a3e7362b5 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -79,6 +79,12 @@ Tex_font_metric::find_ascii (int ascii, bool warn) const return &dummy_static_char_metric; } +int +Tex_font_metric::count () const +{ + return ascii_to_metric_idx_.size (); +} + Box Tex_font_metric::get_char (int a) const { diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index db3c642752..ca510cebb3 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -16,7 +16,7 @@ def draw_brace( expr height_sharp, width_sharp) = define_pixels (height, width); thin = 2 stafflinethickness; - thick = .5 staff_space; + thick = .5 width; z2 = .5 [z1, z3]; y3 = y1 + height/2; @@ -39,9 +39,10 @@ def draw_brace( expr height_sharp, width_sharp) = endchar; enddef; - -for x := 1 step 1 until 160: - % note: define_pixels (x) multiplies x by hppp, - % we must never get bigger than infinity - draw_brace (min (x * pt#, infinity/hppp - 1), staff_space#); +for i := font_count * 256 step 1 until (font_count + 1) * 256 - 1: + % note: define_pixels (x) multiplies x by hppp, + % we must never get bigger than infinity + y := min ((i + 1) * 0.25pt#, infinity/hppp - 1); + x := y / 12; + draw_brace (y, x); endfor diff --git a/mf/feta-braces0.mf b/mf/feta-braces0.mf new file mode 100644 index 0000000000..6afda40f26 --- /dev/null +++ b/mf/feta-braces0.mf @@ -0,0 +1,17 @@ +% +% feta-braces0.mf -- 256 smallest braces +% +% source file of the Feta (Font-En-Tja) music font +% +% (c) 1997--2001 Han-Wen Nienhuys +% + +font_identifier:="feta-braces0"; +font_size 16; +mode_setup; + +staffsize#:=16pt#; +font_count := 0; +input feta-beugel; +end. + diff --git a/mf/feta-braces1.mf b/mf/feta-braces1.mf new file mode 100644 index 0000000000..eb535f0457 --- /dev/null +++ b/mf/feta-braces1.mf @@ -0,0 +1,17 @@ +% +% feta-braces1.mf -- next 256 braces +% +% source file of the Feta (Font-En-Tja) music font +% +% (c) 1997--2001 Han-Wen Nienhuys +% + +font_identifier:="feta-braces1"; +font_size 16; +mode_setup; + +staffsize#:=16pt#; +font_count := 1; +input feta-beugel; +end. + diff --git a/mf/feta-braces11.mf b/mf/feta-braces11.mf index fd8453098f..e69de29bb2 100644 --- a/mf/feta-braces11.mf +++ b/mf/feta-braces11.mf @@ -1,17 +0,0 @@ - -% -% feta-braces11.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces11"; -font_size 11; -mode_setup; - -staffsize#:=11pt#; -input feta-beugel; -end. - diff --git a/mf/feta-braces13.mf b/mf/feta-braces13.mf index 92b47b8166..e69de29bb2 100644 --- a/mf/feta-braces13.mf +++ b/mf/feta-braces13.mf @@ -1,17 +0,0 @@ - -% -% feta-braces13.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces13"; -font_size 13; -mode_setup; - -staffsize#:=13pt#; -input feta-beugel; -end. - diff --git a/mf/feta-braces16.mf b/mf/feta-braces16.mf index d11edfc9c6..e69de29bb2 100644 --- a/mf/feta-braces16.mf +++ b/mf/feta-braces16.mf @@ -1,17 +0,0 @@ - -% -% feta-braces16.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces16"; -font_size 16; -mode_setup; - -staffsize#:=16pt#; -input feta-beugel; -end. - diff --git a/mf/feta-braces2.mf b/mf/feta-braces2.mf new file mode 100644 index 0000000000..3eb180c44c --- /dev/null +++ b/mf/feta-braces2.mf @@ -0,0 +1,17 @@ +% +% feta-braces2.mf -- next 256 braces +% +% source file of the Feta (Font-En-Tja) music font +% +% (c) 1997--2001 Han-Wen Nienhuys +% + +font_identifier:="feta-braces2"; +font_size 16; +mode_setup; + +staffsize#:=16pt#; +font_count := 2; +input feta-beugel; +end. + diff --git a/mf/feta-braces20.mf b/mf/feta-braces20.mf index 9dde058f03..e69de29bb2 100644 --- a/mf/feta-braces20.mf +++ b/mf/feta-braces20.mf @@ -1,15 +0,0 @@ -% -% feta-braces20.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces20"; -font_size 20; -mode_setup; - -staffsize#:=20pt#; -input feta-beugel; -end. diff --git a/mf/feta-braces23.mf b/mf/feta-braces23.mf index 99d2d46f87..e69de29bb2 100644 --- a/mf/feta-braces23.mf +++ b/mf/feta-braces23.mf @@ -1,17 +0,0 @@ - -% -% feta-braces23.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces23"; -font_size 22.5; %% feta23 = 22.5pt ... -mode_setup; - -staffsize#:=22.5pt#; -input feta-beugel; -end. - diff --git a/mf/feta-braces26.mf b/mf/feta-braces26.mf index c2c0e6850b..e69de29bb2 100644 --- a/mf/feta-braces26.mf +++ b/mf/feta-braces26.mf @@ -1,17 +0,0 @@ - -% -% feta-braces26.mf -- implement -% -% source file of the Feta (Font-En-Tja) music font -% -% (c) 1997--2001 Han-Wen Nienhuys -% - -font_identifier:="feta-braces26"; -font_size 26; -mode_setup; - -staffsize#:=26pt#; -input feta-beugel; -end. - diff --git a/mf/feta-braces3.mf b/mf/feta-braces3.mf new file mode 100644 index 0000000000..847ac44254 --- /dev/null +++ b/mf/feta-braces3.mf @@ -0,0 +1,17 @@ +% +% feta-braces3.mf -- next 256 braces +% +% source file of the Feta (Font-En-Tja) music font +% +% (c) 1997--2001 Han-Wen Nienhuys +% + +font_identifier:="feta-braces3"; +font_size 16; +mode_setup; + +staffsize#:=16pt#; +font_count := 3; +input feta-beugel; +end. + diff --git a/mutopia/F.Schubert/standchen.ly b/mutopia/F.Schubert/standchen.ly index 54a19767ca..d7e3e0428c 100644 --- a/mutopia/F.Schubert/standchen.ly +++ b/mutopia/F.Schubert/standchen.ly @@ -30,7 +30,7 @@ instrument = "Piano" copyright = "Public Domain" maintainer = "Jan Nieuwenhuizen" maintainerEmail = "janneke@gnu.org" - lastupdated = "2001/Apr/26" + lastupdated = "2001/Apr/27" mutopiapublicdomain = "\\parbox{\\hsize}{\\thefooter\\quad\\small \\\\This music is part of the Mutopia project, \\texttt{http://www.mutopiaproject.org/}\\\\It has been typeset @@ -38,7 +38,7 @@ instrument = "Piano" ".\\\\Unrestricted modification and redistribution is permitted and encouraged---copy this music and share it.}" tagline = \mutopiapublicdomain - footer = "Mutopia-2001/04/26-xx" + footer = "Mutopia-2001/04/27-xx" } \version "1.3.146" @@ -159,7 +159,7 @@ trebleVerseOne = \notes\relative c{ | r8 | r8 | - r8 | + r8 | % manual beam override bug % r8 < [ es g bes> r8 < { [ es g es g ] } { g bes g bes } { bes es bes es } > @@ -363,6 +363,7 @@ global = \notes{ allLyrics = \lyrics { % maybe should be bigger by default, in grob-description.scm ? \property Lyrics . LyricText \override #'font-relative-size = #1 + \property Lyrics . LyricHyphen \override #'maximum-length = #1.5 \lyricVerseOne \lyricVerseTwo \lyricThrough diff --git a/mutopia/J.S.Bach/wtk1-fugue2.ly b/mutopia/J.S.Bach/wtk1-fugue2.ly index bc8a767dbd..80e6941046 100644 --- a/mutopia/J.S.Bach/wtk1-fugue2.ly +++ b/mutopia/J.S.Bach/wtk1-fugue2.ly @@ -12,8 +12,14 @@ mutopiaopus = "BWV847" style = "baroque" copyright = "Public Domain" - tagline = "\\\\This music is part of the Mutopia project, http://sca.uwaterloo.ca/Mutopia/\\\\It has been typeset and placed in the public domain by Han-Wen Nienhuys.\\\\Unrestricted modification and redistribution is permitted and encouraged - copy this music and share it!" maintainer = "hanwen@cs.uu.nl" + mutopiapublicdomain = "\\parbox{\\hsize}{\\thefooter\\quad\\small + \\\\This music is part of the Mutopia project, + \\texttt{http://www.mutopiaproject.org/}\\\\It has been typeset + and placed in the public domain by " + \maintainer + + ".\\\\Unrestricted modification and redistribution is permitted + and encouraged---copy this music and share it.}" + tagline = \mutopiapublicdomain lastupdated = "2000/Feb/14" } @@ -170,6 +176,7 @@ bassdux = \context Voice=three \notes \relative c' { \score { \notes \context PianoStaff < + \property Score.TimeSignature \override #'style = #'C \context Staff = treble < \key c \minor % \key es \major @@ -185,11 +192,6 @@ bassdux = \context Voice=three \notes \relative c' { \paper { linewidth = 18.0 \cm - \translator{ \OrchestralScoreContext - timeSignatureStyle \override #'style = #"C" - - } - } \header{ opus = "BWV 847" diff --git a/scm/font.scm b/scm/font.scm index 084a5039bf..e6c46e7ba1 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -102,14 +102,22 @@ ((-2 medium caps roman cmcsc 7) . "cmcsc7") ((-3 medium caps roman cmcsc 7) . "cmcsc7") - - ;; should use the same brace font every where and fix C++ code. - ((2 * * braces feta-braces 26) . "feta-braces26") - ((1 * * braces feta-braces 23) . "feta-braces23") - ((0 * * braces feta-braces 20) . "feta-braces20") - ((-1 * * braces feta-braces 16) . "feta-braces16") - ((-2 * * braces feta-braces 13) . "feta-braces13") - ((-3 * * braces feta-braces 11) . "feta-braces11") + ;; smallest needs 8 steps: -3 to +5, so + ;; biggest also needs 8 available steps: +2 to + 10 + ((10 * * braces feta-braces 3) . "feta-braces3") + ((9 * * braces feta-braces 3) . "feta-braces3") + ((8 * * braces feta-braces 3) . "feta-braces3") + ((7 * * braces feta-braces 3) . "feta-braces3") + ((6 * * braces feta-braces 3) . "feta-braces3") + ((5 * * braces feta-braces 3) . "feta-braces3") + ((4 * * braces feta-braces 2) . "feta-braces2") + ((3 * * braces feta-braces 1) . "feta-braces1") + ((2 * * braces feta-braces 0) . "feta-braces0") + ((1 * * braces feta-braces 0) . "feta-braces0") + ((0 * * braces feta-braces 0) . "feta-braces0") + ((-1 * * braces feta-braces 0) . "feta-braces0") + ((-2 * * braces feta-braces 0) . "feta-braces0") + ((-3 * * braces feta-braces 0) . "feta-braces0") ((3 * * dynamic feta-din 19) . "feta-din19") ((2 * * dynamic feta-din 19) . "feta-din19") diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 90bbb79a0b..fd4a146c8e 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -275,6 +275,7 @@ (thickness . 1.0) (height . 0.4) (minimum-length . 0.5) + (maximum-length . 100) (molecule-callback . ,Hyphen_spanner::brew_molecule) (Y-extent-callback . ,Grob::point_dimension_callback) (meta . ,(grob-description "LyricHyphen" lyric-hyphen-interface )) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 8f22abd649..ef4cec6beb 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -203,6 +203,7 @@ For barline, space after a thick line.") (grob-property-description 'lookup symbol? "lookup method: 'value for plain text, 'name for character-name.") (grob-property-description 'magnify number? "the magnification factor. FIXME: doesn't work for feta fonts.") (grob-property-description 'maximum-duration-for-spacing moment? "space as if a duration of this type is available in this measure.") +(grob-property-description 'maximum-length number? "don't make Grob longer than this") (grob-property-description 'maximum-rest-count integer? "kill off rests so we don't more than this number left.") (grob-property-description 'merge-differently-dotted boolean? " Merge noteheads in collisions, even if they have a different number of dots. This normal notation for some types of polyphonic music. The value of this setting is used by @ref{note-collision-interface} .") (grob-property-description 'minimum-distance number? "minimum distance between notes and rests.") diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 3a4eb4175d..457a00f37a 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -544,8 +544,9 @@ lily output file in TFILES after that, and return the Latex file constructed. ' %% to get the last mutopia tagline right (ie: no footer on last page) %% Please check that mutopia footers and endfooter are OK before changing %% this again. -- jcn +% the \mbox{} helps latex if people do stupid things in tagline \makeatletter -\renewcommand{\@oddfoot}{\parbox{\textwidth}{\makelilypondtagline}}% +\renewcommand{\@oddfoot}{\parbox{\textwidth}{\mbox{}\makelilypondtagline}}% \makeatother ''' s = s + '\\end{document}' diff --git a/scripts/mup2ly.py b/scripts/mup2ly.py index 0bb9cbf01b..c48765b320 100644 --- a/scripts/mup2ly.py +++ b/scripts/mup2ly.py @@ -1184,17 +1184,21 @@ for opt in options: # sys.stdout.flush () # handy emacs testing -if not files: - files = ['template.mup'] +# if not files: +# files = ['template.mup'] +if not files: + files = ['-'] + for f in files: - if f == '-': - f = '' - if f and not os.path.isfile (f): + if f == '-': + h = sys.stdin + elif f and not os.path.isfile (f): f = strip_extension (f, '.mup') + '.mup' + h = open (f) progress ( _("Processing %s..." % f)) - raw_lines = open (f).readlines () + raw_lines = h.readlines () p = Pre_processor (raw_lines) if only_pre_process_p: if not output: @@ -1205,7 +1209,13 @@ for f in files: output = os.path.basename (re.sub ('(?i).mup$', '.ly', f)) if output == f: output = os.path.basename (f + '.ly') - + + if f == '-': + output = '-' + out_h = sys.stdout + else: + out_h = open (output, 'w') + progress (_ ("Writing %s...") % output) tag = '%% Lily was here -- automatically converted by %s from %s' % ( program_name, f) @@ -1215,9 +1225,8 @@ for f in files: else: ly = tag + '\n\n' + e.dump () - o = open (output, 'w') - o.write (ly) - o.close () + out_h.write (ly) + out_h.close () if debug_p: print (ly)