From 94b46751bb219ecfe55543c4030c4dd2d9c2ca74 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 14 Mar 2004 16:03:55 +0000 Subject: [PATCH] * lily/span-dynamic-performer.cc (process_music): remove spurious warning. * scm/new-font.scm (make-font-tree): new function. --- ChangeLog | 6 +- Documentation/user/changing-defaults.itely | 18 ++-- input/regression/chord-name-entry.ly | 4 +- lily/dynamic-engraver.cc | 2 +- lily/include/audio-item.hh | 2 - lily/span-dynamic-performer.cc | 3 +- scm/define-grobs.scm | 97 +++++++++------------- scm/new-font.scm | 16 +++- 8 files changed, 72 insertions(+), 76 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f4272908e..f2325a9733 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,15 @@ 2004-03-14 Han-Wen Nienhuys + * lily/span-dynamic-performer.cc (process_music): remove spurious + warning. + * lily/context-def.cc (Context_def): init name to "" * lily/font-interface.cc: add font-encoding property. * scm/lily.scm (chain-assoc-get): bugfix. - * lily/paper-book.cc (stencil2line): don't make static SCMs to - + * lily/paper-book.cc (stencil2line): protect static SCM. * lily/font-interface.cc (text_font_alist_chain): rename function, and use text-font-defaults. diff --git a/Documentation/user/changing-defaults.itely b/Documentation/user/changing-defaults.itely index 439af71b37..dfb168d04f 100644 --- a/Documentation/user/changing-defaults.itely +++ b/Documentation/user/changing-defaults.itely @@ -625,16 +625,22 @@ all three mechanisms work for every object that supports @itemize @bullet +@item @code{font-encoding} +is a symbol that sets layout of the glyphs. Choices include +@code{text} for normal text, @code{braces} (for piano staff braces), +@code{music} (the standard music font, including ancient glyphs), +@code{dynamic} (for dynamic signs) and @code{number} for the number +font. + + @item @code{font-family} is a symbol indicating the general class of the typeface. Supported are -@code{roman} (Computer Modern), @code{braces} (for piano staff -braces), @code{music} (the standard music font, including ancient -glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}. +@code{roman} (Computer Modern), @code{sans} and @code{typewriter} @item @code{font-shape} - is a symbol indicating the shape of the font, there are typically several - font shapes available for each font family. Choices are @code{italic}, - @code{caps} and @code{upright}. + is a symbol indicating the shape of the font, there are typically +several font shapes available for each font family. Choices are +@code{italic}, @code{caps} and @code{upright}. @item @code{font-series} is a symbol indicating the series of the font. There are typically several diff --git a/input/regression/chord-name-entry.ly b/input/regression/chord-name-entry.ly index 407a1f96e0..fb22a3790a 100644 --- a/input/regression/chord-name-entry.ly +++ b/input/regression/chord-name-entry.ly @@ -34,8 +34,8 @@ c:9_":9" c:11_":11" c:13_":13" c:m13_":m13" -c:7^5_":7\\^{ }5" -c^3_"\\^{ }3" +c:7^5_":7\\^{~}5" +c^3_"\\^{~}3" c/g_"/g" c/gis_"/gis" c/a_"/a" diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index bb7e3a6cb5..a5b5de7de8 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -178,7 +178,7 @@ Dynamic_engraver::process_music () cresc_ = 0; current_cresc_ev_ = 0; } - else if (accepted_spanreqs_drul_[STOP] ) + else if (accepted_spanreqs_drul_[STOP]) { accepted_spanreqs_drul_[STOP]->origin ()->warning (_ ("can't find start of (de)crescendo")); stop_ev = 0; diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index 312f2fbe40..cde3d8ad3d 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -25,9 +25,7 @@ class Audio_item : public Audio_element { public: Audio_item (); - Audio_column* audio_column_; - private: Audio_item (Audio_item const&); diff --git a/lily/span-dynamic-performer.cc b/lily/span-dynamic-performer.cc index caea219c38..edd25919ed 100644 --- a/lily/span-dynamic-performer.cc +++ b/lily/span-dynamic-performer.cc @@ -106,7 +106,6 @@ Span_dynamic_performer::process_music () dynamic_tuples_.push (a); } - if (span_events_[STOP]) { finished_dynamic_tuples_.top ().audio_->volume_ = last_volume_; @@ -116,7 +115,7 @@ Span_dynamic_performer::process_music () { dynamic_tuples_[0].audio_->volume_ = last_volume_; } - span_start_event_ = 0; + span_events_[START] = 0; span_events_[STOP] = 0; } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 3cc5892502..3a59413753 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -310,7 +310,7 @@ (print-function . ,Percent_repeat_item_interface::double_percent) (breakable . #t) (slope . 1.0) - (font-family . music) + (font-encoding . music) (width . 2.0) (thickness . 0.48) (break-align-symbol . staff-bar) @@ -330,7 +330,7 @@ (no-spacing-rods . #t) (script-priority . 100) (font-series . bold) - (font-family . dynamic) + (font-encoding . dynamic) (font-shape . italic) (self-alignment-Y . 0) (meta . ((interfaces . (font-interface text-interface self-alignment-interface dynamic-interface script-interface item-interface)))) @@ -375,20 +375,23 @@ (self-alignment-X . 0) (self-alignment-Y . 0) (script-priority . 100) - (font-family . number) + (font-encoding . number) (font-size . -5) ; don't overlap when next to heads. (font-shape . upright) (meta . ((interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface self-alignment-interface item-interface )))) )) - - (RemoveEmptyVerticalGroup + (Glissando . ( - (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback)) - (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent) - (remove-first . #t) - (axes . (1)) - (meta . ((interfaces . (axis-group-interface hara-kiri-group-interface item-interface spanner-interface)))) + (style . line) + (gap . 0.5) + (zigzag-width . 0.75) + (breakable . #t) + (X-extent-callback . #f) + (Y-extent-callback . #f) + (after-line-breaking-callback . ,Line_spanner::after_line_breaking) + (print-function . ,Line_spanner::print) + (meta . ((interfaces . (line-spanner-interface spanner-interface)))) )) (Hairpin @@ -430,7 +433,6 @@ (break-align-symbol . instrument-name) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) - (font-family . roman) (meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface break-aligned-interface item-interface )))) )) @@ -445,7 +447,6 @@ (break-align-symbol . clef) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) - (font-family . roman) (meta . ((interfaces . (font-interface self-alignment-interface side-position-interface text-interface @@ -511,9 +512,7 @@ (X-offset-callbacks . (,Self_alignment_interface::aligned_on_parent)) (self-alignment-X . 0) (word-space . 0.6) - (font-family . roman) (font-series . bold-narrow) - (font-shape . upright) (font-size . 1.0) (meta . ((interfaces . (rhythmic-grob-interface lyric-syllable-interface self-alignment-interface text-interface font-interface item-interface )))) )) @@ -537,7 +536,6 @@ (direction . 1) (breakable . #t) (font-size . 2) - (font-family . roman) (baseline-skip . 2) (break-visibility . ,end-of-line-invisible) (padding . 0.8) @@ -549,7 +547,6 @@ (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . 1) (breakable . #t) - (font-family . roman) (break-visibility . ,end-of-line-invisible) (padding . 0.8) (meta . ((interfaces . (text-interface side-position-interface font-interface metronome-mark-interface item-interface)))) @@ -588,7 +585,7 @@ (direction . 1) (padding . 1.3) (staff-padding . 1.3) - (font-family . number) + (font-encoding . number) (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface)))) )) (MultiMeasureRestText @@ -601,7 +598,6 @@ (direction . 1) (padding . 1.5) (staff-padding . 1.5) - (font-family . roman) (meta . ((interfaces . (side-position-interface multi-measure-interface self-alignment-interface font-interface spanner-interface text-interface)))) )) (NoteCollision @@ -633,17 +629,15 @@ (meta . ((interfaces . (rhythmic-grob-interface rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface item-interface )))) )) - (Glissando + (NoteSpacing . ( - (style . line) - (gap . 0.5) - (zigzag-width . 0.75) - (breakable . #t) - (X-extent-callback . #f) - (Y-extent-callback . #f) - (after-line-breaking-callback . ,Line_spanner::after_line_breaking) - (print-function . ,Line_spanner::print) - (meta . ((interfaces . (line-spanner-interface spanner-interface)))) + (stem-spacing-correction . 0.5) + + ;; Changed this from 0.75. + ;; If you ever change this back, please document! --hwn + (knee-spacing-correction . 1.0) + + (meta . ((interfaces . (spacing-interface note-spacing-interface item-interface )))) )) (VoiceFollower @@ -661,7 +655,6 @@ (NoteName . ( (print-function . ,Text_item::print) - (font-family . roman) (meta . ((interfaces . (note-name-interface text-interface font-interface item-interface )))) )) @@ -677,7 +670,6 @@ (padding . 0.4) (staff-padding . 0.2) (font-size . -4) - (font-family . roman) (meta . ((interfaces . (text-interface self-alignment-interface side-position-interface font-interface item-interface )))) )) @@ -735,14 +727,13 @@ (print-function . ,Multi_measure_rest::percent) (slope . 1.0) (thickness . 0.48) - (font-family . music) + (font-encoding . music) (meta . ((interfaces . (multi-measure-rest-interface spanner-interface font-interface percent-repeat-interface)))) )) (PianoPedalBracket ;; an example of a text spanner . ( (print-function . ,Piano_pedal_bracket::print) - (font-family . roman) (style . line) (if-text-padding . 1.0) (direction . -1) @@ -753,6 +744,16 @@ (meta . ((interfaces . (line-interface piano-pedal-interface piano-pedal-bracket-interface spanner-interface)))) )) + + (RemoveEmptyVerticalGroup + . ( + (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback)) + (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent) + (remove-first . #t) + (axes . (1)) + (meta . ((interfaces . (axis-group-interface hara-kiri-group-interface item-interface spanner-interface)))) + )) + (RepeatSlash . ( (print-function . ,Percent_repeat_item_interface::beat_slash) @@ -796,7 +797,7 @@ ;; (script-priority . 0) priorities for scripts, see script.scm (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent)) (before-line-breaking-callback . ,Script_interface::before_line_breaking) - (font-family . music) + (font-encoding . music) (meta . ((interfaces . (script-interface side-position-interface font-interface item-interface )))) )) @@ -866,7 +867,6 @@ (StanzaNumber . ((print-function . ,Text_item::print) - (font-family . roman) (font-series . bold) (padding . 1.0) (X-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -881,16 +881,6 @@ (meta . ((interfaces . (spacing-interface staff-spacing-interface item-interface )))) )) - (NoteSpacing - . ( - (stem-spacing-correction . 0.5) - - ;; Changed this from 0.75. - ;; If you ever change this back, please document! --hwn - (knee-spacing-correction . 1.0) - - (meta . ((interfaces . (spacing-interface note-spacing-interface item-interface )))) - )) (SostenutoPedal . ( @@ -899,7 +889,6 @@ (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) (no-spacing-rods . #t) (padding . 0.0) ;; padding relative to SostenutoPedalLineSpanner - (font-family . roman) (font-shape . italic) (self-alignment-X . 0) (meta . ((interfaces . (text-interface self-alignment-interface font-interface item-interface)))) @@ -972,8 +961,7 @@ (X-extent-callback . ,Stem::dim_callback) (Y-extent-callback . ,Stem::height) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) - (font-family . music) - (meta . ((interfaces . (stem-interface font-interface item-interface )))) + (meta . ((interfaces . (stem-interface font-interface item-interface )))) )) (StemTremolo @@ -1037,7 +1025,7 @@ (glyph . "brace") (print-function . ,System_start_delimiter::print) (collapse-height . 5.0) - (font-family . braces) + (font-encoding . braces) (Y-extent-callback . #f) (meta . ((interfaces . (system-start-delimiter-interface font-interface)))) )) @@ -1076,8 +1064,6 @@ (staff-padding . 0.5) (script-priority . 200) ;; todo: add X self alignment? - (baseline-skip . 2) - (font-family . roman) (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface item-interface )))) )) (CombineTextScript @@ -1093,14 +1079,12 @@ (script-priority . 200) ;; todo: add X self alignment? (baseline-skip . 2) - (font-family . roman) (font-series . bold) (meta . ((interfaces . (text-script-interface text-interface side-position-interface font-interface item-interface )))) )) (TextSpanner . ( (print-function . ,Text_spanner::print) - (font-family . roman) (font-shape . italic) (style . dashed-line) (staff-padding . 0.1) @@ -1118,7 +1102,6 @@ (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (print-function . ,Ottava_bracket::print) (font-shape . italic) - (font-family . roman) (shorten-pair . (0.0 . -0.6)) (staff-padding . 1.0) (padding . 0.5) @@ -1133,7 +1116,6 @@ (TabNoteHead . ( - (font-family . roman) (style . default) (print-function . ,Text_item::print) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) @@ -1182,7 +1164,7 @@ (breakable . #t) (style . C) ; (text . (,time-signature-glue-markup)) - (font-family . number) + (font-encoding . number) (meta . ((interfaces . (time-signature-interface break-aligned-interface font-interface item-interface )))) )) @@ -1196,7 +1178,6 @@ (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking) (after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking) (print-function . ,Tuplet_bracket::print) - (font-family . roman) (font-shape . italic) (font-series . bold) @@ -1207,7 +1188,6 @@ (UnaCordaPedal . ( (print-function . ,Text_item::print) - (font-family . roman) (font-shape . italic) (no-spacing-rods . #t) (self-alignment-X . 0) @@ -1243,12 +1223,11 @@ (print-function . ,Volta_bracket_interface::print) (direction . 1) (padding . 1) - (font-family . number) + (font-encoding . number) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (thickness . 1.6) ; linethickness (height . 2.0) ; staffspace; (minimum-space . 5) - (font-family . number) (font-size . -4) (meta . ((interfaces . (volta-bracket-interface line-interface text-interface side-position-interface font-interface spanner-interface)))) )) diff --git a/scm/new-font.scm b/scm/new-font.scm index 847a9100a9..a682fa62e7 100644 --- a/scm/new-font.scm +++ b/scm/new-font.scm @@ -1,6 +1,14 @@ ;; As an excercise, do it with records. ;; Should use GOOPS, really. +;; TODO: +;; +;; lookup-font should be written in C. +;; +;; should dump tree to .texi as internal documentation +;; + + (define font-tree-record (make-record-type "font-tree-node" @@ -114,6 +122,8 @@ (lookup-font (hashq-ref (font-tree-children node) def) alist-chain))) ) + (if (equal? (chain-assoc-get 'font-family alist-chain) 'sans) + (display (list "...........\n" node alist-chain))) font)) (else node)) @@ -170,9 +180,9 @@ (add-font n `((font-encoding . text) - (font-series . ,(vector-ref (car x) 0)) + (font-series . ,(vector-ref (car x) 2)) (font-shape . ,(vector-ref (car x) 1)) - (font-family . ,(vector-ref (car x) 2))) + (font-family . ,(vector-ref (car x) 0))) (cons (* factor (cadr x)) (cddr x)) )) @@ -222,5 +232,7 @@ )) n)) +(display-font-node (make-font-tree 1.0)) + (define-public (magstep x) (exp (* (/ x 6) (log 2)))) -- 2.39.2