From: hanwen Date: Sat, 27 Jul 2002 00:58:29 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/1.5.71~57 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a846d4b104c963448525dd5edff88d1ab094ab96;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index ad257c8e50..b9194ec07f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-07-27 Juergen Reuter + + * scm/output-lib.scm, lily/note-head.cc: fixed broken baroque + note-head style by setting grob property font-family + automatically. + 2002-07-26 Jan Nieuwenhuizen * Documentation/user/lilypond-book.itely (Insert music snippets diff --git a/lily/note-head.cc b/lily/note-head.cc index 39aeb99c7a..cd9bc3729c 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -120,11 +120,18 @@ internal_brew_molecule (Grob *me, bool ledger_take_space) SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log, ly_quote_scm (style), SCM_UNDEFINED); - String name = "noteheads-" + ly_scm2string (scm_primitive_eval (exp)); - Molecule out = Font_interface::get_default_font (me)->find_by_name (name); - if (out.empty_b()) - { - warning (_f("Symbol not found, ", name.to_str0 ())); + SCM scm_pair = scm_primitive_eval (exp); + SCM scm_font_char = ly_car (scm_pair); + SCM scm_font_family = ly_cdr (scm_pair); + String font_char = "noteheads-" + ly_scm2string (scm_font_char); + String font_family = ly_scm2string (scm_font_family); + + me->set_grob_property("font-family", ly_symbol2scm (font_family.to_str0 ())); + Molecule out = + Font_interface::get_default_font (me)->find_by_name (font_char); + if (out.empty_b()) + { + warning (_f("Symbol not found, ", font_char.to_str0())); } int interspaces = Staff_symbol_referencer::line_count (me)-1; @@ -235,7 +242,8 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a) return 0.0; SCM st = me->get_grob_property ("style"); - SCM result = gh_apply (v, scm_list_n (st, SCM_UNDEFINED)); + SCM log = gh_int2scm (get_balltype (me)); + SCM result = gh_apply (v, scm_list_n (st, log, SCM_UNDEFINED)); if (!gh_pair_p (result)) return 0.0; diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 6f992dd3bb..889e4e6101 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -95,25 +95,48 @@ ;; silly, use alist? (define (find-notehead-symbol duration style) (case style - ((xcircle) "2xcircle") - ((harmonic) "0neo_mensural") + ((xcircle) (cons "2xcircle" "music")) + ((harmonic) (cons "0neo_mensural" "music")) ((baroque) - (string-append (number->string duration) - (if (< duration 0) "neo_mensural" ""))) - ((mensural) (string-append (number->string duration) (symbol->string style))) - ((neo_mensural) (string-append (number->string duration) (symbol->string style))) - ((default) (number->string duration)) + ;; Oops, I actually would not call this "baroque", but, for + ;; backwards compatibility to 1.4, this is supposed to take + ;; brevis, longa and maxima from the neo-mensural font and all + ;; other note heads from the default font. -- jr + (if (< duration 0) + (cons (string-append (number->string duration) "neo_mensural") "ancient") + (cons (number->string duration) "music"))) + ((mensural) + (cons (string-append (number->string duration) (symbol->string style)) + "ancient")) + ((neo_mensural) + (cons (string-append (number->string duration) (symbol->string style)) + "ancient")) + ((default) + ;; The default font in mf/feta-bolletjes.mf defines a brevis, but + ;; neither a longa nor a maxima. Hence let us, for the moment, + ;; take these from the neo-mensural font. TODO: mf/feta-bolletjes + ;; should define at least a longa for the default font. The longa + ;; should look exactly like the brevis of the default font, but + ;; with a stem exactly like that of the quarter note. -- jr + (if (< duration -1) + (cons (string-append (number->string duration) "neo_mensural") "ancient") + (cons (number->string duration) "music"))) (else - (string-append (number->string (max 0 duration)) (symbol->string style))))) + (cons (string-append (number->string (max 0 duration)) (symbol->string style)) + "music")))) -(define (note-head-style->attachment-coordinates style) +(define (note-head-style->attachment-coordinates style duration) "Return pair (X . Y), containing multipliers for the note head bounding box, where to attach the stem. e.g.: X==0 means horizontally centered, X==1 is at the right, X == -1 is at the left." (case style - ((default) '(1.0 . 0.5)) + ((default) + (if (< duration -1) + '(0.0 . 0.6) ;; neo-mensural + '(1.0 . 0.5) ;; default + )) ((cross) '(1.0 . 0.75)) ((mensural) '(0.0 . 0.6)) ((neo_mensural) '(0.0 . 0.6)) @@ -122,6 +145,11 @@ centered, X==1 is at the right, X == -1 is at the left." ((slash) '(1.0 . 1.0)) ((harmonic) '(1.0 0.0)) ((triangle) '(0.75 . 0.15)) + ((baroque) + (if (< duration 0) + '(0.0 . 0.6) ;; neo-mensural + '(1.0 . 0.5) ;; default + )) (else ;; this also works for easy notation.