]> git.donarmstrong.com Git - lilypond.git/commitdiff
* stepmake/aclocal.m4: use python-config for x-compile flags. Backport.
authorhanwen <hanwen>
Tue, 9 May 2006 07:55:57 +0000 (07:55 +0000)
committerhanwen <hanwen>
Tue, 9 May 2006 07:55:57 +0000 (07:55 +0000)
* scripts/lilypond-book.py (do_process_cmd): backport: create .png
for html files. Backport.

* scm/framework-ps.scm (write-preamble): use mac-font? even if
gs-font-load is set. Backport.

* mf/feta-bolletjes.mf: fix attachment of triangle head. backport.

* mf/GNUmakefile ($(NCSB_OTFS)): backport: gen and install OTF
files, new NCSB dir handling.  backport.

* lily/music-sequence.cc (maximum_length): backport robustness fix.

* input/tutorial/GNUmakefile (EXTRA_DIST_FILES): dist html file too.

* configure.in (LINK_GXX_STATICALLY): new --with-ncsb-dir. (backport)

* config.make.in: NCSB_SOURCE_FILES

* flower/include/std-vector.hh:
(default_compare): backport: use only 1 compare optor.

16 files changed:
ChangeLog
config.make.in
configure.in
flower/include/std-vector.hh
input/tutorial/GNUmakefile
lily/music-sequence.cc
mf/GNUmakefile
mf/feta-autometric.mf
mf/feta-bolletjes.mf
scm/define-grob-properties.scm
scm/framework-ps.scm
scm/lily-library.scm
scm/lily.scm
scm/output-texstr.scm
scripts/lilypond-book.py
stepmake/aclocal.m4

index 51ba5bca3c0ff778cb70f472251f9df14b23e480..421d57eb7bb1fae3d0d35ed0e10732c4760f9199 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2006-05-09  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * stepmake/aclocal.m4: use python-config for x-compile flags. Backport.
+
+       * scripts/lilypond-book.py (do_process_cmd): backport: create .png
+       for html files. Backport.
+
+       * scm/framework-ps.scm (write-preamble): use mac-font? even if
+       gs-font-load is set. Backport.
+
+       * mf/feta-bolletjes.mf: fix attachment of triangle head. backport.
+
+       * mf/GNUmakefile ($(NCSB_OTFS)): backport: gen and install OTF
+       files, new NCSB dir handling.  backport.
+
+       * lily/music-sequence.cc (maximum_length): backport robustness fix.
+
+       * input/tutorial/GNUmakefile (EXTRA_DIST_FILES): dist html file too.
+
+       * configure.in (LINK_GXX_STATICALLY): new --with-ncsb-dir. (backport)
+
+       * config.make.in: NCSB_SOURCE_FILES
+
+       * flower/include/std-vector.hh:
+       (default_compare): backport: use only 1 compare optor.
+
 2006-05-07  Graham Percival  <gpermus@gmail.com>
 
        * Documentation/user/ all: backport everything from 2.9 docs.
index 9da7a9d1ef546a8d1fc85dbd3c71766d56c72e5e..8ecbc70b9802130e1fcfcb82e02b97f8126807ce 100644 (file)
@@ -89,7 +89,7 @@ webdir = $(lilypond_docdir)/html
 vimdir = $(lilypond_datadir)/vim
 
 
-NCSB_DIR = @NCSB_DIR@
+NCSB_SOURCE_FILES = @NCSB_SOURCE_FILES@
 
 ################################################################
 ## PROGRAMS
@@ -107,6 +107,7 @@ DEFS = @DEFS@
 DOCUMENTATION = @DOCUMENTATION@
 DOTEXE = @DOTEXE@
 FIND = @FIND@
+FCMATCH = @FCMATCH@
 FLEX = @FLEX@
 FLEXLEXER_FILE = @FLEXLEXER_FILE@
 FONTFORGE = @FONTFORGE@
index 92e53a0515b60248432b49ee6b306dee702a322c..f577f24ac15d9b0f0e7212e21b5266fe83e1ac27 100644 (file)
@@ -37,7 +37,7 @@ AC_ARG_ENABLE(gui,
 NCSB_DIR=unknown
 AC_ARG_WITH(ncsb-dir,
 [  --with-ncsb-dir=DIR     location of Century Schoolbook fonts
-                            Default: detect with locate(1)],
+                            Default: detect with fc-match(1)],
     [NCSB_DIR=$withval])
 
 reloc_b=no
@@ -54,6 +54,38 @@ AC_SUBST(LINK_GXX_STATICALLY)
 # must come before any header checks
 STEPMAKE_COMPILE
 
+
+
+  
+AC_CHECK_PROG(FCMATCH, fc-match, fc-match)
+AC_MSG_CHECKING([New Century Schoolbook PFB files])
+AC_SUBST(NCSB_SOURCE_FILES)
+if test "$NCSB_DIR" != "" ;  then
+  NCSB_SOURCE_FILES=""
+  for f in c059013l c059016l c059033l c059036l; do
+    if test ! -f "$NCSB_DIR/$f.pfb"; then
+      AC_MSG_WARN($NCSB_DIR does not contain $f.pfb.)
+    else
+      NCSB_SOURCE_FILES="$NCSB_DIR/$f.pfb $NCSB_SOURCE_FILES"
+    fi
+  done
+else
+  if test "$FCMATCH" != ""; then
+    for style in Roman Italic "Bold Italic" Bold; do
+      NCSB_FILE=`$FCMATCH --verbose 'Century Schoolbook L:style=$style' | grep 'file:'`
+
+      NCSB_FILE=`echo $NCSB_FILE | sed 's/^.*"\(.*\)".*$/\1/g'`
+      NCSB_SOURCE_FILES="$NCSB_FILE $NCSB_SOURCE_FILES"
+    done
+  else
+    AC_MSG_RESULT(not found)
+    echo "Can't find Century Schoolbook files. Install FontConfig's fc-match,"
+    echo "or use --with-ncsb-dir"
+  fi
+fi
+AC_MSG_RESULT($NCSB_SOURCE_FILES)
+
+
 STEPMAKE_PYTHON(REQUIRED, 2.2)
 STEPMAKE_GCC(REQUIRED, 2.8)
 STEPMAKE_CXX(REQUIRED)
@@ -104,27 +136,7 @@ if test "$reloc_b" = "yes"; then
     AC_DEFINE(ARGV0_RELOCATION)
 fi
 
-AC_MSG_CHECKING([New Century Schoolbook PFB files])
-if test "$NCSB_DIR" = "unknown"; then
-  # use `type' command rather than external program `which'
-  type locate >& /dev/null
-  if test "$?" = "0"; then
-      for d in `locate c059033l.pfb `; do
-         if test -f `dirname "$d"`/c059033l.afm ; then
-             NCSB_DIR=`dirname "$d"`
-             break 
-         fi
-      done
-      if test "$NCSB_DIR" = "unknown";  then
-         AC_MSG_WARN(Could not find c059033l.pfb. Use --enable-ncsb-path to set path)
-      fi
-  else
-     AC_MSG_WARN(Could not find locate(1). Use --enable-ncsb-path to set path to c059033l.pfb)
-  fi
-fi
 
-AC_MSG_RESULT($NCSB_DIR)
-AC_SUBST(NCSB_DIR)
 
 HOST_ARCH=`$CC -dumpmachine`
 AC_SUBST(HOST_ARCH)
index fd7f963dbac268171a164ef1c2869d77a9b025d9..83e58d299ccbc180babe5a7f2aa34f2b1a5dbca7 100644 (file)
@@ -24,7 +24,7 @@ int default_compare (T const &a, T const &b)
 {
   if (a < b)
     return -1;
-  else if (a > b)
+  else if (b < a)
     return 1;
   else
     return 0;
index a17e462bf5840c83787ac1875b182dfe1bfbcebc..0213aefb4f9ea6510a783670eaca9aecebe84f9b 100644 (file)
@@ -2,7 +2,7 @@ depth = ../..
 
 LOCALSTEPMAKE_TEMPLATES=ly mutopia
 
-EXTRA_DIST_FILES= lbook-texi-test.texi  lbook-latex-test.tex
+EXTRA_DIST_FILES= lbook-texi-test.texi  lbook-latex-test.tex lbook-html-test.html
 
 include $(depth)/make/stepmake.make
 
index 69b9343650fd44612e92768939c3019acc312468..8a2915ad10c8d2c4bbbb54124b3f4d08f42708bb 100644 (file)
@@ -47,8 +47,13 @@ Music_sequence::maximum_length (SCM l)
   for (SCM s = l; scm_is_pair (s); s = scm_cdr (s))
     {
       Music *m = unsmob_music (scm_car (s));
-      Moment l = m->get_length ();
-      dur = max (dur, l);
+      if (!m)
+       programming_error ("Music sequence should have music elements");
+      else
+       {
+         Moment l = m->get_length ();
+         dur = max (dur, l);
+       }
     }
 
   return dur;
index b19b3400d150d039db71b59c1729703c66b30c15..3ac9576bb5f3155de39fa5c9da5a53034f9d369b 100644 (file)
@@ -31,8 +31,7 @@ FETA_FONTS = $(FETA_MF_FILES:.mf=)
 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
 
 
-NCSB_SOURCE_FILES=c059013l c059016l c059033l c059036l
-NCSB_TTFS=$(addprefix $(outdir)/,CenturySchL-Ital.ttf CenturySchL-BoldItal.ttf CenturySchL-Roma.ttf CenturySchL-Bold.ttf)
+NCSB_OTFS=$(addprefix $(outdir)/,CenturySchL-Ital.ttf CenturySchL-BoldItal.ttf CenturySchL-Roma.ttf CenturySchL-Bold.ttf)
 NCSB_INSTALL_DIR=$(local_lilypond_datadir)/fonts/otf
 
 LOG_FILES = $(FETA_MF_FILES:%.mf=$(outdir)/%.log)
@@ -101,7 +100,7 @@ PFA_FILES = $(ALL_FONTS:%=$(outdir)/%.pfa)
 
 # Make tfm files first, log files last,
 # so that normally log files aren't made twice
-ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(NCSB_TTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) $(outdir)/fonts.cache-1
+ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES) $(LISP_FILES) $(FETA_LIST_FILES)  $(OTF_TABLES) $(NCSB_OTFS) $(PFA_FILES) $(OTF_FILES) $(SVG_FILES) $(outdir)/fonts.cache-1
 
 #PRE_INSTALL=$(MAKE) "$(ALL_GEN_FILES)"
 
@@ -114,7 +113,7 @@ INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
 INSTALLATION_OUT_FILES1=$(TEXTABLES)
 
 INSTALLATION_OUT_DIR2=$(local_lilypond_datadir)/fonts/otf
-INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_TTFS)
+INSTALLATION_OUT_FILES2=$(OTF_FILES) $(NCSB_OTFS)
 
 INSTALLATION_OUT_DIR3=$(local_lilypond_datadir)/fonts/tfm
 INSTALLATION_OUT_FILES3=$(TFM_FILES)
@@ -197,7 +196,7 @@ $(outdir)/%.enc.in: %.enc
        cp $< $@
 
 
-$(NCSB_TTFS): $(addsuffix .pfb,$(addprefix $(NCSB_DIR)/,$(NCSB_SOURCE_FILES))) $(buildscript-dir)/pfx2ttf.fontforge
+$(NCSB_OTFS): $(NCSB_SOURCE_FILES) $(buildscript-dir)/pfx2ttf.fontforge
        $(foreach i,$(NCSB_SOURCE_FILES), \
                $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
-                       $(NCSB_DIR)/$(i).pfb $(NCSB_DIR)/$(i).afm $(outdir)/ && ) true
+       $(i).pfb $(i).afm $(outdir)/ && ) true
index e500999ec48633ed9fd34eb1d64c3f77afe47986..50648f13c0bcd2f9f20ede6d7490ce6ac205dcc7 100644 (file)
@@ -14,7 +14,8 @@
 
 message "******************************************************";
 message "Using feta Autometric macros.";
-message "Do not worry about the @ signs in the output, they are not errors.";
+message "order of messages: ";
+message " NAME/CODE/BP/WD/DP/HT/WX/WY";
 message "******************************************************";
 message "";
 
index 1483af4d9feeb72e49f0d6da5ccf5e05aaebc370..c09c3d2df9c4bba4d55194b66350f3778315b142 100644 (file)
@@ -336,6 +336,10 @@ endgroup
 enddef;
 
 
+%
+%
+% UGH : xs not declared as argument.
+%
 def define_triangle_shape (expr stemdir) =
        save triangle_a, triangle_b, triangle_c;
        save triangle_out_a, triangle_out_b, triangle_out_c;
@@ -439,16 +443,17 @@ def define_triangle_shape (expr stemdir) =
                       & {direction infinity of triangle_out_c}z1'l
                       .. cycle;
 
+
        labels (0, 10, 20, 30);
        penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
 
        % attachment Y
        if stemdir = 1:
                charwy := ypart exact_right_point;
-               charwx := xpart exact_right_point;
+               charwx := xpart exact_right_point + .5 pen_thick# * xs;
        else:
                charwy := -ypart exact_down_point;
-               charwx := (width# - xpart exact_down_point);
+               charwx := (width# - (xpart exact_down_point - 0.5 * xs * pen_thick#));
        fi
 enddef;
 
@@ -503,14 +508,14 @@ def draw_small_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Half trianglehead", "d1triangle");
+fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
        draw_small_triangle_head (-1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Half trianglehead", "u1triangle");
+fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
        draw_small_triangle_head (1);
 
        draw_staff (-2, 2, 0.5);
@@ -531,14 +536,14 @@ def draw_closed_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Quart trianglehead", "u2triangle");
+fet_beginchar ("Quart trianglehead (upstem)", "u2triangle");
        draw_closed_triangle_head (1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Quart trianglehead", "d2triangle");
+fet_beginchar ("Quart trianglehead (downstem)", "d2triangle");
        draw_closed_triangle_head (-1);
 
        draw_staff (-2, 2, 0.5);
index 7e69fdd360dc9129621faccc99c414af650fec40..037c1fdd729cce489689d2b15e45233f95560c3e 100644 (file)
@@ -552,7 +552,6 @@ entries @code{name} and @code{interfaces}.")
 
      ;; TODO: use interface for this!
      (quantized-positions ,number-pair? "Beam positions after quanting.")
-     (chord-tremolo ,boolean? "if set, this beam is a tremolo. ")
      (begin-of-line-visible ,boolean? "Used for marking ChordNames that should only show changes.")
 
      (quantize-position ,boolean? "If set, a vertical alignment is aligned to be within staff spaces.")
index 0e68240bd3eb89b1ad40439c1d8d5deea6c9f27f..69c1e4617daffc027703d80d63947a28466cf1ed 100644 (file)
 
       (cons
        name
-       (cond
-       ((string-match "^([eE]mmentaler|[Aa]ybabtu)" file-name)
-        (ps-load-file (ly:find-file
-                       (format "~a.otf"  file-name))))
-       ((string? bare-file-name)
-        (ps-load-file file-name))
-       (else
-        (ly:warning (_ "can't embed ~S=~S") name file-name)
-         "")))))
+       
+       (if (mac-font? bare-file-name)
+          (handle-mac-font name bare-file-name)
+          (cond
+           ((string-match "^([eE]mmentaler|[Aa]ybabtu)" file-name)
+            (ps-load-file (ly:find-file
+                           (format "~a.otf"  file-name))))
+           ((string? bare-file-name)
+            (ps-load-file file-name))
+           (else
+            (ly:warning (_ "can't embed ~S=~S") name file-name)
+            "")))
+
+         )))
 
   (define (dir-join a b)
     (if (equal? a "")
        (else
        (ly:warning (_ "don't know how to embed ~S=~S") name file-name)
        ""))))
-      
+
+    (define (mac-font? bare-file-name)
+      (and
+       (eq? PLATFORM 'darwin)
+       bare-file-name
+       (or
+       (string-match "\\.dfont" bare-file-name)
+       (= (stat:size (stat bare-file-name)) 0))))
+
   (define (load-font font-name-filename)
     (let* ((font (car font-name-filename))
           (name (cadr font-name-filename))
        name
        (cond
 
-       ((and
-         (eq? PLATFORM 'darwin)
-         bare-file-name (string-match "\\.dfont" bare-file-name))
-        (handle-mac-font name bare-file-name))
-       
-       ((and
-         (eq? PLATFORM 'darwin)
-         bare-file-name (= (stat:size (stat bare-file-name)) 0))
+       ((mac-font? bare-file-name)
         (handle-mac-font name bare-file-name))
 
        ((and font (cff-font? font))
index 2e7fde27636932dcb0448afa89d824fbe8cb02d2..c4c2863ff1806911da83241dad4c2af94bbdb78e 100644 (file)
@@ -310,6 +310,10 @@ found."
 (define-public (offset-flip-y o)
   (cons (car o) (- (cdr o))))
 
+(define-public (offset-scale o scale)
+  (cons (* (car o) scale)
+       (* (cdr o) scale)))
+
 (define-public (ly:list->offsets accum coords)
   (if (null? coords)
       accum
@@ -333,8 +337,19 @@ found."
   (max 0 (- (cdr x) (car x))))
 
 (define-public interval-start car)
+(define-public (ordered-cons a b)
+  (cons (min a b)
+       (max a b)))
+
 (define-public interval-end cdr)
 
+(define-public (interval-index interval dir)
+  "Interpolate INTERVAL between between left (DIR=-1) and right (DIR=+1)"
+  
+  (* (+  (interval-start interval) (interval-end interval)
+        (* dir (- (interval-end interval) (interval-start interval))))
+     0.5))
+
 (define-public (interval-center x)
   "Center the number-pair X, when an interval"
   (if (interval-empty? x)
@@ -368,6 +383,7 @@ found."
            (nan? (cdr i))
            (inf? (cdr i)))))
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 
index db729e6567beb0c6f3c8490107e6614dc22abba9..3c05c97dfacdb8ef5e3a0bfa2db23c71ba2e4d04 100644 (file)
@@ -95,6 +95,9 @@ similar to chord syntax")
    "."))
 
 
+;; TeX C++ code actually hooks into TEX_STRING_HASHLIMIT 
+(define-public TEX_STRING_HASHLIMIT 10000000)
+
 
 
 ;; gettext wrapper for guile < 1.7.2
@@ -106,6 +109,8 @@ similar to chord syntax")
   (let* ((file-name (%search-load-path x)))
     (if (ly:get-option 'verbose)
        (ly:progress "[~A" file-name))
+    (if (not file-name)
+       (ly:error (_ "Can't find ~A" x)))
     (primitive-load file-name)
     (if (ly:get-option 'verbose)
        (ly:progress "]"))))
@@ -221,6 +226,7 @@ The syntax is the same as `define*-public'."
          ;; load-from-path
          '("lily-library.scm"
            "file-cache.scm"
+;          "define-event-classes.scm"
            "define-music-types.scm"
            "output-lib.scm"
            "c++.scm"
index 6d82d6ec0552b98f07642894aa925cbb0849797b..35ed35e3b31d05c3f76f727764867cad9d7845cb 100644 (file)
@@ -28,8 +28,6 @@
       ""))
 
 
-;; TeX C++ code actually hooks into TEX_STRING_HASHLIMIT 
-(define-public TEX_STRING_HASHLIMIT 10000000)
 (define-public (text font str)
   (call-with-output-string
    (lambda (port)
index 05ba3075435981f9ffb92c1e67a3cacfc423e079..24b5d0384ad8e68d7f9e8e86cd15e1c66afdbc9e 100644 (file)
@@ -1068,7 +1068,7 @@ class Lilypond_snippet (Snippet):
 
        def png_is_outdated (self):
                base = self.basename ()
-               ok = self.ly_is_outdated ()
+               ok = not self.ly_is_outdated ()
                if global_options.format in (HTML, TEXINFO):
                        ok = ok and os.path.exists (base + '.eps')
 
@@ -1076,7 +1076,7 @@ class Lilypond_snippet (Snippet):
                        if ok:
                                page_count = ps_page_count (base + '.eps')
                        
-                       if page_count == 1:
+                       if page_count <= 1:
                                ok = ok and os.path.exists (base + '.png')
                        elif page_count > 1:
                                for a in range (1, page_count + 1):
@@ -1375,7 +1375,7 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets):
        ly_names = filter (lambda x: x,
                           map (Lilypond_snippet.basename, ly_snippets))
        texstr_names = filter (lambda x: x,
-                          map (Lilypond_snippet.basename, texstr_snippets))
+                              map (Lilypond_snippet.basename, texstr_snippets))
        png_names = filter (lambda x: x,
                            map (Lilypond_snippet.basename, png_snippets))
 
@@ -1385,6 +1385,9 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets):
                                    be_verbose=global_options.verbose, 
                                    progress_p= 1)
 
+        if global_options.format in (HTML, TEXINFO):
+               cmd += ' --format png '
        # UGH
        # the --process=CMD switch is a bad idea
        # it is too generic for lilypond-book.
@@ -1521,7 +1524,8 @@ def do_process_cmd (chunks, input_name):
        map (Lilypond_snippet.write_ly, ly_outdated)
        progress ('\n')
 
-       if ly_outdated:
+        outdated = png_outdated + texstr_outdated + ly_outdated
+       if outdated:
                progress (_ ("Processing..."))
                progress ('\n')
                process_snippets (global_options.process_cmd, ly_outdated, texstr_outdated, png_outdated)
index 3718904ceb752f6194c9e4d743167a2dc09c9671..3ae4f92df6f0e8299848ee76a54166bb4f78dcdd 100644 (file)
@@ -1027,6 +1027,11 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
        changequote([, ])#dnl
     fi
     
+    if test "$cross_compiling" = "yes" -a -z "$PYTHON_CFLAGS"; then
+       PYTHON_CFLAGS=`python-config --cflags`
+       PYTHON_LDFLAGS=`python-config --ldflags`
+    fi
+    
     if test -z "$PYTHON_HEADER"; then
        CPPFLAGS="$PYTHON_CFLAGS $CPPFLAGS"
        AC_CHECK_HEADERS([Python.h],[PYTHON_HEADER=yes])
@@ -1038,6 +1043,8 @@ AC_DEFUN(STEPMAKE_PYTHON_DEVEL, [
     fi
 ])
 
+
+
 AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [
     AC_LANG_PUSH(C++)
     AC_CACHE_CHECK([for stl.data () method],