From 3d521d67a12ea209ced879d8a8647b011172e02c Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:07:03 +0000 Subject: [PATCH] lilypond-1.5.43 --- GNUmakefile.in | 18 +++++++++++++++--- buildscripts/lilypond-profile.sh | 2 +- buildscripts/mutopia-index.py | 9 +++++---- input/baerenreiter-sarabande.ly | 31 +++++++++++++++++++++++-------- lily/afm.cc | 11 ++++++++--- lily/include/dimensions.hh | 20 +++++++++++++++++--- lily/tfm.cc | 8 +++++++- make/lilypond-vars.make | 5 +---- make/mutopia-rules.make | 7 +++++++ make/mutopia-targets.make | 2 +- make/mutopia-vars.make | 1 + ps/lilyponddefs.ps | 13 ++++++++++++- scm/pdf.scm | 8 ++------ scm/pdftex.scm | 13 +++++-------- scm/ps.scm | 12 ++++++------ scm/sketch.scm | 3 --- scm/tex.scm | 12 +++++------- tex/lily-ps-defs.tex | 10 ++++++++-- 18 files changed, 124 insertions(+), 61 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index 35a549cd8c..d3ef1f9757 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -35,6 +35,7 @@ footify: $(footify) --index=./ `$(FIND) . -maxdepth 1 -name '*.html' -print` $(footify-all-command) + fonts: $(MAKE) -C $(depth)/mf @@ -60,21 +61,24 @@ TOP_HTMLS = index.html short-examples.html long-examples.html index: web-doc -short-examples: +short-examples: pfa-fonts $(MAKE) out=www -C input WWW $(PYTHON) $(buildscript-dir)/mutopia-index.py -o short-examples.html input/ -long-examples: +long-examples: pfa-fonts $(MAKE) out=www -C mutopia WWW $(PYTHON) $(buildscript-dir)/mutopia-index.py -o long-examples.html mutopia/ +pfa-fonts: + $(MAKE) MAKE_PFA_FILES=1 -C mf + lily: lily/$(outdir)/lilypond lily/$(outdir)/lilypond: $(MAKE) -C lily -local-web: fonts lily $(TOP_HTMLS:%.html=%) footify do-top-doc top-web +local-web: fontpaths fonts lily $(TOP_HTMLS:%.html=%) footify do-top-doc top-web top-web: rm -f `find . -name \*.html~ -print` @@ -109,3 +113,11 @@ top-WWW-clean: WWW: + +fontpaths: + -ln -s $(depth)/mf/out dvips + -mkdir -p fonts + -ln -s ../$(depth)/mf fonts/source + -ln -s ../$(depth)/mf/out fonts/afm + -ln -s ../$(depth)/mf/out fonts/tfm + -ln -s ../$(depth)/mf/out fonts/type1 diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index 8539cd36d6..11464f2ba5 100644 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -23,7 +23,7 @@ GS_LIB="$datadir/ps:"${GS_LIB:=""} # Add the installation directory to the teTeX system tree, # see Documentation/misc/fontinstallation -TEXMF="{$DATADIR,"`kpsexpand \\$TEXMF`"}" +TEXMF="{$datadir,"`kpsexpand \\$TEXMF`"}" # LILYPONDPREFIX="$datadir" # export LILYPONDPREFIX diff --git a/buildscripts/mutopia-index.py b/buildscripts/mutopia-index.py index 4bbc0bb2c5..2e5d3b5e35 100644 --- a/buildscripts/mutopia-index.py +++ b/buildscripts/mutopia-index.py @@ -3,7 +3,6 @@ name = 'mutopia-index' -# find.py -- deprecated in python 2.0 import fnmatch import os @@ -57,9 +56,10 @@ headertext= r""" These files are also included in the distribution. The output is completely generated by LilyPond, without any touch up by humans. -

The PostScript files were generated using TeX and dvips. The pictures -are 90dpi anti-aliased snapshots of the printed output. The images -are in PNG format, and should be viewable with any current browser. +

The PostScript files were generated using TeX and dvips at 600 dpi. +The pictures are 90dpi anti-aliased snapshots of the printed output. +The images are in PNG format, and should be viewable with any current +browser.

If you want a better impression of the appearance, do print out one of the postscript files. @@ -166,6 +166,7 @@ def gen_list(inputs, filename): if not file_exist_b (f): break list_item(f, 'See a picture of page %d' % pageno, 'png') + list_item(base + '.pdf', 'Print ', 'PDF') list_item(base + '.ps.gz', 'Print ', 'gzipped PostScript') list_item(base + '.midi', 'Listen', 'MIDI') list.write ("\n"); diff --git a/input/baerenreiter-sarabande.ly b/input/baerenreiter-sarabande.ly index 175735eef1..1a529b1a9c 100644 --- a/input/baerenreiter-sarabande.ly +++ b/input/baerenreiter-sarabande.ly @@ -19,7 +19,7 @@ measure 25, we get back the linebreaking of Baerenreiter. This file used to show spacing weaknesses. Now it shows weaknesses in -beam and slur handling. +slur handling. Note that the Barenreiter edition contains an engraving mistake. The second line begins with measure 6 (but prints 5). @@ -133,16 +133,31 @@ sarabandeCelloStaff = \context Staff < \sarabandeCelloScripts > -\score{ - \sarabandeCelloStaff - \paper{ - indent = 7. \mm - linewidth = 183.5 \mm +% size perversions +smallerPaper = \paper { + \translator { \StaffContext + fontSize = #-1 + StaffSymbol \override #'staff-space = #0.8 + } \translator { \ScoreContext - %% SpacingSpanner \override #'maximum-duration-for-spacing = #(make-moment 1 16) + SpacingSpanner \override #'spacing-increment = #0.96 + } + + indent = 5.6 \mm + linewidth = 146.8 \mm +} + +baerPaper = \paper { + indent = 7. \mm + linewidth =183.5 \mm +} - }} +\score{ + \sarabandeCelloStaff + \paper{ + \baerPaper + } \midi{ \tempo 4 = 40 } \header{ opus= "" diff --git a/lily/afm.cc b/lily/afm.cc index ddca303bc0..1c760a1813 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -9,6 +9,7 @@ #include "afm.hh" #include "warn.hh" #include "molecule.hh" +#include "dimensions.hh" Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi) { @@ -129,12 +130,16 @@ read_afm_file (String nm) return Adobe_font_metric::make_afm (fi, cs); } - + +/* + actually, AFMs will be printers point, usually, but our .py script dumps + real points. + */ Box afm_bbox_to_box (AFM_BBox bb) { - return Box (Interval (bb.llx, bb.urx)* (1/1000.0), - Interval (bb.lly, bb.ury)* (1/1000.0)); + return Box (Interval (bb.llx, bb.urx)* (1/1000.0) PT, + Interval (bb.lly, bb.ury)* (1/1000.0) PT); } diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh index 8fe9487fcd..66a9d0868d 100644 --- a/lily/include/dimensions.hh +++ b/lily/include/dimensions.hh @@ -4,14 +4,17 @@ #include "real.hh" class String; + const Real INCH_TO_PT=72.270; -const Real CM_TO_PT=INCH_TO_PT/2.54; -const Real MM_TO_PT=CM_TO_PT/10; +const Real CM_TO_PT=(INCH_TO_PT/2.54); +const Real MM_TO_PT=(CM_TO_PT/10); const Real PT_TO_PT =1.0; const Real INCH_TO_BP = 72; -const Real BIGPOINT_TO_POINT = INCH_TO_PT/ INCH_TO_BP; +const Real BIGPOINT_TO_POINT = (INCH_TO_PT/ INCH_TO_BP); const Real CHAR_TO_PT =1.0; +const Real PT_TO_MM = (1.0/MM_TO_PT); +#ifdef POINTS #define PT *PT_TO_PT #define MM *MM_TO_PT @@ -20,6 +23,17 @@ const Real CHAR_TO_PT =1.0; #define BIGPOINT *BIGPOINT_TO_POINT #define CHAR *CHAR_TO_PT +#else // mm + +#define PT *PT_TO_PT *PT_TO_MM +#define MM *MM_TO_PT *PT_TO_MM +#define CM *CM_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 + +#endif + String print_dimen (Real); #endif // DIMENSIONS_HH diff --git a/lily/tfm.cc b/lily/tfm.cc index 01b26efaba..89a09a5011 100644 --- a/lily/tfm.cc +++ b/lily/tfm.cc @@ -14,6 +14,7 @@ #include "string-convert.hh" #include "debug.hh" #include "warn.hh" +#include "dimensions.hh" Box Tex_font_char_metric::dimensions () const @@ -26,7 +27,12 @@ Tex_font_char_metric::dimensions () const } Real d = -depth_; - return Box (Interval (0, width_),Interval (d ? height_)); + + Real point_constant = 1 PT; + + return Box (Interval (0, width_*point_constant ), + Interval ((d ? height_)*point_constant)); } Tex_font_char_metric::Tex_font_char_metric () diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 9891207728..b7ddebfa75 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -3,11 +3,8 @@ export PATH:=$(topdir)/lily/out:$(topdir)/buildscripts/out:$(PATH) +export TEXMF:={$(topdir),$(shell kpsexpand \$$TEXMF)} -export MFINPUTS:=$(topdir)/mf/:$(MFINPUTS):: -export TEXINPUTS:=$(topdir)/mf/out/:$(topdir)/tex/:$(topdir)/ps/:$(TEXINPUTS):$(pwd):: -export LILYINCLUDE:=$(topdir)/ps:$(topdir)/scm:$(topdir)/ly:$(topdir)/mf/out::$(TEX_TFMDIR):$(LILYINCLUDE) -export TFMFONTS:=$(topdir)/mf/out: export extra_mem_top=1000000 export extra_mem_bottom=1000000 export pool_size=250000 diff --git a/make/mutopia-rules.make b/make/mutopia-rules.make index 08445758d5..81b6b57fd4 100644 --- a/make/mutopia-rules.make +++ b/make/mutopia-rules.make @@ -33,6 +33,13 @@ $(outdir)/%.dvi: $(outdir)/%.ly $(outdir)/%.dvi: %.ly $(PYTHON) $(LY2DVI) --output=$@ --dependencies $< + +$(outdir)/%.pdf: $(outdir)/%.dvi + dvips -u lilypond.map -o $@.pdfps -Ppdf $< + ps2pdf $@.pdfps $@ + + $(PYTHON) $(LY2DVI) --output=$@ --dependencies $< + $(outdir)-$(PAPERSIZE)/%.dvi: %.ly $(PYTHON) $(LY2DVI) --output=$@ --dependencies --set=papersize=$(PAPERSIZE) $< diff --git a/make/mutopia-targets.make b/make/mutopia-targets.make index 3504259fb5..54cd429bb5 100644 --- a/make/mutopia-targets.make +++ b/make/mutopia-targets.make @@ -12,7 +12,7 @@ all: $(OUT_FILES) # we want dvi_examples as well, because they get thrown away otherwise # incurring another costly lilypond run. -local-WWW: $(ly_examples) $(dvi_examples) $(ps_examples) $(png_examples) +local-WWW: $(ly_examples) $(pdf_examples) $(ps_examples) $(png_examples) tar: mkdir -p $(outdir)/$(tarball) diff --git a/make/mutopia-vars.make b/make/mutopia-vars.make index 2132fab757..84bc7bf849 100644 --- a/make/mutopia-vars.make +++ b/make/mutopia-vars.make @@ -14,6 +14,7 @@ ly_examples=$(addprefix $(outdir)/, $(addsuffix .ly.txt, $(examples))) all_examples=$(examples) dvi_examples=$(addprefix $(outdir)/, $(addsuffix .dvi, $(all_examples))) ps_examples=$(addprefix $(outdir)/, $(addsuffix .ps.gz, $(all_examples))) +pdf_examples=$(addprefix $(outdir)/, $(addsuffix .pdf, $(all_examples))) gif_examples=$(addprefix $(outdir)/, $(addsuffix .gif, $(all_examples))) png_examples=$(addprefix $(outdir)/, $(addsuffix .png, $(all_examples))) diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 220b6cf2ea..453135ab52 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -12,7 +12,18 @@ % FIXME: why isn't this set (by default) by lily? % /text-height lilypondpapertextheight def -/output-scale lilypondpaperoutputscale def +/lily-output-units 2.83464 def %% milimeter +% /lily-output-units 0.996264 def %% true points. + +/output-scale +lilypondpaperoutputscale lily-output-units mul +def + +/set-ps-scale-to-lily-scale +{ +output-scale output-scale scale +} bind def + /paper-size { lilypondpaperpapersize } bind def % FIXME diff --git a/scm/pdf.scm b/scm/pdf.scm index 50c674e88f..5f022652c7 100644 --- a/scm/pdf.scm +++ b/scm/pdf.scm @@ -151,10 +151,6 @@ (string-append "(\\" (inexact->string i 8) ") " s " " )) - (define (invoke-dim1 s d) - (string-append - (ly-number->string (* d (/ 72.27 72))) " " s )) - (define (placebox x y s) "") (define (bezier-sandwich l thick) @@ -249,7 +245,7 @@ (define font-load-command ,font-load-command) (define header ,header) (define invoke-char ,invoke-char) - (define invoke-dim1 ,invoke-dim1) + (define placebox ,placebox) (define repeat-slash ,repeat-slash) (define select-font ,select-font) @@ -285,4 +281,4 @@ ; Local Variables: ; scheme-program-name: "guile" -; End: \ No newline at end of file +; End: diff --git a/scm/pdftex.scm b/scm/pdftex.scm index 736cf9bcbf..6fccc24420 100644 --- a/scm/pdftex.scm +++ b/scm/pdftex.scm @@ -7,6 +7,9 @@ ;;; Han-Wen Nienhuys ;;; Stephen Peters + +;; TODO: port this to the new module framework. + (define (pdftex-scm action-name) (define (unknown) "%\n\\unknown%\n") @@ -107,12 +110,6 @@ (string-append "\n\\" s "{" (inexact->string i 10) "}" )) - (define (invoke-dim1 s d) - (string-append - "\n\\" s "{" (number->dim d) "}")) - (define (pt->sp x) - (* 65536 x)) - ;; ;; need to do something to make this really safe. ;; @@ -203,7 +200,7 @@ (define ez-ball ,ez-ball) (define header ,header) (define invoke-char ,invoke-char) - (define invoke-dim1 ,invoke-dim1) + (define placebox ,placebox) (define select-font ,select-font) (define start-line ,start-line) @@ -231,7 +228,7 @@ ((eq? action-name 'lily-def) lily-def) ((eq? action-name 'header) header) ((eq? action-name 'invoke-char) invoke-char) - ((eq? action-name 'invoke-dim1) invoke-dim1) + ((eq? action-name 'placebox) placebox) ((eq? action-name 'bezier-sandwich) bezier-sandwich) ((eq? action-name 'start-line) start-line) diff --git a/scm/ps.scm b/scm/ps.scm index e002e8b23c..8ba55fba03 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -129,11 +129,11 @@ (define (dashed-line thick on off dx dy) (string-append - (ly-number->string (* dx (/ 72 72.27))) + (ly-number->string dx) " " (ly-number->string dy) " " - (ly-number->string (* thick (/ 72 72.27))) + (ly-number->string thick) " [ " (ly-number->string on) " " @@ -192,9 +192,6 @@ (string-append "(\\" (inexact->string i 8) ") " s " " )) -(define (invoke-dim1 s d) - (string-append - (ly-number->string (* d (/ 72.27 72))) " " s )) (define (placebox x y s) (string-append @@ -222,12 +219,15 @@ " draw_dot"))) ; TODO: use HEIGHT argument + + (define (start-line height) (string-append "\n" (ly-number->string height) " start-line { -lilypondpaperoutputscale lilypondpaperoutputscale scale +set-ps-scale-to-lily-scale + ")) (define (stem breapth width depth height) diff --git a/scm/sketch.scm b/scm/sketch.scm index 30ec4a4ce0..a76f79d5c3 100644 --- a/scm/sketch.scm +++ b/scm/sketch.scm @@ -234,9 +234,6 @@ layer('Layer 1',1,1,0,0,(0,0,0)) (define (invoke-char s i) "") -(define (invoke-dim1 s d) - (string-append - (ly-number->string (* d (/ 72.27 72))) " " s )) (define (bezier-sandwich x y l thick) (apply diff --git a/scm/tex.scm b/scm/tex.scm index 0ca8f300e9..79f6886422 100644 --- a/scm/tex.scm +++ b/scm/tex.scm @@ -175,7 +175,11 @@ (ly-gulp-file "music-drawing-routines.ps")) (if (defined? 'ps-testing) "/testing true def%\n" "") "}" - "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale pt\\turnOnPostScript")) + "\\input lilyponddefs \\outputscale=\\lilypondpaperoutputscale " + ;; "pt" + "mm" + + "\\turnOnPostScript")) ;; Note: this string must match the string in ly2dvi.py!!! (define (header creator generate) @@ -186,12 +190,6 @@ (string-append "\n\\" s "{" (inexact->string i 10) "}" )) -(define (invoke-dim1 s d) - (string-append - "\n\\" s "{" (number->dim d) "}")) -(define (pt->sp x) - (* 65536 x)) - ;; ;; need to do something to make this really safe. ;; diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index 0172a73d18..30e8d1b992 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -11,13 +11,19 @@ % \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}} \def\lilySpace{ } + +% for mm: 72.27/25.4 +\def\scaletounit{ 2.845276 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 \def\embeddedps##1{% \special{ps\string: @beginspecial @setspecial - \lilypondpaperoutputscale\lilySpace - \lilypondpaperoutputscale\lilySpace + \lilypondpaperoutputscale\lilySpace\scaletounit + \lilypondpaperoutputscale\lilySpace\scaletounit % FUCKING REDHAT XDVI -- ARG! skeel ##1 @endspecial}% } -- 2.39.5