From: Jan Nieuwenhuizen Date: Fri, 29 Jun 2001 13:19:19 +0000 (+0200) Subject: patch::: 1.5.0.jcn1 X-Git-Tag: release/1.5.1~1 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=6a79487a4e2c5cc5b6593fac70dca0dd993e9257;p=lilypond.git patch::: 1.5.0.jcn1 1.5.0.jcn1 ========== * Added feature to ly2dvi to find feta pfa font files used in a postscript file to make printing of direct postscript a bit easier: lilypond -fps input/trip.ly cat $(ly2dvi -f trip.ps) trip.ps | lpr * Reincluded 1.4.3.jcn2. * Website fixes. * Ly2dvi now leaves .tex and .latex output if latex fails, and cleans the temp dir if anything fails. * Fixes for windows scripts. --- diff --git a/CHANGES b/CHANGES index 6fe737d185..8d267e71ae 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,21 @@ +1.5.0.jcn1 +========== + +* Added feature to ly2dvi to find feta pfa font files used in a +postscript file to make printing of direct postscript a bit easier: + + lilypond -fps input/trip.ly + cat $(ly2dvi -f trip.ps) trip.ps | lpr + +* Reincluded 1.4.3.jcn2. + +* Website fixes. + +* Ly2dvi now leaves .tex and .latex output if latex fails, and cleans +the temp dir if anything fails. + +* Fixes for windows scripts. + 1.5.0 ===== diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 59f14e5688..c9926959fc 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -499,8 +499,9 @@ Bugs that are not fault of LilyPond are documented here. Flex (2.5.4a-11) in unstable does not produce g++-3.0 compliant C++ code. To compile LilyPond with gcc-3.0 you may do: + @example - CC=gcc-3.0 CXX=g++-3.0 ./configure + CC=gcc-3.0 CXX=g++-3.0 ./configure --enable-config=gcc-3.0 make conf=gcc-3.0 -C lily out-gcc-3.0/lexer.cc patch -p1 < lexer-gcc-3.0.patch make conf=gcc-3.0 -C lily diff --git a/Documentation/windows/lily-gs.sh b/Documentation/windows/lily-gs.sh index 3a559ca47c..5ae3acbad1 100644 --- a/Documentation/windows/lily-gs.sh +++ b/Documentation/windows/lily-gs.sh @@ -3,7 +3,7 @@ gs550="/usr/windows/gstools/gs5.50" -gs650="/usr/windows/gs/gs6.50" +gs650="/usr/windows/gs/gs6.50/bin" gsview26="/usr/windows/gstools/gsview" gsview36="/usr/windows/Ghostgum/GSview" diff --git a/Documentation/windows/lily-miktex.sh b/Documentation/windows/lily-miktex.sh index c2c1480dd8..eb14f16791 100644 --- a/Documentation/windows/lily-miktex.sh +++ b/Documentation/windows/lily-miktex.sh @@ -10,7 +10,7 @@ reg="$(regtool -q get 'HKLM\Software\MiK\MiKTeX\CurrentVersion\MiKTeX\Install Ro b="$(cygpath -u ""$reg"")" # Where we installed it -c=texmf="/usr/windows/MiKTeX" +c="/usr/windows/MiKTeX" for i in "$a" "$b" "$c"; do if [ -d "$i" ]; then diff --git a/Documentation/windows/zlily-profile.sh b/Documentation/windows/zlily-profile.sh index 23832a5574..214219902f 100644 --- a/Documentation/windows/zlily-profile.sh +++ b/Documentation/windows/zlily-profile.sh @@ -22,6 +22,9 @@ WINDOWS_MFINPUTS="$(cygpath -apw ""$POSIX_MFINPUTS"")" export POSIX_TEXINPUTS POSIX_TFMFONTS POSIX_TFMFONTS export WINDOWS_TEXINPUTS WINDOWS_TFMFONTS WINDOWS_MFINPUTS +GS_FONTPATH="$WINDOWS_GS_FONTPATH" +GS_LIB="$WINDOWS_GS_LIB" + PATH="/usr/lilypond/bin:$PATH" PATH="@prefix@/bin:$PATH" diff --git a/VERSION b/VERSION index b76131dbcc..a05c82245b 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 PATCH_LEVEL=0 -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/beam.cc b/lily/beam.cc index 2f314fa422..8086632514 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -825,7 +825,7 @@ Beam::stem_beams (Grob*me,Item *here, Item *next, Item *prev, if (lhalfs) // generates warnings if not a = Lookup::beam (dydx, w + stem_w, thick); a.translate (Offset (-w, -w * dydx)); - //a.translate_axis (stem_w/2, X_AXIS); + a.translate_axis (-stem_w/2, X_AXIS); for (int j = 0; j < lhalfs; j++) { Molecule b (a); diff --git a/scm/tex.scm b/scm/tex.scm index c002a22b3f..fb5b8df7db 100644 --- a/scm/tex.scm +++ b/scm/tex.scm @@ -165,13 +165,7 @@ "}\\vss}\\interscoreline\n") (define (stop-last-line) "}\\vss}") - (define (xfilledbox breapth width depth height) - (string-append - "\\kern" (number->dim (- breapth)) - "\\vrule width " (number->dim (+ breapth width)) - "depth " (number->dim depth) - "height " (number->dim height) " ")) - + (define (filledbox breapth width depth height) (embedded-ps (string-append (numbers->string (list breapth width depth height)) diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 5ac6d69667..1e9a7329b3 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -65,6 +65,7 @@ import shutil import __main__ import operator import tempfile +import traceback datadir = '@datadir@' sys.path.append (datadir + '/python') @@ -353,6 +354,7 @@ option_definitions = [ ('', '', 'no-lily', _ ("don't run LilyPond")), ('', 'm', 'no-paper', _ ("produce MIDI output only")), (_ ("FILE"), 'o', 'output', _ ("write ouput to FILE")), + (_ ("FILE"), 'f', 'find-pfa', _ ("find pfa fonts used in FILE")), # why capital P? ('', 'P', 'postscript', _ ("generate PostScript output")), (_ ("KEY=VAL"), 's', 'set', _ ("change global setting KEY to VAL")), @@ -622,11 +624,39 @@ def generate_dependency_file (depfile, outname): df.write ('\n') df.close (); +def find_file_in_path (path, name): + for d in string.split (path, os.pathsep): + if name in os.listdir (d): + return os.path.join (d, name) + +# Added as functionality to ly2dvi, because ly2dvi may well need to do this +# in future too. +PS = '%!PS-Adobe' +def find_pfa_fonts (name): + s = open (name).read () + if s[:len (PS)] != PS: + # no ps header? + errorport.write (_( "error: ") + _ ("not a PostScript file: `%s\'" % name)) + errorport.write ('\n') + sys.exit (1) + here = 0 + m = re.match ('.*?/(feta[-a-z0-9]+) +findfont', s[here:], re.DOTALL) + pfa = [] + while m: + here = m.end (1) + pfa.append (m.group (1)) + m = re.match ('.*?/(feta[-a-z0-9]+) +findfont', s[here:], re.DOTALL) + return pfa + + (sh, long) = getopt_args (__main__.option_definitions) try: (options, files) = getopt.getopt(sys.argv[1:], sh, long) -except getopt.error, s: - errorport.write ("\nerror: getopt says `%s\'\n\n" % s) +except getopt.error, s: + errorport.write ('\n') + errorport.write (_( "error: ") + _ ("getopt says: `%s\'" % s)) + errorport.write ('\n') + errorport.write ('\n') help () sys.exit (2) @@ -639,6 +669,13 @@ for opt in options: elif o == '--help' or o == '-h': help () sys.exit (0) + elif o == '--find-pfa' or o == '-f': + fonts = map (lambda x: x + '.pfa', find_pfa_fonts (a)) + files = map (lambda x: + find_file_in_path (os.environ['GS_FONTPATH'], x), + fonts) + print string.join (files, ' ') + sys.exit (0) elif o == '--include' or o == '-I': include_path.append (a) elif o == '--postscript' or o == '-P': @@ -702,8 +739,10 @@ include_path = map (abspath, include_path) original_output = output_name + if files and files[0] != '-': + # Ugh, maybe make a setup () function files = map (lambda x: strip_extension (x, '.ly'), files) (outdir, outbase) = ('','') @@ -738,40 +777,44 @@ if files and files[0] != '-': os.chdir (tmpdir) - extra = extra_init - if lily_p: -## try: + try: run_lilypond (files, outbase, dep_prefix) -## # except: -## # TODO: friendly message about LilyPond setup/failing? -## # -## # TODO: lilypond should fail with different -## # error codes for: -## # - guile setup/startup failure -## # - font setup failure -## # - init.ly setup failure -## # - parse error in .ly -## # - unexpected: assert/core dump -## # targets = {} + except: + # TODO: friendly message about LilyPond setup/failing? + # + # TODO: lilypond should fail with different + # error codes for: + # - guile setup/startup failure + # - font setup failure + # - init.ly setup failure + # - parse error in .ly + # - unexpected: assert/core dump + targets = {} + traceback.print_exc () if targets.has_key ('DVI') or targets.has_key ('PS'): -# try: - run_latex (files, outbase, extra) + try: + run_latex (files, outbase, extra_init) # unless: add --tex, or --latex? del targets['TEX'] del targets['LATEX'] -# except Foobar: -# # TODO: friendly message about TeX/LaTeX setup, -# # trying to run tex/latex by hand -# if targets.has_key ('DVI'): -# del targets['DVI'] -# if targets.has_key ('PS'): -# del targets['PS'] - - # TODO: does dvips ever fail? + except: + # TODO: friendly message about TeX/LaTeX setup, + # trying to run tex/latex by hand + if targets.has_key ('DVI'): + del targets['DVI'] + if targets.has_key ('PS'): + del targets['PS'] + traceback.print_exc () + if targets.has_key ('PS'): - run_dvips (outbase, extra) + try: + run_dvips (outbase, extra_init) + except: + if targets.has_key ('PS'): + del targets['PS'] + traceback.print_exc () # add DEP to targets? if track_dependencies_p: @@ -780,6 +823,7 @@ if files and files[0] != '-': if os.path.isfile (depfile): progress (_ ("dependencies output to `%s'...") % depfile) + # Hmm, if this were a function, we could call it the except: clauses for i in targets.keys (): ext = string.lower (i) cp_to_dir ('.*\.%s$' % ext, outdir) @@ -799,7 +843,7 @@ if files and files[0] != '-': cleanup_temp () else: - # FIXME + # FIXME: read from stdin when files[0] = '-' help () errorport.write ("ly2dvi: " + _ ("error: ") + _ ("no files specified on command line.") + '\n') sys.exit (2)