]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/output-ps.scm (lily-traced-cm-fonts): substitution for lily
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 15 Jul 2003 10:02:38 +0000 (10:02 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 15 Jul 2003 10:02:38 +0000 (10:02 +0000)
cm fonts.

* mf/feta-beugel.mf: don't multiply font_count by 10.

* lily/lookup.cc (horizontal_line): new function. Use
horizontal-line in output backends.

ChangeLog
lily/include/lookup.hh
lily/lookup.cc
lily/staff-symbol.cc
mf/feta-beugel.mf
scm/output-ascii-script.scm
scm/output-ps.scm
scm/output-sodipodi.scm
scm/output-tex.scm

index 2acf0f4c8dc2dce6a65c3189f328b4c45be9eea7..441f3667e93b57bdb677ea73f5bc638d3f52167e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2003-07-15  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scm/output-ps.scm (lily-traced-cm-fonts): substitution for lily
+       cm fonts.
+
+       * mf/feta-beugel.mf: don't multiply font_count by 10.
+
+       * lily/lookup.cc (horizontal_line): new function. Use
+       horizontal-line in output backends.
+
        * Documentation/user/tutorial.itely (An orchestral part): new
        section on orchestral stuff and identifiers.
 
index 4950ce6ff5efb43d45a00a52962d1aefc5124ccc..c730a25acfe9669130e66526cafe45238cfd4229 100644 (file)
@@ -33,6 +33,7 @@ struct Lookup
   static Molecule roundfilledbox (Box b, Real blotdiameter);
   static Molecule repeat_slash (Real w, Real slope, Real th);
   static Molecule line (Real th, Offset from, Offset to);
+  static Molecule horizontal_line (Interval w, Real th);
   static Molecule triangle (Interval, Real, Real);
 };
 
index 91660d329b4cdb26e7eb3e2426898f9d19bec4c1..0f7d9b8d767c47ac2d6c51b262afa085a0c417c6 100644 (file)
@@ -83,13 +83,13 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash)
 Molecule
 Lookup::line (Real th, Offset f, Offset t)
 {
-  SCM at = (scm_list_n (ly_symbol2scm ("draw-line"),
+  SCM at = scm_list_n (ly_symbol2scm ("draw-line"),
                        gh_double2scm (th), 
                        gh_double2scm (f[X_AXIS]),
                        gh_double2scm (f[Y_AXIS]),
                        gh_double2scm (t[X_AXIS]),
                        gh_double2scm (t[Y_AXIS]),
-                       SCM_UNDEFINED));
+                       SCM_UNDEFINED);
 
   Box box;
   box.add_point (f);
@@ -101,6 +101,23 @@ Lookup::line (Real th, Offset f, Offset t)
   return Molecule (box, at);
 }
 
+Molecule
+Lookup::horizontal_line (Interval w, Real th)
+{
+  SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"),
+                      gh_double2scm (w[LEFT]), 
+                      gh_double2scm (w[RIGHT]),
+                      gh_double2scm (th),
+                      SCM_UNDEFINED);
+
+
+  Box box ;
+  box[X_AXIS] = w;
+  box[Y_AXIS] = Interval (-th/2,th/2);
+
+  return Molecule (box, at);
+}
+
 
 Molecule
 Lookup::blank (Box b) 
index 4d1f6e88ead7581d62c3e97debd535bc146bcd32..53beacabb045a61e08c81b3f75024d8573f4e21f 100644 (file)
@@ -74,8 +74,7 @@ Staff_symbol::brew_molecule (SCM smob)
   for (int i=0; i < l; i++)
     {
       Molecule a =
-       Lookup::filledbox (Box (Interval (0,width),
-                                        Interval (-t/2, t/2)));
+       Lookup::horizontal_line (Interval (0,width), t);
 
       a.translate_axis (height - i * staff_space (me), Y_AXIS);
       m.add_molecule (a);
index 744555ec72aecf9dcf0b4eaabb1071d4e54fdfae..ef2cd25f2cab3a871fc8be5259f08a3185399058 100644 (file)
@@ -4,7 +4,7 @@ input feta-params;
 
 font_coding_scheme "feta braces";
 
-fet_beginfont("feta-braces", font_count * 10 );
+fet_beginfont("feta-braces", font_count);
 mode_setup;
 
 
index 34b8333a988ec7d3e4e446ad72bd772e6bbf1047..b955214ffb415c500c28d321ce9b33d0dbde6fe8 100644 (file)
 (define (experimental-on)
   "")
 
+(define (horizontal-line x1 x2 th)
+  (filledbox (- x1)  (- x2 x1) (* .5 th)  (* .5 th )))
+
+
 (define (filledbox breapth width depth height)
   (let ((dx (+ width breapth))
        (dy (+ depth height)))
index baac7b457ca16414533efea4021d85b8a2fa0f89..9471f9afc8f4a03aacb9f0b31134851a468ab030 100644 (file)
 
 (use-modules
  (guile)
+ (ice-9 regex)
  (lily))
 
 
 
 ;;; Lily output interface --- cleanup and docme
 
-
+;; TODO: fucks up if outputting strings with parentheses.
 
 ;; Module entry
 (define-public (ps-output-expression expr port)
    (ly:number->string (* 10 thick))
    " ] 0 draw_dashed_slur"))
 
+(define lily-traced-cm-fonts
+  (map symbol->string
+       '(cmbx14
+        cmbx17
+        cmbxti12
+        cmbxti14
+        cmbxti7
+        cmbxti8
+        cmcsc12
+        cmcsc7
+        cmtt17)))
+  
 (define (define-fonts internal-external-name-mag-pairs)
   
   (define (font-load-command name-mag command)
-    
+
+    ;; frobnicate NAME to jibe with external definitions.
     (define (possibly-capitalize-font-name name)
-      (if (equal? (substring name 0 2) "cm")
-         (string-upcase name)
-         name))
+      (cond
+       ((and (equal? (substring name 0 2) "cm")
+            (not (member name lily-traced-cm-fonts)))
+       (string-upcase name))
+       ((equal? (substring name 0 4) "feta")
+       (regexp-substitute/global #f "feta([a-z-]*)([0-9]+)" name 'pre "GNU-LilyPond-feta" 1 "-" 2 'post))
+       (else name)))
     
     (string-append
      "/" command
 
 (define (filledbox breapth width depth height) 
   (string-append (numbers->string (list breapth width depth height))
-                " draw_box" ))
+                " draw_box"))
+
+(define (horizontal-line x1 x2 th)
+  (draw-line th x1  0 x2 0))
 
 (define (fontify name-mag-pair exp)
 
index 52efd40e57c41a99695f2c18e7a505ed60d9c4db..0d7046c0bd64a58f4d7ec2545931e77dca7b0a1a 100644 (file)
    sodipodi:docname='/tmp/x'>
   <defs
      id='defs3' />
-  <sodipodi:namedview
+  <podi:namedview
      id='base' />
   <g transform='translate(10,10) scale (1.0)'>
   ")
 (define (end-output)
   "</g></svg>")
 
+;;TODO
+;(define (horizontal-line x1 x2 th)
+;  (draw-line th x1  0 x2 0))
+
 (define (filledbox breapth width depth height)
   (roundfilledbox breapth width depth height line-thickness))
 
index afd15e374f541935fe05f01dd7dfae2ac032f9ca..8a531626f6e531beca556d763f4942c192638e42 100644 (file)
 (define (stop-last-system)
   "}%\n")
 
+(define (horizontal-line x1 x2 th)
+  (filledbox (- x1)  (- x2 x1) (* .5 th)  (* .5 th )))
+
 (define (filledbox breapth width depth height)
   (if (and #f (defined? 'ps-testing))
       (embedded-ps
 (define (draw-line thick fx fy tx ty)
   (embedded-ps (list 'draw-line thick fx fy tx ty)))
 
+;; TODO: this should be a default, which is overriden in PS
 (define (between-system-string string)
   string
   )