From: hanwen Date: Tue, 15 Jul 2003 10:02:38 +0000 (+0000) Subject: * scm/output-ps.scm (lily-traced-cm-fonts): substitution for lily X-Git-Tag: release/1.7.25~25 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0a0541921ecb8feb770bdfbcfbd2757e0e7a3515;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 2acf0f4c8d..441f3667e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2003-07-15 Han-Wen Nienhuys + * 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. diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 4950ce6ff5..c730a25acf 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -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); }; diff --git a/lily/lookup.cc b/lily/lookup.cc index 91660d329b..0f7d9b8d76 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -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) diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 4d1f6e88ea..53beacabb0 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -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); diff --git a/mf/feta-beugel.mf b/mf/feta-beugel.mf index 744555ec72..ef2cd25f2c 100644 --- a/mf/feta-beugel.mf +++ b/mf/feta-beugel.mf @@ -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; diff --git a/scm/output-ascii-script.scm b/scm/output-ascii-script.scm index 34b8333a98..b955214ffb 100644 --- a/scm/output-ascii-script.scm +++ b/scm/output-ascii-script.scm @@ -98,6 +98,10 @@ (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))) diff --git a/scm/output-ps.scm b/scm/output-ps.scm index baac7b457c..9471f9afc8 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -14,13 +14,14 @@ (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) @@ -114,14 +115,31 @@ (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 @@ -209,7 +227,10 @@ (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) diff --git a/scm/output-sodipodi.scm b/scm/output-sodipodi.scm index 52efd40e57..0d7046c0bd 100644 --- a/scm/output-sodipodi.scm +++ b/scm/output-sodipodi.scm @@ -172,7 +172,7 @@ sodipodi:docname='/tmp/x'> - ") @@ -276,6 +276,10 @@ (define (end-output) "") +;;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)) diff --git a/scm/output-tex.scm b/scm/output-tex.scm index afd15e374f..8a531626f6 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -246,6 +246,9 @@ (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 @@ -272,6 +275,7 @@ (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 )