]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.46
authorfred <fred>
Wed, 27 Mar 2002 02:07:22 +0000 (02:07 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:07:22 +0000 (02:07 +0000)
16 files changed:
input/baerenreiter-sarabande.ly
lily/include/beam.hh
lily/include/dimensions.hh
lily/include/music-output-def.hh
lily/include/scm-hash.hh
lily/lily-guile.cc
lily/paper-def.cc
lily/paper-outputter.cc
lily/simple-spacer.cc
ly/engraver-init.ly
ly/params-init.ly
scm/grob-description.scm
scm/tex.scm
scripts/ly2dvi.py
tex/lily-ps-defs.tex
tex/lilyponddefs.tex

index 262ef28ca62fe30cb4b039f4e5d4b56c3c64b435..b7de5d717bdecdfbb6ee075a6a1b7adc2b63b050 100644 (file)
@@ -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
+    }
 }
 
 
index 7e217ce0357c2606d0e1a31b4e3d62dc1b4394b9..4f32cfe0e88790ef3e8a80bc538af426adc965ba 100644 (file)
@@ -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<Grob>,
+                                 Array<Stem_info>,
+                                 Array<Real>, Array<Real>, Array<int>,
+                                 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*);
 };
index 66a9d0868d36bb2215c608a30f291fdc2820235c..c5f54a17e7afcec833352a1125463cf9290917e2 100644 (file)
@@ -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
 
index e585202a6e65eeedb35eb35ccaa800d8c28a0320..8015d6079041c6b33e3c7cd3dfc7c2354a7bf788 100644 (file)
   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_;
 
index 54423b63028a4c4f6fbf7ed30916a825ad9e20d1..626ae3d7ae9155c614748e197049dfe64e62bfdc 100644 (file)
 
    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
index 794062bfdd21cbc297f6c2698bf4b19a8a7111f4..975b9e522915f4d32919a4cf458dbf9ff5796bca 100644 (file)
@@ -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);
index d28375ba9105103030871b0a546873eb9aec79b9..03766359ef5b5db684d72970a22335c0dd55a241 100644 (file)
@@ -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))
     {
index c14eb722248ca948b0b7f5b1d8f0d70cfd25a67d..1c0681010ada3952fbd63298c384f1f5eddb8d75 100644 (file)
@@ -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)
 {
index fa75e433a7cdcbb8ad96607461db8b2922ae04e5..3590d12f4027051879917abd8c4b3ff2c4eed791 100644 (file)
@@ -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.
     }
index ece252544365a7e3dd2f5eab7f740891558f06e4..d6a478164c81979fc77aa308f9d9ad475bfc4279 100644 (file)
@@ -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 = #'()
index e4c851f7eb0c6b396c65d3e0b5177221b48dcbcd..29dd3cd10d3050076906d1469c21885d57e9d40d 100644 (file)
@@ -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 }
index c55661e8a99ca76140438e188a44abe414ae9874..5d5fbf938c543db9c927ec1c7f708097a68feb8f 100644 (file)
        (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))
        (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))
        ))
 
index 79f6886422fe3a193d8c9c2ea8ecf95314beeaf6..2769db1cd20a963e6129039d021e713b2c794c2f 100644 (file)
 
 (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
        (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!!!
   (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")
index f1c795ba082b3fd4ebf4d0e4e4c28fcf40e25a0b..da78c42198d1a423f3d29f68970dc7bb5aff19e7 100644 (file)
@@ -9,12 +9,6 @@
 # Jan Arne Fagertun <Jan.A.Fagertun@@energy.sintef.no> (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 ()
        
index ed2eeb4af890c13a55fd4847d14501930f1b3f4c..80bf79c97d7bd27eb2226b2c8abbdb917c992601 100644 (file)
 %
 \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
index c948be1bd646bc742c7620de209cbd4fa3e1a89f..3ad96eaec792fda234c262db08cce2a80ea974be 100644 (file)
 % 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}}}}%