]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.152.jcn3
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 8 May 2001 20:01:37 +0000 (22:01 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 8 May 2001 20:01:37 +0000 (22:01 +0200)
1.3.152.jcn3
============

* Fixed brace font selection: do pick bigger font when needed.

* Increased number of brace fonts; made size step variable.

18 files changed:
CHANGES
GNUmakefile.in
VERSION
buildscripts/tfm2afm.scm
input/bugs/braces.ly [new file with mode: 0644]
lily/system-start-delimiter.cc
mf/feta-beugel.mf
mf/feta-braces0.mf
mf/feta-braces1.mf
mf/feta-braces2.mf
mf/feta-braces3.mf
mf/feta-braces4.mf [new file with mode: 0644]
mf/feta-braces5.mf [new file with mode: 0644]
mf/feta-braces6.mf [new file with mode: 0644]
mktexnam.patch [new file with mode: 0644]
scm/font.scm
scm/grob-description.scm
scm/grob-property-description.scm

diff --git a/CHANGES b/CHANGES
index c89915083406278241c63ecf13f573d20f6726f3..1e86bfb8c663c966b1bb5bcd17f06dfb11abceeb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+1.3.152.jcn3
+============
+
+* Fixed brace font selection: do pick bigger font when needed.
+
+* Increased number of brace fonts; made size step variable. 
+
 1.3.152.jcn2
 ============
 
index 81c9024e1c21adbbf53acbb1bd4639bb5e6c2d1c..aea123d235ae709199aead4bdef34d4e5cbee77e 100644 (file)
@@ -20,7 +20,7 @@ SCRIPTS = configure aclocal.m4
 README_FILES =  DEDICATION COPYING NEWS CHANGES ROADMAP
 README_TXT_FILES = AUTHORS.txt README.txt INSTALL.txt FAQ.txt
 IN_FILES := $(wildcard *.in)
-EXTRA_DIST_FILES = lilypond-font-lock.el lilypond-mode.el vimrc VERSION $(README_FILES)  $(SCRIPTS) $(IN_FILES)  emacsclient.patch
+EXTRA_DIST_FILES = lilypond-font-lock.el lilypond-mode.el vimrc VERSION $(README_FILES)  $(SCRIPTS) $(IN_FILES)  emacsclient.patch mktexnam.patch
 NON_ESSENTIAL_DIST_FILES = $(README_TXT_FILES)
 INSTALLATION_DIR=$(datadir)
 INSTALLATION_FILES=$(configuration) VERSION
diff --git a/VERSION b/VERSION
index ea0adbcddfb3b5a3be296b29b8cbdc0fa7b8f96a..fc34f94078ee42868f7bca8870b8fdc22f75b8e7 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=152
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index c6d685ca8af61d16e3bacd571f3a9fd5f5382e17..eda8456f1ce575b9eb6b9c4901d9e0648a1a80df 100644 (file)
@@ -123,10 +123,10 @@ Example: tfm2afm `kpsewhich cmr10.tfm`
 ;; what am I doing wrong?
 ;;
 (define (do-file tfm-name output-name)
-  (let* ((font (basename tfm-name '.tfm))
-        (afm-name (string-append font '.afm))
-        (dit-name (string-append font '.dit))
-        (chart-name (string-append font '.chart))
+  (let* ((font (basename tfm-name ".tfm"))
+        (afm-name (string-append font ".afm"))
+        (dit-name (string-append font ".dit"))
+        (chart-name (string-append font ".chart"))
         (chart (let loop ((i 0) (s ""))
                  (if (= i 256)
                      s
@@ -136,7 +136,7 @@ Example: tfm2afm `kpsewhich cmr10.tfm`
     (dump-file chart-name chart)
     
     (if (= 0 (primitive-fork))
-       (execlp 'tfmtodit tfm-name tfm-name chart-name dit-name)
+       (execlp "tfmtodit" tfm-name tfm-name chart-name dit-name)
        (waitpid 0))
     
     (let* ((dit (gulp-file dit-name))
diff --git a/input/bugs/braces.ly b/input/bugs/braces.ly
new file mode 100644 (file)
index 0000000..10d474e
--- /dev/null
@@ -0,0 +1,77 @@
+\header {
+texidoc="Run this through ly2dvi to show differerent brace sizes"
+}
+
+\include "paper11.ly"
+\paper { linewidth = -1.0 }
+
+\score {
+  \context GrandStaff <
+    \context Staff = a \notes c''1
+    \context Staff = b \notes c''1
+  >
+}
+
+
+\include "paper13.ly"
+\paper { linewidth = -1.0 }
+
+\score {
+  \context GrandStaff <
+    \context Staff = a \notes c''1
+    \context Staff = b \notes c''1
+  >
+  \paper {
+    \translator {
+      \GrandStaffContext
+      SystemStartDelimiter \override #'weird = #-5
+    }
+  }
+}
+
+
+\include "paper16.ly"
+\paper { linewidth = -1.0 }
+
+\score {
+  \context GrandStaff <
+    \context Staff = a \notes c''1
+    \context Staff = b \notes c''1
+  >
+  \paper {
+    \translator {
+      \GrandStaffContext
+      SystemStartDelimiter \override #'weird = #5
+    }
+  }
+}
+
+
+\include "paper20.ly"
+\paper { linewidth = -1.0 }
+
+\score {
+  \context GrandStaff <
+    \context Staff = a \notes c''1
+    \context Staff = b \notes c''1
+  >
+  \paper {
+    \translator {
+      \GrandStaffContext
+      SystemStartDelimiter \override #'weird = #-7
+    }
+  }
+}
+
+
+\include "paper26.ly"
+\paper { linewidth = -1.0 }
+
+\score {
+  \context GrandStaff <
+    \context Staff = a \notes c''1
+    \context Staff = b \notes c''1
+    \context Staff = c \notes c''1
+    \context Staff = d \notes c''1
+  >
+}
index 22b993ba3122e8607e820a1cf6b2765f28f718b4..355eab3218e5b985cb9c179d0a8be3f36e1fcfb9 100644 (file)
@@ -141,26 +141,31 @@ Molecule
 System_start_delimiter::staff_brace (Grob*me, Real y)
 {
   Font_metric *fm = Font_interface::get_default_font (me);
+  SCM font_defaults = gh_cdr (scm_assoc (ly_symbol2scm ("font-defaults"),
+                                        me->paper_l ()->style_sheet_));
+
   Box b;
+#if 0
+  b = fm->get_char (0);
+  int count = fm->count () >? 2;
+#else 
+  int count = 255;
+#endif     
   int lo = 0;
-  int hi = 255; //arg, urg == 0: fm->count () >? 2;
-
-  int big = 1;
-  SCM bigger = gh_list (me->mutable_property_alist_,
-                       me->immutable_property_alist_,
-                       SCM_UNDEFINED);
+  int hi = count;
+  int relative_size = 0;
 
   /* do a binary search for each Y, not very efficient, but passable?  */
   do
   {
     int cmp = (lo + hi) / 2;
-
     b = fm->get_char (cmp);
     if (b[Y_AXIS].empty_b () || b[Y_AXIS].length () > y)
-      {
-         hi = cmp;
-      }
+      hi = cmp;
     else
+      lo = cmp;
+
+    if (lo == count - 1 && b[Y_AXIS].length () < y && relative_size < 10)
       {
        /*
          ugh: 7
@@ -168,27 +173,36 @@ System_start_delimiter::staff_brace (Grob*me, Real y)
          
          In the style-sheet, all paper relative sizes need to start
          looking at the feta-braces0 font.
-
+         
          The smallest paper size, feta11 or -3, has to make 5 steps
-         to get to feta26 or +2.  Only after that, from +3 to +5 are
-         the real bigger sizes, so worst case we need 8 steps to get
+         to get to feta26 or +2.  Only after that, from +3 to +8 are
+         the real bigger sizes, so worst case we need 11 steps to get
          to the font we need. */
-       if (big < 8)
-         {
-           bigger = gh_cons (gh_cons (ly_symbol2scm ("font-relative-size"),
-                                      gh_int2scm (big++)),
-                             bigger);
-           me->set_grob_property ("font", bigger);
-           fm = Font_interface::get_default_font (me); 
-           lo = 0;
-           hi = 255; //fm->count () >? 2;
-         }
-       else
-         lo = cmp;
+       fm = Font_interface::get_font
+         (me,
+          gh_list (gh_list (gh_cons (ly_symbol2scm ("font-relative-size"),
+                                     gh_int2scm (++relative_size)),
+                            SCM_UNDEFINED),
+                   me->mutable_property_alist_,
+                   me->immutable_property_alist_,
+                   font_defaults,
+                   SCM_UNDEFINED));
+#if 0
+       b = fm->get_char (0);
+       count = fm->count () >? 2;
+#else
+       count = 255;
+#endif     
+       lo = 0;
+       hi = count;
       }
-    }
+  }
   while (hi - lo > 1);
 
+  // uRGURGU, why doesn't the height calculation work out??
+  SCM weird = me->get_grob_property ("weird");
+  if (gh_number_p (weird))
+    lo += gh_scm2int (weird);
   SCM at = gh_list (ly_symbol2scm ("char"), gh_int2scm (lo), SCM_UNDEFINED);
   at = fontify_atom (fm, at);
   
index ca510cebb3904ce6543e5e589fd6007028686653..fad6035df3efcf9b62fe07ca317929c064a567fe 100644 (file)
@@ -1,31 +1,38 @@
+input feta-autometric;
 input feta-macros;
 input feta-params;
 
+fet_beginfont("feta-braces", 16);
+mode_setup;
+
+staffsize#:=16pt#;
+
 save code;
-code :=0;
+code := 0;
 
 
-def draw_brace( expr height_sharp, width_sharp) = 
-       save pendir, height, width, thin, thick;
+def draw_brace (expr height_sharp, width_sharp, slt_sharp) = 
+       save pendir, height, width, thin, thick, slt;
        save penangle;
        height# := height_sharp;
-       width#  := width_sharp;
+       width# := width_sharp;
+       slt# := slt_sharp;
 
        beginchar(code, width#, height#/2, height#/2);
        code := incr code;
          
-       define_pixels (height, width);
-       thin = 2 stafflinethickness;
+       define_pixels (height, width, slt);
+       thin = 2 slt;
        thick = .5 width;
        
        z2 = .5 [z1, z3];
-       y3 = y1 + height/2;
+       y3l = y1 + height/2;
        x3 = x1 + width;
        y1 =0;
        x3 = - width / 2;
 
        pair pendir;
-       pendir = unitvector(x3 - x1, y3/6 - y1);
+       pendir = unitvector(x3 - x1, y3l/6 - y1);
        penangle = angle pendir - 90;
        penpos3(thin, penangle);
        penpos2(thick, angle(z3 -z1) -90 );
@@ -39,10 +46,24 @@ def draw_brace( expr height_sharp, width_sharp) =
 endchar;
 enddef;
 
-for i := font_count * 256 step 1 until (font_count + 1) * 256 - 1:
-  % note: define_pixels (x) multiplies x by hppp,
-  %       we must never get bigger than infinity
-  y := min ((i + 1) * 0.25pt#, infinity/hppp - 1);
-  x := y / 12;
-  draw_brace (y, x);
+l := 0.05pt#;
+y := 10pt#;
+
+for i := 0 step 1 until font_count:
+  for j := 0 step 1 until 255:
+    % 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);
+    % x should be about one staff space, taking brace to have
+    % default height of 3 staffs, this yields height / 3 / 4
+    x := y / 12;
+    % l should be about one stafflinethickness
+    l := x / 10;
+    if i = font_count:
+      draw_brace (y, x, l);
+    fi
+  endfor;
 endfor
+  
+fet_endfont("feta-braces");
index 6afda40f26e593855f7503675b64ac7899095484..ddc7665a88e482178c48a6e27b14ebe4f3f6384e 100644 (file)
@@ -6,12 +6,6 @@
 % (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 % 
 
-font_identifier:="feta-braces0";
-font_size 16;
-mode_setup;
-
-staffsize#:=16pt#;
 font_count := 0;
 input feta-beugel;
 end.
-
index eb535f0457ee8167bb77e032b2a2b357a7355750..9b401026f2d6e0e59661a2537dd134cab117bc47 100644 (file)
@@ -6,12 +6,6 @@
 % (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 % 
 
-font_identifier:="feta-braces1";
-font_size 16;
-mode_setup;
-
-staffsize#:=16pt#;
 font_count := 1;
 input feta-beugel;
 end.
-
index 3eb180c44c202026ae3862aff9d05646d9e66451..1c6b8cf46d6a891d481905a72f5cde46cd50c6ba 100644 (file)
@@ -6,12 +6,6 @@
 % (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 % 
 
-font_identifier:="feta-braces2";
-font_size 16;
-mode_setup;
-
-staffsize#:=16pt#;
 font_count := 2;
 input feta-beugel;
 end.
-
index 847ac4425402187001b4aedfb760ae1863e69706..bc1650059ec7fe0e1589d9eba3209e2f7e3183cf 100644 (file)
@@ -6,12 +6,6 @@
 % (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 % 
 
-font_identifier:="feta-braces3";
-font_size 16;
-mode_setup;
-
-staffsize#:=16pt#;
 font_count := 3;
 input feta-beugel;
 end.
-
diff --git a/mf/feta-braces4.mf b/mf/feta-braces4.mf
new file mode 100644 (file)
index 0000000..3c1ec3d
--- /dev/null
@@ -0,0 +1,13 @@
+% 
+% feta-braces4.mf --  next 256 braces
+% 
+% source file of the Feta (Font-En-Tja) music font
+% 
+% (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+% 
+
+font_count := 4;
+input feta-beugel;
+end.
+
+
diff --git a/mf/feta-braces5.mf b/mf/feta-braces5.mf
new file mode 100644 (file)
index 0000000..e8ed266
--- /dev/null
@@ -0,0 +1,11 @@
+% 
+% feta-braces5.mf --  next 256 braces
+% 
+% source file of the Feta (Font-En-Tja) music font
+% 
+% (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+% 
+
+font_count := 5;
+input feta-beugel;
+end.
diff --git a/mf/feta-braces6.mf b/mf/feta-braces6.mf
new file mode 100644 (file)
index 0000000..4fa7a79
--- /dev/null
@@ -0,0 +1,11 @@
+% 
+% feta-braces6.mf --  next 256 braces
+% 
+% source file of the Feta (Font-En-Tja) music font
+% 
+% (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+% 
+
+font_count := 6;
+input feta-beugel;
+end.
diff --git a/mktexnam.patch b/mktexnam.patch
new file mode 100644 (file)
index 0000000..ff16dca
--- /dev/null
@@ -0,0 +1,10 @@
+--- mktexnam.orig      Sun Mar  4 19:29:45 2001
++++ mktexnam   Tue May  8 20:28:57 2001
+@@ -158,6 +158,7 @@
+       MT_PKDESTDIR=$DEST
+       MT_TFMDESTDIR=$DEST
+       MT_MFDESTDIR=$DEST
++      MT_DESTROOT=foobar
+       MT_NAMEPART=;;
+    *) # Relative destdir => append to the default.
+       MT_NAMEPART=$DEST;;
index e6c46e7ba1d2db7d761b6d212de8e8ba3c7514c8..9c7fb284611361b538190b2e55eafb52f9e08082 100644 (file)
     ((-2 medium caps roman cmcsc 7) . "cmcsc7")
     ((-3 medium caps roman cmcsc 7) . "cmcsc7")
 
-    ;; smallest needs 8 steps: -3 to +5, so
-    ;; biggest also needs 8 available steps: +2 to + 10
-    ((10 * * braces feta-braces 3) . "feta-braces3")
-    ((9 * * braces feta-braces 3) . "feta-braces3")
-    ((8 * * braces feta-braces 3) . "feta-braces3")
-    ((7 * * braces feta-braces 3) . "feta-braces3")
-    ((6 * * braces feta-braces 3) . "feta-braces3")
+    ;; smallest needs 11 steps: -3 to +8, so
+    ;; biggest also needs 11 available steps: +2 to + 13
+    ((13 * * braces feta-braces 6) . "feta-braces6")
+    ((12 * * braces feta-braces 6) . "feta-braces6")
+    ((11 * * braces feta-braces 6) . "feta-braces6")
+    ((10 * * braces feta-braces 6) . "feta-braces6")
+    ((9 * * braces feta-braces 6) . "feta-braces6")
+    ((8 * * braces feta-braces 6) . "feta-braces6")
+    ((7 * * braces feta-braces 5) . "feta-braces5")
+    ((6 * * braces feta-braces 4) . "feta-braces4")
     ((5 * * braces feta-braces 3) . "feta-braces3")
     ((4 * * braces feta-braces 2) . "feta-braces2")
     ((3 * * braces feta-braces 1) . "feta-braces1")
index fd4a146c8e772e375868c69981cbb47af2aaf0d9..fbf23369ea9a7305fa28d8c2dbb08dfbfc91c49b 100644 (file)
 
        ;; TODO: should split in 3
        (SystemStartDelimiter . (
+                ;; (weird . 0)
                (molecule-callback . ,System_start_delimiter::brew_molecule)
                (after-line-breaking-callback . ,System_start_delimiter::after_line_breaking)
                ;; really 4.0, but 5 to be on safe side.
index ef4cec6bebb0481e33752813afa373bf28a357c7..7ff894701ebb18ef1669af22392fce8b2ad1b755 100644 (file)
@@ -358,6 +358,7 @@ Like @code{tuplet-bracket-visibility}, but for the number.")
 function of type (beam multiplicity dy staff-line-thickness) -> real.  Default value: default-beam-y-quants, also available: beam-traditional-y-quants.
 .")
 (grob-property-description 'visibility-lambda procedure? "a function that takes the break direction and returns a  cons of booleans containing (TRANSPARENT . EMPTY).")
+(grob-property-description 'weird number? "urg?")
 (grob-property-description 'when moment? "when does this column happen?.")
 (grob-property-description 'word-space number? "elongate left by this much (FIXME: cumbersome semantics).")
 (grob-property-description 'x-gap number? "horizontal gap between notehead and tie.")