lily-[0-9a-f][0-9a-f][0-9a-f]*
out-scons
out-cov
+out-test
tags
test-output-distance
config-*.hh
cd $(tree-share-prefix)/tex && \
ln -s $(top-src-dir)/tex source && \
ln -s ../../../../../tex/$(outconfbase) tex-out && \
- ln -s ../../../../../mf/$(outconfbase) mf-out
-
+ true
cd $(tree-share-prefix)/fonts && \
ln -s $(top-src-dir)/mf source && \
true
fi > input/regression/out-test/tree.gittxt
$(MAKE) -C input/regression/ out=$(OUT_TEST) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/input/manual -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= out-$(OUT_TEST)/collated-files.html
@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
-
+ rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(outdir)/share input/regression/out-test/
test-baseline:
@if test -d .git ; then \
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=11
-PATCH_LEVEL=25
+PATCH_LEVEL=26
MY_PATCH_LEVEL=
#!@PYTHON@
-# mf-to-table.py -- convert spacing info in MF logs . and .tex
+# mf-to-table.py -- convert spacing info in MF logs .
#
# source file of the GNU LilyPond music typesetter
#
-def write_tex_defs (file, global_info, charmetrics):
- nm = font_family
- for m in charmetrics:
-
- texname = re.sub ('[_.]', 'X', m['name'])
- def digit_to_letter (match):
- return chr (ord (match.group(1)) - ord ('0') + ord ('A'))
- texname = re.sub ('([0-9])', digit_to_letter, texname)
- file.write (r'''\gdef\%s%s{\char%d}%%%s''' % \
- (nm, texname, m['code'],'\n'))
- file.write ('\\endinput\n')
def write_character_lisp_table (file, global_info, charmetrics):
-l, --ly=FILE name output table
-o, --outdir=DIR prefix for dependency info
-p, --package=DIR specify package
- -t, --tex=FILE name output tex chardefs
""")
sys.exit (0)
'a:d:ho:p:t:',
['enc=', 'outdir=', 'dep=', 'lisp=',
'global-lisp=',
- 'tex=', 'debug', 'help', 'package='])
+ 'debug', 'help', 'package='])
global_lisp_nm = ''
char_lisp_nm = ''
enc_nm = ''
-texfile_nm = ''
depfile_nm = ''
lyfile_nm = ''
outdir_prefix = '.'
depfile_nm = a
elif o == '--outdir' or o == '-o':
outdir_prefix = a
- elif o == '--tex' or o == '-t':
- texfile_nm = a
elif o == '--lisp':
char_lisp_nm = a
elif o == '--global-lisp':
print o
raise getopt.error
-base = re.sub ('.tex$', '', texfile_nm)
+base = os.path.splitext (lyfile_nm)[0]
for filenm in files:
(g, m, deps) = parse_logfile (filenm)
- write_tex_defs (open (texfile_nm, 'w'), g, m)
enc_name = 'FetaEncoding'
if re.search ('parmesan', filenm):
enc_name = 'ParmesanEncoding'
write_deps (open (depfile_nm, 'wb'), deps,
[base + '.log', base + '.dvi', base + '.pfa',
depfile_nm,
- base + '.pfb', texfile_nm])
+ base + '.pfb'])
for f in glob.glob (pat):
infile = f
outfile = (dest_dir + '/' + f).replace ('.eps', '.png')
-
+ data_option = ''
+ if options.local_data_dir:
+ data_option = ('-slilypond-datadir=%s/share/lilypond/current '
+ % os.path.split(infile)[0])
+
mkdir (os.path.split (outfile)[0])
cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
+ ' %(data_option)s '
' -r101 '
' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
- ' %(infile)s -c quit ' % locals ())
+ ' %(infile)s -c quit ') % locals ()
files_created[oldnew].append (outfile)
system (cmd)
action="store_true",
help="Create PNGs from EPSes")
+
+ p.add_option ('--local-datadir',
+ dest="local_data_dir",
+ default=False,
+ action="store_true",
+ help='whether to use the share/lilypond/ directory in the test directory')
+
p.add_option ('-o', '--output-dir',
dest="output_dir",
default=None,
return (dir_.length () && dir_[0] == DIRSEP) || root_.length ();
}
+
+
+File_name
+File_name::canonicalized () const
+{
+ File_name c = *this;
+
+ replace_all (c.dir_, string ("//"), string ("/"));
+
+ vector<string> components = string_split (c.dir_, '/');
+ vector<string> new_components;
+
+ for (vsize i = 0; i < components.size (); i++)
+ {
+ if (components[i] == "..")
+ new_components.pop_back ();
+ else
+ new_components.push_back (components[i]);
+ }
+
+ c.dir_ = string_join (new_components, "/");
+ return c;
+}
bool is_absolute () const;
string to_string () const;
-
+ File_name canonicalized () const;
string dir_part () const;
string file_part () const;
};
#endif /* HAVE_BOOST_LAMBDA */
vector<string> string_split (string str, char c);
+string string_join (vector<string> const &strs, string infix);
#define iterof(i,s) typeof((s).begin()) i((s).begin())
return str;
}
+/*
+ TODO: this O(n^2) in #occurences of find, due to repeated copying.
+ */
string &
replace_all (string &str, string find, string replace)
{
{
string s = str.substr (0, i);
a.push_back (s);
- while (str[++i] == c)
- ;
+ i ++;
str = str.substr (i);
i = str.find (c);
}
a.push_back (str);
return a;
}
+
+string
+string_join (vector<string> const &strs, string infix)
+{
+ string result;
+ for (vsize i = 0; i < strs.size (); i ++)
+ {
+ if (i)
+ result += infix;
+ result += strs[i];
+ }
+
+ return result;
+}
string s = slashify (to_string ());
EQUAL ("/tmp/x.ly", s);
}
+
+TEST_STRING (File_name, Canonicalize, "foo//bar/..//bla//z.ly")
+{
+ string s = canonicalized ().to_string ();
+ EQUAL ("foo/bla/z.ly", s);
+}
+
--- /dev/null
+\header {
+ texidoc = "Dot columns do not trigger beam slanting too early."
+}
+
+\version "2.11.26"
+\paper{ ragged-right=##t }
+<<
+ { e''8 e''8 g'' g''} \\
+ { e8 r4. }
+>>
--- /dev/null
+\header {
+
+ texidoc = "@code{\laissezVibrer} ties on beamed notes don't trigger
+premature beam slope calculation. "
+
+}
+
+\version "2.11.26"
+
+\paper{
+ ragged-right=##t
+}
+
+{
+ c'8 e' g' c''\laissezVibrer r2 |
+ c'8 e' g' c'' r2
+}
static Grob *accidentals (Grob *me);
static Grob *arpeggio (Grob *me);
static Slice head_positions_interval (Grob *me);
- static Direction static_dir (Grob *);
static void translate_rests (Grob *me, int dy);
static Grob *first_head (Grob *me);
static Grob *get_rest (Grob *me);
set<int> dot_positions_;
Interval dot_x_;
vector<Tie_specification> specifications_;
+ bool use_horizontal_spacing_;
Tie_configuration_map possibilities_;
string s = symbols;
replace_all (s, '\n', ' ');
replace_all (s, '\t', ' ');
+ replace_all (s, " ", " ");
return ly_string_array_to_scm (string_split (s, ' '));
}
void internal_set_option (SCM var, SCM val)
{
- scm_hashq_set_x (option_hash, var, val);
-
if (0)
;
else if (var == ly_symbol2scm ("profile-property-accesses"))
debug_page_breaking_scoring = to_boolean (val);
val = scm_from_bool (to_boolean (val));
}
+ else if (var == ly_symbol2scm ("datadir"))
+ {
+ /* ignore input value. */
+ val = ly_string2scm (lilypond_datadir);
+ }
+
+
+ scm_hashq_set_x (option_hash, var, val);
+
+
}
if (char const *env = getenv ("LILYPOND_DATADIR"))
{
-#ifdef __MINGW32__
/* Normalize file name. */
lilypond_datadir = File_name (env).to_string ();
-#else
- lilypond_datadir = env;
-#endif
}
/* When running from build dir, a full LILYPOND_DATADIR is set-up at
if (!is_dir (lilypond_datadir.c_str ())
&& is_dir (build_datadir_current.c_str ()))
lilypond_datadir = build_datadir_current;
+
+
+ lilypond_datadir = File_name (lilypond_datadir).canonicalized().to_string();
global_path.append ("");
Interval notedim;
for (vsize i = 0; i < notes.size (); i++)
- notedim.unite (notes[i]->extent (common, Y_AXIS));
-
+ {
+ if (Note_column::dir (notes[i]) == -dir)
+ {
+ /* try not to look at the stem, as looking at a beamed
+ note may trigger beam positioning prematurely.
+
+ This happens with dotted rests, which need Y
+ positioning to compute X-positioning.
+ */
+ Grob *head = Note_column::first_head (notes[i]);
+ if (head)
+ notedim.unite (head->extent (common, Y_AXIS));
+ else
+ programming_error ("Note_column without first_head()");
+ }
+ else
+ notedim.unite (notes[i]->extent (common, Y_AXIS));
+ }
Real y = dir * max (0.0,
-dir * restdim[-dir] + dir * notedim[dir] + minimum_dist);
Tie_formatting_problem::Tie_formatting_problem ()
{
x_refpoint_ = 0;
+ use_horizontal_spacing_ = true;
}
Tie_formatting_problem::~Tie_formatting_problem ()
{
if (Stem::is_normal_stem (stem))
{
-
Interval x;
x.add_point (stem->relative_coordinate (x_refpoint_, X_AXIS));
x.widen (staff_space / 20); // ugh.
Interval y;
- Real stem_end_position =
- Stem::is_cross_staff (stem)
- ? get_grob_direction (stem) * infinity_f
- : Stem::stem_end_position (stem) * staff_space * .5;
+ Real stem_end_position = 0.0;
+ if (Stem::is_cross_staff (stem))
+ stem_end_position = get_grob_direction (stem) * infinity_f;
+ else
+ {
+ if (use_horizontal_spacing_ || !Stem::get_beam (stem))
+ stem_end_position = Stem::stem_end_position (stem) * staff_space * .5;
+ else
+ stem_end_position = Stem::note_head_positions (stem)[get_grob_direction (stem)]
+ * staff_space * .5;
+ }
+
y.add_point (stem_end_position);
Direction stemdir = get_grob_direction (stem);
{
if (semi_ties.empty ())
return;
-
+
+ use_horizontal_spacing_ = false;
details_.from_grob (semi_ties[0]);
vector<Item*> heads;
##
## todo: this also depends on .tfm, FIXME.
-$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log
- $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) $<
+$(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc $(outdir)/%.dep: $(outdir)/%.log
+ $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) $<
local-clean:
rm -f mfplain.mem mfplain.log
(let*
((th (chain-assoc-get 'thickness props 0.1))
(x (car dest))
- (y (cdr dest)))
+ (y (cdr dest))
+ (s (ly:make-stencil
+ `(draw-line
+ ,th
+ 0 0
+ ,x ,y)
- (ly:make-stencil
- `(draw-line
- ,th
- 0 0
- ,x ,y)
+ (cons (min x 0) (max x 0))
+ (cons (min y 0) (max y 0)))))
- (cons (min x 0) (min y 0))
- (cons (max x 0) (max y 0)))))
+ s))
(define-builtin-markup-command (draw-circle layout props radius thickness fill)
(number? number? boolean?)
(define (write-preamble paper load-fonts? port)
(define (load-font-via-GS font-name-filename)
- (define (ps-load-file name)
- (format
- (if (string? name)
- "(~a) (r) file .loadfont\n"
- "% cannot find font file: ~a\n")
- name))
+ (define (ps-load-file file-name)
+ (if (string? file-name)
+ (if (string-contains file-name (ly:get-option 'datadir))
+ (begin
+ (set! file-name (ly:string-substitute (ly:get-option 'datadir) "" file-name))
+ (format "lilypond-datadir (~a) concatstrings (r) file .loadfont" file-name))
+ (format "(~a) (r) file .loadfont\n" file-name))
+ (format "% cannot find font file: ~a\n" file-name)))
(let* ((font (car font-name-filename))
(name (cadr font-name-filename))
pfas))
(display "%%BeginProlog\n" port)
+
+ (format port
+ "/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifelse"
+ (ly:get-option 'datadir))
+
(if load-fonts?
(for-each
(lambda (f)
(backend ps "which backend to use by default; Options: eps, ps [default], scm, svg, tex, texstr)")
(check-internal-types #f "check every property assignment for types")
(clip-systems #f "Generate cut-out snippets of a score")
+ (datadir #f "LilyPond prefix for data files (Readonly).")
(debug-gc #f "dump memory debugging statistics")
(debug-gc-assert-parsed-dead #f "for memory debugging:
ensure that all refs to parsed objects are dead. This is an internal option, and is switched on automatically for -ddebug-gc.")
(page-width 100)
(page-height 100)
(rename-page-1 #f)
- (be-verbose #f)
+ (be-verbose (ly:get-option 'verbose))
(pixmap-format 'png16m)
(anti-alias-factor 1))
~a\
-dGraphicsAlphaBits=4\
-dTextAlphaBits=4\
- -q\
-dNOPAUSE\
-sDEVICE=~a\
-sOutputFile=~S\