baerPaper = \paper {
indent = 7. \mm
linewidth =183.5 \mm
+ interscoreline=4.0\mm
+ \translator {
+ \ScoreContext
+% System \override #'molecule-callback = #box-grob-molecule
+ }
}
#include "lily-proto.hh"
#include "lily-guile.hh"
-
+#include "stem-info.hh"
class Beam
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,
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*);
};
#define BIGPOINT *BIGPOINT_TO_POINT
#define CHAR *CHAR_TO_PT
+
+#define INTERNAL_UNIT "pt"
+
#else // mm
#define PT *PT_TO_PT *PT_TO_MM
#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
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_;
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
#include "offset.hh"
#include "interval.hh"
#include "pitch.hh"
+#include "dimensions.hh"
SCM
ly_last (SCM list)
return gh_eval_str ((char*)vs);
}
+SCM
+ly_unit ()
+{
+ return gh_str02scm (INTERNAL_UNIT);
+}
+
static void
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);
SCM
Paper_def::font_descriptions ()const
{
-
-
SCM l = SCM_EOL;
for (SCM s = scaled_fonts_; gh_pair_p (s); s = ly_cdr (s))
{
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)
{
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.
}
\consists "Grob_pq_engraver"
\consistsend "Axis_group_engraver"
-
- MinimumVerticalExtent = #'(-4 . 4)
+
+
+ MinimumVerticalExtent = #'(-6 . 6)
ExtraVerticalExtent = ##f
VerticalExtent = ##f
localKeySignature = #'()
\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 }
(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))
))
(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")
# 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.
'pagenumber' : [1],
'textheight' : [],
'linewidth' : [],
- 'orientation' : []
+ 'orientation' : [],
+ 'unit' : ['pt'],
}
extra_fields = extra_init.keys ()
include_path = ['.']
lily_p = 1
paper_p = 1
-cache_pks_p = 1
-
-PK_PATTERN='feta.*\.[0-9]+pk'
output_name = ''
targets = {
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',
}
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'
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']
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 ()
%
\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
% 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}}}}%