From 7c4b190c428073b0653ddecdbf8c1a9c1e8bc5c4 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 9 May 2001 20:23:22 +0200 Subject: [PATCH] release: 1.3.154 ============ * More brace bugfixes. * Revert: simplified TFM and PK logic in ly_init_kpath (). Find feta fonts in datadir (eg /usr/share/) again, rely on environment in the other tools. * Add .pk font caching for ly2dvi. pk files resulting from running dvips are stored in outdir. 1.3.153.j --- CHANGES | 17 +++- NEWS | 14 ++-- VERSION | 4 +- buildscripts/lilypond-login.sh | 2 + buildscripts/lilypond-profile.sh | 3 +- input/GNUmakefile | 2 +- input/trip.ly | 5 +- input/twinkle.ly | 2 +- lily/all-font-metrics.cc | 4 +- lily/grob.cc | 2 - lily/include/kpath.hh | 2 +- lily/kpath.cc | 81 ++++++++++++++++---- lily/lexer.ll | 2 + make/out/lilypond.lsm | 8 +- make/out/redhat.spec | 4 +- make/out/suse.spec | 4 +- mf/feta-beugel.mf | 19 +++-- mutopia/E.Satie/petite-ouverture-a-danser.ly | 11 +-- scm/font.scm | 8 +- scripts/ly2dvi.py | 39 ++++++++-- 20 files changed, 168 insertions(+), 65 deletions(-) diff --git a/CHANGES b/CHANGES index 109e223fd1..712cfb3ae9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,13 +1,24 @@ -1.3.153.jcn2 +1.3.153.hwn1 ============ -* PO updates. +* More brace bugfixes. + +* Revert: simplified TFM and PK logic in ly_init_kpath (). Find feta +fonts in datadir (eg /usr/share/) again, rely on environment in the +other tools. + +* Add .pk font caching for ly2dvi. pk files resulting from running +dvips are stored in outdir. -1.3.153.jcn1 +1.3.153.jcn2 ============ * Cleaned-up braces font selection code. +* PO updates. + +* petite-ouverture-a-danser.ly bugfix, twinkle.ly bugfix + 1.3.153 ======= diff --git a/NEWS b/NEWS index 481c8bf7c0..8c743166b0 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ New features in 1.4 DESIGN +cocentric + * More pervasive GUILE integration resulting in improved design and implementation. LilyPond is smaller, cleaner, more flexible, etc. @@ -56,21 +58,21 @@ shapes, Medieval clefs, custodes. * Easy-play note heads +* ASCIIScript: ASCII-art output -MIDI +* Improved standalone postscript layout. -* dynamics, tempo changes in the MIDI output +IMPORT/EXPORT -MISC +* dynamics, tempo changes in the MIDI output * Finale (.etf), PMX, Musedata and Mup import tools. -* Mutopia ports collection: easy accessible music archive. -* ASCIIScript: ASCII-art output +MISCELLANEOUS -* Improved standalone postscript layout. +* Mutopia ports collection: easily accessible music archive. * Translations into Japanese, French and Russian diff --git a/VERSION b/VERSION index a0c4ddd6fa..cdf1553b9d 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=153 -MY_PATCH_LEVEL=jcn2 +PATCH_LEVEL=154 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/buildscripts/lilypond-login.sh b/buildscripts/lilypond-login.sh index e7913d0621..b22b28146d 100755 --- a/buildscripts/lilypond-login.sh +++ b/buildscripts/lilypond-login.sh @@ -10,6 +10,8 @@ set datadir="@datadir@" setenv GS_FONTPATH "$datadir/afm:@datadir@/pfa:$GS_FONTPATH" setenv GS_LIB "$datadir/ps:$GS_LIB" +setenv LILYPONDPREFIX "$datadir" + # bit silly. for ly2dvi, overrules compiled-in datadir... # setenv LILYPONDPREFIX "@datadir@" diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 576a30b9fe..bde5816bdd 100755 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -27,8 +27,9 @@ GS_LIB="$datadir/ps" MFINPUTS="$datadir/mf:"${MFINPUTS:=":"} TEXINPUTS="$datadir/tex:$datadir/ps:"${TEXINPUTS:=":"} TFMFONTS="$datadir/tfm:"${TFMFONTS:=":"} +LILYPONDPREFIX="$datadir" -export MFINPUTS TEXINPUTS TFMFONTS GS_LIB GS_FONTPATH +export MFINPUTS TEXINPUTS TFMFONTS GS_LIB GS_FONTPATH LILYPONDPREFIX diff --git a/input/GNUmakefile b/input/GNUmakefile index c5e72463fa..ee4be08dc7 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -4,7 +4,7 @@ depth = .. SUBDIRS=bugs test regression tutorial no-notation ascii-art -examples=trip star-spangled-banner paddy scarlatti-test +examples=trip star-spangled-banner paddy twinkle flexamples= LOCALSTEPMAKE_TEMPLATES=ly mutopia diff --git a/input/trip.ly b/input/trip.ly index ec69cb2771..11a30811d3 100644 --- a/input/trip.ly +++ b/input/trip.ly @@ -1,6 +1,9 @@ \header { - title = "Trip" + title = "Trip test" + subtitle = "Make life very difficult for lilypond" copyright = "public domain" + + footer ="This file tests as much features of lily as possible." } diff --git a/input/twinkle.ly b/input/twinkle.ly index 24f8e47a5f..d801410f40 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -25,7 +25,7 @@ Tested Features: lyrics, interleaving lyrics and staffs, repeats, melody = \notes \relative c'' { \clef violin - \property Staff.instrument = "alto sax" + \property Staff.midiInstrument = "alto sax" c4 c | g' g | a a | g g | f f | e e | d d8.( e16 | )c2 | diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 72003d663e..6d728efd0a 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -123,8 +123,8 @@ All_font_metrics::find_tfm (String name) if (path.empty_b ()) { - char * p = ly_find_tfm (name.ch_C ()); - if (p) + String p = ly_find_tfm (name.ch_C ()); + if (p.length_i ()) path = p; } diff --git a/lily/grob.cc b/lily/grob.cc index 98f0601722..db504faa81 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -295,8 +295,6 @@ Grob::get_uncached_molecule ()const m = unsmob_molecule (mol); } - - /* transparent retains dimensions of element. diff --git a/lily/include/kpath.hh b/lily/include/kpath.hh index e6b0f54398..accc1f610a 100644 --- a/lily/include/kpath.hh +++ b/lily/include/kpath.hh @@ -13,7 +13,7 @@ source file of the GNU LilyPond music typesetter char * ly_find_afm (char const * name); -char * ly_find_tfm (char const * name); +String ly_find_tfm (char const * name); void ly_init_kpath (char *av0); diff --git a/lily/kpath.cc b/lily/kpath.cc index 56801ff292..f42c5fd1f6 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -10,7 +10,6 @@ #include #include "config.h" -#include "string.hh" #define popen REALLYUGLYKLUDGE #define pclose ANOTHERREALLYUGLYKLUDGE @@ -22,6 +21,9 @@ extern "C" { } #endif +#include "file-path.hh" +#include "string.hh" +#include "main.hh" #include "kpath.hh" #include "lily-version.hh" @@ -35,13 +37,18 @@ ly_find_afm (char const * name) return 0; } -char * +String ly_find_tfm (char const * name) { + String p = global_path.find (String (name) + ".tfm"); + + if (p.length_i ()) + return p; + #if (KPATHSEA && HAVE_KPSE_FIND_FILE) return kpse_find_file (name, kpse_tfm_format, true); #endif - return 0; + return ""; } @@ -49,8 +56,52 @@ void ly_init_kpath (char *av0) { #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H + /* + We take two pronged approach to tfms: + + * the lilypond tfms (feta*.tfm) are found through our own routines. + + * the TeX tfms are found through vanilla kpathsea. + + (* other TFMs are not found, i.e. don't use them. ) + + PRO: + + - TFM and AFM checksums always match in Lily. + + - less hassle, no kpathsea spaghetti + + CON: + + - feta PK files are often recreated, locally + Solution: cache PK files locally? + + - need env. vars to make sure that TeX finds the TFMs + + - Outdated PK (TFM?) font files are not automatically removed, + since VERSION is not part of the standard location. + + + ALTERNATIVE + + we have tried to come up with schemes that leave this kind of work + to kpathsea with objective of fixing the CONs, but miserably + failed. TeX installations and kpathsea itself form a buggy, + inconsistent, and unorderly mess. + + */ + + /* + initialize kpathsea + */ + kpse_set_program_name (av0, NULL); + kpse_maketex_option ("tfm", TRUE); + +#if 0 + /* + Remove the setting for TFMFONTS if we have kpathsea, because kpathsea can find TFM fonts anyway. @@ -66,20 +117,13 @@ ly_init_kpath (char *av0) The advantage is that the PK font will also be generated under /var/texmf/fonts, reducing clutter and compilation time. - - */ + + */ + #ifndef __CYGWIN__ /* mktextfm/mktexpk does not work on windows */ -#ifndef DEBIAN unsetenv ("TFMFONTS"); -#endif #endif - /* - initialize kpathsea - */ - kpse_set_program_name (av0, NULL); - kpse_maketex_option ("tfm", TRUE); - #ifdef DEBIAN String my_tfm = "$VARTEXFONTS/tfm/public/lilypond"; #else @@ -87,15 +131,20 @@ ly_init_kpath (char *av0) my_tfm += version_str () + "/"; #endif - char * mypath = kpse_expand ((my_tfm + ":").ch_C ()); -#ifndef DEBIAN +#ifdef DEBIAN + char * mypath = strdup ((my_tfm + ":").ch_C()); + kpse_format_info[kpse_tfm_format].client_path = mypath; +#else + char * mypath = kpse_expand (my_tfm.ch_C ()); + String prog = "mktextfm --destdir "; prog += mypath; kpse_format_info[kpse_tfm_format].program = strdup (prog.ch_C ()); #endif - kpse_format_info[kpse_tfm_format].client_path = mypath; #endif +#endif + } diff --git a/lily/lexer.ll b/lily/lexer.ll index f9a545082f..a875cea59e 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -25,6 +25,8 @@ #include #include #include /* gcc 3.0 */ +#include + #include "score.hh" #include "lily-guile.hh" diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 74c8d1c390..ec35a366e4 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.153 -Entered-date: 08MAY01 +Version: 1.3.154 +Entered-date: 09MAY01 Description: @BLURB@ Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.153.tar.gz + 1000k lilypond-1.3.154.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.153.tar.gz + 1000k lilypond-1.3.154.tar.gz Copying-policy: GPL End diff --git a/make/out/redhat.spec b/make/out/redhat.spec index 6da1c2ef14..4024db266c 100644 --- a/make/out/redhat.spec +++ b/make/out/redhat.spec @@ -1,11 +1,11 @@ %define info yes Name: lilypond -Version: 1.3.153 +Version: 1.3.154 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.153.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.154.tar.gz Summary: Create and print music notation URL: http://www.cs.uu.nl/~hanwen/lilypond BuildRoot: /tmp/lilypond-install diff --git a/make/out/suse.spec b/make/out/suse.spec index 628690af07..64f3f6c7fb 100644 --- a/make/out/suse.spec +++ b/make/out/suse.spec @@ -14,11 +14,11 @@ Distribution: SuSE Linux 7.0 (i386) Name: lilypond -Version: 1.3.153 +Version: 1.3.154 Release: 2 Copyright: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.153.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.154.tar.gz # music notation software for.. ? Summary: A program for printing sheet music. URL: http://www.lilypond.org/ diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index 24a7168156..608ecd5b4f 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -50,7 +50,11 @@ enddef; % l is the increment. -l := 0.2pt#; +save stafflinethickness; +save increment; + +stafflinethickness := 0.5pt#; +increment := 0.5pt#; y := 10pt#; @@ -60,18 +64,21 @@ for i := 0 step 1 until font_count: %% We can't store more than 64 (65?) height dimensions in a TFM %% file, so we make small files. - for j := 0 step 1 until 65: + for j := 0 step 1 until 63: % message "l: "&decimal l; % note: define_pixels (x) multiplies x by hppp, % must never get bigger than infinity - y := min (y + l / 2, infinity/hppp - 1); + y := min (y + increment, infinity/hppp - 1); + % x should be about one staff space, taking brace to have % default height of 3 staffs, this yields height / 3 / 4 - x := y / 12; + x := y / 15; % l should be about one stafflinethickness - l := x / 10; + + increment := x / 10; + stafflinethickness := min (0.5pt#, y/120 ); if i = font_count: - draw_brace (y, x, l); + draw_brace (y, x, stafflinethickness); fi endfor; endfor diff --git a/mutopia/E.Satie/petite-ouverture-a-danser.ly b/mutopia/E.Satie/petite-ouverture-a-danser.ly index 1a43a5a86a..9762bb376a 100644 --- a/mutopia/E.Satie/petite-ouverture-a-danser.ly +++ b/mutopia/E.Satie/petite-ouverture-a-danser.ly @@ -39,7 +39,7 @@ global = \notes { i = \context Staff \notes\relative c''{ \context Voice=i - \stemUp + \voiceOne c8.( es16 bes4 ~ | )bes8 r c8.( bes16 | des4 c8. bes16 | c4 ~ ) c8 r | c4( f,8. as16 | bes4 ~ )bes8 r | f8.( es16 f4 | es )f | @@ -67,7 +67,7 @@ i = \context Staff \notes\relative c''{ ii = \context Staff \notes\relative c'{ \context Voice=ii - \stemDown + \voiceTwo r8 r | r r | r r | r r | r r | r r | @@ -85,9 +85,9 @@ ii = \context Staff \notes\relative c'{ r r | r r | r r | r r | - \translator Staff=bass\stemUp + \translator Staff=bass\voiceOne r r r | r - \translator Staff=treble\stemDown + \translator Staff=treble\voiceTwo r r | r r | r r | r r | @@ -132,7 +132,7 @@ lower = \context Staff \notes \relative c{ } \score { - \context GrandStaff < + \context GrandStaff < \context Staff = treble < \global \clef violin @@ -151,6 +151,7 @@ lower = \context Staff \notes \relative c{ \translator{ \OrchestralScoreContext } \translator{ \VoiceContext + Slur \override #'attachment = #'(stem . stem) autoBeamSettings \override #'(end 1 8 * *) = #(make-moment 1 4) autoBeamSettings \override #'(end 1 16 * *) = #(make-moment 1 4) } diff --git a/scm/font.scm b/scm/font.scm index 68da4ee251..39fcd09fbc 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -23,8 +23,12 @@ (else (ly-warning "unknown font field name")) ) )) - -;;;;;;;;; TODO TODO . (should not use filtering?) + + + +;; most of these routines have been reimplemented in C++ + +;; TODO TODO . (should not use filtering?) ;; this is bad, since we generate garbage every font-lookup. ;; otoh, if the qualifiers is narrow enough , we don't generate much garbage. diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index 1b37c3413a..017088970d 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -9,6 +9,12 @@ # +# +# 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 @@ -76,7 +82,9 @@ layout_fields = ['title', 'subtitle', 'subsubtitle', 'footer', 'head', 'meter', 'poet'] -# init to empty; values here take precedence over values in the file +# init to empty; values here take precedence over values in the file + +## TODO: change name. extra_init = { 'language' : [], 'latexheaders' : [], @@ -98,6 +106,9 @@ help_summary = _ ("Generate .dvi with LaTeX for LilyPond") include_path = ['.'] lily_p = 1 paper_p = 1 +cache_pks_p = 1 + +PK_PATTERN='feta.*\.[0-9]+pk' output_name = '' targets = { @@ -261,6 +272,9 @@ def help (): map (sys.stdout.write, ls) def setup_temp (): + """ + Create a temporary directory, and return its name. + """ global temp_dir if not keep_temp_dir_p: temp_dir = tempfile.mktemp (program_name) @@ -268,7 +282,8 @@ def setup_temp (): os.mkdir (temp_dir, 0777) except OSError: pass - os.chdir (temp_dir) + + return temp_dir def system (cmd, ignore_error = 0): @@ -719,10 +734,18 @@ if files and files[0] != '-': dep_prefix = 0 reldir = os.path.dirname (output_name) - (outdir, outbase) = os.path.split (abspath (output_name)) + (outdir, outbase) = os.path.split (abspath (output_name)) + if outdir != '.' and (track_dependencies_p or targets.keys ()): + mkdir_p (outdir, 0777) + setup_environment () - setup_temp () + tmpdir = setup_temp () + if cache_pks_p : + os.chdir (outdir) + cp_to_dir (PK_PATTERN, tmpdir) + + os.chdir (tmpdir) extra = extra_init @@ -759,9 +782,6 @@ if files and files[0] != '-': if targets.has_key ('PS'): run_dvips (outbase, extra) - if outdir != '.' and (track_dependencies_p or targets.keys ()): - mkdir_p (outdir, 0777) - # add DEP to targets? if track_dependencies_p: depfile = os.path.join (outdir, outbase + '.dep') @@ -780,7 +800,10 @@ if files and files[0] != '-': progress (_ ("%s output to `%s'...") % (i, outname)) 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 () -- 2.39.5