From f21a1d3a3255b66914f5e4f09eb81e1d54ddb3e7 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:07:22 +0000 Subject: [PATCH] lilypond-1.5.46 --- input/baerenreiter-sarabande.ly | 5 +++++ lily/include/beam.hh | 15 ++++++++++----- lily/include/dimensions.hh | 4 ++++ lily/include/music-output-def.hh | 3 +++ lily/include/scm-hash.hh | 10 ---------- lily/lily-guile.cc | 9 +++++++++ lily/paper-def.cc | 2 -- lily/paper-outputter.cc | 3 +-- lily/simple-spacer.cc | 8 +++++++- ly/engraver-init.ly | 5 +++-- ly/params-init.ly | 2 ++ scm/grob-description.scm | 11 ++++------- scm/tex.scm | 15 ++++++++++----- scripts/ly2dvi.py | 28 ++++++++-------------------- tex/lily-ps-defs.tex | 6 ------ tex/lilyponddefs.tex | 8 ++------ 16 files changed, 68 insertions(+), 66 deletions(-) diff --git a/input/baerenreiter-sarabande.ly b/input/baerenreiter-sarabande.ly index 262ef28ca6..b7de5d717b 100644 --- a/input/baerenreiter-sarabande.ly +++ b/input/baerenreiter-sarabande.ly @@ -149,6 +149,11 @@ smallerPaper = \paper { baerPaper = \paper { indent = 7. \mm linewidth =183.5 \mm + interscoreline=4.0\mm + \translator { + \ScoreContext +% System \override #'molecule-callback = #box-grob-molecule + } } diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 7e217ce035..4f32cfe0e8 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -9,7 +9,7 @@ #include "lily-proto.hh" #include "lily-guile.hh" - +#include "stem-info.hh" class Beam @@ -36,9 +36,14 @@ public: DECLARE_SCHEME_CALLBACK (check_concave, (SCM)); DECLARE_SCHEME_CALLBACK (slope_damping, (SCM)); DECLARE_SCHEME_CALLBACK (quanting, (SCM)); - DECLARE_SCHEME_CALLBACK (score_slopes_dy, (SCM, SCM,SCM)); - DECLARE_SCHEME_CALLBACK (score_stem_lengths, (SCM, SCM,SCM)); - DECLARE_SCHEME_CALLBACK (score_forbidden_quants, (SCM, SCM,SCM)); + static Real score_slopes_dy (Grob*, Real,Real,Real,Real); + static Real score_stem_lengths (Link_array, + Array, + Array, Array, Array, + Grob*,Real , Real); + static Real score_forbidden_quants (Grob*, Real, Real, + Real, Real, Real, Real, + int); static Molecule stem_beams (Grob*,Item *here, Item *next, Item *prev, @@ -49,7 +54,7 @@ private: static void set_stem_directions (Grob*); static void consider_auto_knees (Grob*); static void set_stem_shorten (Grob*); - static Real calc_stem_y (Grob*, Item* s, Interval pos); + static Real calc_stem_y (Grob*, Grob* s, Interval pos); static void set_stem_lengths (Grob*); static int forced_stem_count (Grob*); }; diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index 66a9d0868d..c5f54a17e7 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -23,6 +23,9 @@ const Real PT_TO_MM = (1.0/MM_TO_PT); #define BIGPOINT *BIGPOINT_TO_POINT #define CHAR *CHAR_TO_PT + +#define INTERNAL_UNIT "pt" + #else // mm #define PT *PT_TO_PT *PT_TO_MM @@ -31,6 +34,7 @@ const Real PT_TO_MM = (1.0/MM_TO_PT); #define INCH *INCH_TO_PT *PT_TO_MM #define BIGPOINT *BIGPOINT_TO_POINT *PT_TO_MM #define CHAR *CHAR_TO_PT *PT_TO_MM +#define INTERNAL_UNIT "mm" #endif diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh index e585202a6e..8015d60790 100644 --- a/lily/include/music-output-def.hh +++ b/lily/include/music-output-def.hh @@ -20,12 +20,15 @@ Definition of how to output lilypond. TODO: smobify, remove Music_output_def_identifier. + + TODO: remove Scope structure. Scheme_hash_table has all the info. */ class Music_output_def { public: Scheme_hash_table * translator_tab_; Scheme_hash_table * variable_tab_; + Scope *translator_p_dict_p_; Scope *scope_p_; diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 54423b6302..626ae3d7ae 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -35,16 +35,6 @@ scm_gc_unprotect_object (tab->self_scm_); - - - - TODO: - - - This should come from GUILE. We're typically doing double work, - because KEY already is a symbol, and is looked up in a symbol - hashtable. - - - use GUILE hashtables iso STL. */ class Scheme_hash_table diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 794062bfdd..975b9e5229 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -23,6 +23,7 @@ #include "offset.hh" #include "interval.hh" #include "pitch.hh" +#include "dimensions.hh" SCM ly_last (SCM list) @@ -463,6 +464,12 @@ ly_version () return gh_eval_str ((char*)vs); } +SCM +ly_unit () +{ + return gh_str02scm (INTERNAL_UNIT); +} + static void init_functions () { @@ -470,6 +477,8 @@ init_functions () (Scheme_function_unknown)ly_warning); scm_c_define_gsubr ("ly-version", 0, 0, 0, (Scheme_function_unknown)ly_version); + scm_c_define_gsubr ("ly-unit", 0, 0, 0, + (Scheme_function_unknown)ly_unit); scm_c_define_gsubr ("ly-gulp-file", 1,0, 0, (Scheme_function_unknown)ly_gulp_file); scm_c_define_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p); diff --git a/lily/paper-def.cc b/lily/paper-def.cc index d28375ba91..03766359ef 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -165,8 +165,6 @@ Paper_def::find_font (SCM fn, Real m) SCM Paper_def::font_descriptions ()const { - - SCM l = SCM_EOL; for (SCM s = scaled_fonts_; gh_pair_p (s); s = ly_cdr (s)) { diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index c14eb72224..1c0681010a 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -127,11 +127,10 @@ Paper_outputter::output_version () output_String_def ("lilypondtagline", id_str); output_String_def ("LilyPondVersion", version_str ()); + output_String_def ("lilypondpaperunit", String (INTERNAL_UNIT)); } - - void Paper_outputter::output_Real_def (String k, Real v) { diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index fa75e433a7..3590d12f40 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -319,7 +319,13 @@ Simple_spacer::solve (Column_x_positions *positions) const positions->force_f_ = force_f_; if ((force_f_ < 0)) { - positions->force_f_ *= 1.3; + + /* + We used to have a penalty for compression, no matter what, but that + fucked up wtk1-fugue2 (taking 3 full pages.) + + maybe this should be tunable? + */ if (compression_penalty_b_) positions->force_f_ *= 2; // hmm. } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index ece2525443..d6a478164c 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -34,8 +34,9 @@ StaffContext=\translator { \consists "Grob_pq_engraver" \consistsend "Axis_group_engraver" - - MinimumVerticalExtent = #'(-4 . 4) + + + MinimumVerticalExtent = #'(-6 . 6) ExtraVerticalExtent = ##f VerticalExtent = ##f localKeySignature = #'() diff --git a/ly/params-init.ly b/ly/params-init.ly index e4c851f7eb..29dd3cd10d 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -18,12 +18,14 @@ paperfile = \papersize + "-init.ly" \include \paperfile \include "paper-init.ly" +unit = "mm" staffspace = \staffheight / 4.0 stafflinethickness = \staffspace / 10.0 outputscale = \staffheight / 4.0 % blotdiameter = 0.4 \pt blotdiameter = 0.04 \pt +interscoreline = 4. \mm \translator { \NoteNamesContext } diff --git a/scm/grob-description.scm b/scm/grob-description.scm index c55661e8a9..5d5fbf938c 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -110,10 +110,9 @@ (before-line-breaking-callback . ,Beam::before_line_breaking) (after-line-breaking-callback . (,Beam::after_line_breaking ,Beam::end_after_line_breaking)) - (quant-score-functions . (,Beam::score_forbidden_quants - ,Beam::score_slopes_dy - ,Beam::score_stem_lengths - )) +; (quant-score-functions . ( +; ,Beam::score_stem_lengths +; )) (neutral-direction . -1) (dir-function . ,beam-dir-majority-median) (beamed-stem-shorten . (1.0 0.5)) @@ -567,9 +566,7 @@ (edge-width . (0.5 . 0.5)) (edge-height . (1.0 . 1.0)) (shorten-pair . (0.0 . 0.0)) - (left-widen . #f) - (right-widen . #f) - (text-start . #f) + (thickness . 1.0) (meta . ,(grob-description piano-pedal-interface)) )) diff --git a/scm/tex.scm b/scm/tex.scm index 79f6886422..2769db1cd2 100644 --- a/scm/tex.scm +++ b/scm/tex.scm @@ -165,6 +165,13 @@ (define (header-end) (string-append + "\\def\\scaletounit{ " + (number->string (cond + ((equal? (ly-unit) "mm") (/ 72.0 25.4)) + ((equal? (ly-unit) "pt") (/ 72.0 72.27)) + (else (error "unknown unit" (ly-unit))) + )) + " mul }" "\\special{\\string! " ;; URG: ly-gulp-file: now we can't use scm output without Lily @@ -175,10 +182,7 @@ (ly-gulp-file "music-drawing-routines.ps")) (if (defined? 'ps-testing) "/testing true def%\n" "") "}" - "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale " - ;; "pt" - "mm" - + "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit" "\\turnOnPostScript")) ;; Note: this string must match the string in ly2dvi.py!!! @@ -226,7 +230,8 @@ (embedded-ps (list 'bezier-sandwich `(quote ,l) thick))) (define (start-line ht) - (string-append"\\vbox to " (number->dim ht) "{\\hbox{%\n")) + (string-append "\\vbox to " (number->dim ht) "{\\hbox{" + "%\n")) (define (stop-line) "}\\vss}\\interscoreline\n") diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index f1c795ba08..da78c42198 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -9,12 +9,6 @@ # Jan Arne Fagertun (Bourne shell script) # - -# -# TODO: should allow to set a central pk cache directory from the command line. -# TODO: should allow to switch off pk cache. -# - # # Note: gettext work best if we use ' for docstrings and " # for gettextable strings. @@ -334,7 +328,8 @@ extra_init = { 'pagenumber' : [1], 'textheight' : [], 'linewidth' : [], - 'orientation' : [] + 'orientation' : [], + 'unit' : ['pt'], } extra_fields = extra_init.keys () @@ -343,9 +338,6 @@ fields = layout_fields + extra_fields include_path = ['.'] lily_p = 1 paper_p = 1 -cache_pks_p = 1 - -PK_PATTERN='feta.*\.[0-9]+pk' output_name = '' targets = { @@ -362,11 +354,12 @@ dependency_files = [] kpse = os.popen ('kpsexpand \$TEXMF').read() kpse = re.sub('[ \t\n]+$','', kpse) +type1_paths = os.popen ('kpsewhich -expand-path=\$T1FONTS').read () environment = { ## todo: prevent multiple addition. 'TEXMF' : "{%s,%s}" % (datadir, kpse) , - 'GS_FONTPATH' : datadir + '/afm:' + datadir + '/pfa', + 'GS_FONTPATH' : type1_paths, 'GS_LIB' : datadir + '/ps', } @@ -567,14 +560,15 @@ lily output file in TFILES after that, and return the Latex file constructed. ' if extra['orientation']: orientation = extra['orientation'][0] - # set sane geometry width (a4-width) for linewidth = -1. + unit = extra['unit'][-1] + # set sane geometry width (a4-width) for linewidth = -1. maxlw = max (extra['linewidth'] + [-1]) if maxlw < 0: # who the hell is 597 ? linewidth = '597pt' else: - linewidth = maxlw - s = s + '\geometry{width=%smm%s,headheight=2mm,footskip=2mm,%s}\n' % (linewidth, textheight, orientation) + linewidth = '%d%s' % (maxlw, unit) + s = s + '\geometry{width=%s%s,headheight=2mm,footskip=2mm,%s}\n' % (linewidth, textheight, orientation) if extra['latexoptions']: s = s + '\geometry{twosideshift=4mm}\n' @@ -826,9 +820,6 @@ if files and files[0] != '-': setup_environment () tmpdir = setup_temp () - if cache_pks_p : - os.chdir (outdir) - cp_to_dir (PK_PATTERN, tmpdir) # to be sure, add tmpdir *in front* of inclusion path. #os.environ['TEXINPUTS'] = tmpdir + ':' + os.environ['TEXINPUTS'] @@ -893,9 +884,6 @@ if files and files[0] != '-': elif verbose_p: warning (_ ("can't find file: `%s'") % outname) - if cache_pks_p: - cp_to_dir (PK_PATTERN, outdir) - os.chdir (original_dir) cleanup_temp () diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index ed2eeb4af8..80bf79c97d 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -11,12 +11,6 @@ % \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}} \def\lilySpace{ } - -% PostScript PT/IN: 72/25.4 -\def\scaletounit{ 2.834645 mul } - -% for true printers points to postscript points: -%\def\scaletounit{1.00375} \def\turnOnPostScript{% % This sets CTM so that you get to the currentpoint % by executing a 0 0 moveto diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index c948be1bd6..3ad96eaec7 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -40,18 +40,14 @@ % Attempt to keep lilypiecetitle together with the piece: \def\myfilbreak{\par\vfil\penalty200\vfilneg} -% stacked horizontal lines -\ifundefined{lilypondpaperinterscoreline} - \def\lilypondpaperinterscoreline{16} -\fi + \ifundefined{lilypondpaperinterscorelinefill} \def\lilypondpaperinterscorelinefill{0} \else \def\lilypondpaperinterscorelinefill{1} \fi -\def\interscoreline{\vskip\lilypondpaperinterscoreline pt plus % - \lilypondpaperinterscorelinefill fill} +\def\interscoreline{\vskip \lilypondpaperinterscoreline \lilypondpaperunit plus \lilypondpaperinterscorelinefill fill} \def\placebox#1#2#3{% \botalign{\hbox{\raise #1\leftalign{\kern #2{}#3}}}}% -- 2.39.5