From c242304638b8cb73b702b29bc37cfca15d0eb397 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 14 Sep 2003 12:26:06 +0000 Subject: [PATCH] * mf/parmesan-clefs.mf: use # quantities for char_box offsets. Fixes overflow errors in the PFA. * scm/new-markup.scm (strut-markup): change calling interface for markup. Pass paper-def, not grob. This would \markup to be used separately from grobs. * lily/paper-def.cc: new function ly:paper-font; this function replaces ly:get-font. * lily/include/font-interface.hh (struct Font_interface): take Paper_def iso. Grob for get_font(). --- ChangeLog | 15 ++++ input/test/time-signature-double.ly | 16 ++-- lily/accidental.cc | 2 +- lily/font-interface.cc | 34 ++------ lily/grob-scheme.cc | 13 +++ lily/include/font-interface.hh | 2 +- lily/include/paper-def.hh | 1 + lily/line-spanner.cc | 2 +- lily/multi-measure-rest.cc | 2 +- lily/paper-def.cc | 37 +++++++- lily/system-start-delimiter.cc | 2 +- lily/text-item.cc | 10 +-- mf/parmesan-clefs.mf | 6 +- scm/new-markup.scm | 127 ++++++++++++++-------------- scripts/convert-ly.py | 12 +++ 15 files changed, 164 insertions(+), 117 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0090e04e1..2f56d462cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2003-09-14 Han-Wen Nienhuys + + * mf/parmesan-clefs.mf: use # quantities for char_box + offsets. Fixes overflow errors in the PFA. + + * scm/new-markup.scm (strut-markup): change calling interface for + markup. Pass paper-def, not grob. This would \markup to be used + separately from grobs. + + * lily/paper-def.cc: new function ly:paper-font; this function + replaces ly:get-font. + + * lily/include/font-interface.hh (struct Font_interface): take + Paper_def iso. Grob for get_font(). + 2003-09-14 Graham Percival * Documentation/user/ tutorial.itely, refman.itely: add warning diff --git a/input/test/time-signature-double.ly b/input/test/time-signature-double.ly index 3843ee2e97..c2186c4cf2 100644 --- a/input/test/time-signature-double.ly +++ b/input/test/time-signature-double.ly @@ -10,27 +10,23 @@ explicitly, but can be faked by overriding formatting routines. " #(define (brew-double-time-sig grob) (define (frac-to-mol font frac) (let* - ( - (d (fontify-text font (number->string (cdr frac)))) + ((d (fontify-text font (number->string (cdr frac)))) (n (fontify-text font (number->string (car frac)))) - (c (ly:molecule-combine-at-edge d Y UP n 0.0)) - ) + (c (ly:molecule-combine-at-edge d Y UP n 0.0)) ) (ly:molecule-align-to! c Y CENTER) c )) (let* - ( - (chain (Font_interface::get_property_alist_chain grob)) - (font (ly:get-font grob chain)) + ((chain (Font_interface::get_property_alist_chain grob)) + (font (ly:paper-get-font (ly:grob-get-paper grob) chain)) (f1 '(6 . 4)) - (musfont (ly:get-font grob (cons (list '(font-relative-size . 2) '(font-family . music)) chain))) + (musfont (ly:paper-get-font (ly:grob-get-paper grob) (cons (list '(font-relative-size . 2) '(font-family . music)) chain))) (plus (ly:molecule-translate-axis (ly:find-glyph-by-name musfont "scripts-stopped") 0.1 Y)) (f2 '(3 . 2)) (m1 (frac-to-mol font f1)) - (m2 (frac-to-mol font f2)) - ) + (m2 (frac-to-mol font f2)) ) (ly:molecule-combine-at-edge diff --git a/lily/accidental.cc b/lily/accidental.cc index cbbbec7f2c..6e5e4aeace 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -184,7 +184,7 @@ Accidental_interface::brew_molecule (SCM smob) (ly_symbol2scm ("font-relative-size"), scm_int2num (-1)), SCM_EOL), ac); - fm = Font_interface::get_font (me, ac); + fm = Font_interface::get_font (me->get_paper (), ac); } else fm = Font_interface::get_default_font (me); diff --git a/lily/font-interface.cc b/lily/font-interface.cc index 45ff8a5a52..d120bd2d0e 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -64,7 +64,7 @@ Font_interface::get_default_font (Grob*me) if (fm) return fm; - fm = get_font (me, font_alist_chain (me)); + fm = get_font (me->get_paper (), font_alist_chain (me)); me->set_grob_property ("font", fm->self_scm ()); return fm; } @@ -80,40 +80,16 @@ LY_DEFINE(ly_font_interface_get_default_font, return Font_interface::get_default_font (gr)->self_scm (); } -LY_DEFINE(ly_font_interface_get_font,"ly:get-font", 2, 0, 0, - (SCM grob, SCM chain), - "Return a font metric satisfying the font-qualifiers in the alist chain @var{chain}.\n" -"\n" -"The font object represents the metric information of a font. Every font\n" -"that is loaded into LilyPond can be accessed via Scheme. \n" -"\n" -"LilyPond only needs to know the dimension of glyph to be able to process\n" -"them. This information is stored in font metric files. LilyPond can read\n" -"two types of font-metrics: @TeX{} Font Metric files (TFM files) and\n" -"Adobe Font Metric files (AFM files). LilyPond will always try to load\n" -"AFM files first since they are more versatile.\n" -"\n" -"An alist chain is a list of alists.\n") -{ - Grob * gr = unsmob_grob (grob); - SCM_ASSERT_TYPE(gr, grob, SCM_ARG1, __FUNCTION__, "grob"); - - Font_metric*fm = Font_interface::get_font (gr, chain); - return fm->self_scm(); -} - Font_metric * -Font_interface::get_font (Grob *me, SCM chain) +Font_interface::get_font (Paper_def *paper, SCM chain) { SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain); if (!gh_pair_p (name) || !gh_string_p (gh_cdr (name))) { - Paper_def * p = me->get_paper (); - - SCM proc = p->lookup_variable (ly_symbol2scm ("properties-to-font")); - SCM fonts = p->lookup_variable (ly_symbol2scm ("fonts")); + SCM proc = paper->lookup_variable (ly_symbol2scm ("properties-to-font")); + SCM fonts = paper->lookup_variable (ly_symbol2scm ("fonts")); assert (gh_procedure_p (proc)); name = gh_call2 (proc, fonts, chain); @@ -126,7 +102,7 @@ Font_interface::get_font (Grob *me, SCM chain) Real rmag = gh_pair_p (mag) && gh_number_p (gh_cdr (mag)) ? gh_scm2double (gh_cdr (mag)) : 1.0; - Font_metric *fm = me->get_paper ()->find_font (name, rmag); + Font_metric *fm = paper->find_font (name, rmag); return fm; } diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index aa3acc9966..eb49ddf153 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -76,6 +76,19 @@ LY_DEFINE (ly_get_paper_var,"ly:get-paper-variable", 2, 0, 0, return sc->get_paper () ->lookup_variable (sym); } +/* TODO: make difference between scaled and unscalead variable in + calling (i.e different funcs.) */ +LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0, + (SCM grob), + "Get \\paper definition from a grob.") +{ + Grob * sc = unsmob_grob (grob); + SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob"); + + return sc->get_paper ()->self_scm (); +} + + LY_DEFINE (ly_get_extent, "ly:get-extent", 3, 0, 0, diff --git a/lily/include/font-interface.hh b/lily/include/font-interface.hh index 8c34e96505..1ebee16316 100644 --- a/lily/include/font-interface.hh +++ b/lily/include/font-interface.hh @@ -16,7 +16,7 @@ struct Font_interface { static SCM font_alist_chain (Grob*); - static Font_metric * get_font (Grob*, SCM alist_chain); + static Font_metric * get_font (Paper_def*, SCM alist_chain); static Font_metric * get_default_font (Grob*); static bool wild_compare (SCM field_val, SCM val); DECLARE_SCHEME_CALLBACK (properties_to_font_name, (SCM,SCM)); diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 5decc40146..76d723a33e 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -76,4 +76,5 @@ public: friend int yyparse (void*); }; +Paper_def * unsmob_paper (SCM x); #endif // Paper_def_HH diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 03a201fa37..ee5c0e9c2c 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -168,7 +168,7 @@ Line_spanner::line_molecule (Grob *me, Real thick, ly_symbol2scm ("music")), SCM_UNDEFINED); - Font_metric *fm = Font_interface::get_font (me, + Font_metric *fm = Font_interface::get_font (me->get_paper (), gh_cons (style_alist, alist_chain)); Molecule m = fm->find_by_name ("scripts-trill-element"); diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 9d7d2c4285..ad4c377b1f 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -136,7 +136,7 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) Real staff_space = Staff_symbol_referencer::staff_space (me); Font_metric *musfont - = Font_interface::get_font (me,alist_chain); + = Font_interface::get_font (me->get_paper (), alist_chain); SCM sml = me->get_grob_property ("use-breve-rest"); if (measures == 1) diff --git a/lily/paper-def.cc b/lily/paper-def.cc index b3568b2dd0..217e337524 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -22,7 +22,6 @@ #include "paper-outputter.hh" #include "ly-modules.hh" - /* This is an almost empty thing. The only substantial thing this class handles, is scaling up and down to real-world dimensions (internally @@ -153,3 +152,39 @@ Paper_def::font_descriptions ()const } return l; } + +/* + Font_interface should be reorganised? +*/ +#include "font-interface.hh" + + +LY_DEFINE(ly_paper_get_font,"ly:paper-get-font", 2, 0, 0, + (SCM paper, SCM chain), + "Return a font metric satisfying the font-qualifiers in the alist chain @var{chain}.\n" +"\n" +"The font object represents the metric information of a font. Every font\n" +"that is loaded into LilyPond can be accessed via Scheme. \n" +"\n" +"LilyPond only needs to know the dimension of glyph to be able to process\n" +"them. This information is stored in font metric files. LilyPond can read\n" +"two types of font-metrics: @TeX{} Font Metric files (TFM files) and\n" +"Adobe Font Metric files (AFM files). LilyPond will always try to load\n" +"AFM files first since they are more versatile.\n" +"\n" +"An alist chain is a list of alists, containing grob properties.\n") +{ + Paper_def *pap = unsmob_paper (paper); + SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "paper definition"); + + Font_metric*fm = Font_interface::get_font (pap, chain); + return fm->self_scm(); +} + +Paper_def* +unsmob_paper (SCM x) +{ + return dynamic_cast (unsmob_music_output_def (x)); +} + + diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 40243c6a8a..dca2d8d27b 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -152,7 +152,7 @@ System_start_delimiter::staff_brace (Grob*me, Real y) SCM sz = gh_cons (ly_symbol2scm ("font-relative-size"), ly_symbol2scm ("*")); SCM alist = scm_list_n (fam, sz, SCM_UNDEFINED); - fm = Font_interface::get_font (me, scm_list_n (alist, SCM_UNDEFINED)); + fm = Font_interface::get_font (me->get_paper (), scm_list_n (alist, SCM_UNDEFINED)); int lo = 0; diff --git a/lily/text-item.cc b/lily/text-item.cc index 0bf318708e..f695a06f50 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -13,17 +13,17 @@ #include "text-item.hh" #include "font-interface.hh" #include "virtual-font-metric.hh" - +#include "paper-def.hh" MAKE_SCHEME_CALLBACK(Text_item,interpret_markup,3); SCM -Text_item::interpret_markup (SCM grob, SCM props, SCM markup) +Text_item::interpret_markup (SCM paper, SCM props, SCM markup) { if (gh_string_p (markup)) { - Grob *me = unsmob_grob (grob); - Font_metric *fm = Font_interface::get_font (me, props); + Paper_def *pap = unsmob_paper (paper); + Font_metric *fm = Font_interface::get_font (pap, props); SCM list = scm_list_n (ly_symbol2scm ("text"), markup, SCM_UNDEFINED); @@ -47,7 +47,7 @@ Text_item::interpret_markup (SCM grob, SCM props, SCM markup) if (!markup_p (markup)) programming_error ("Markup head has no markup signature."); - return scm_apply_2 (func, grob, props, args); + return scm_apply_2 (func, paper, props, args); } else { diff --git a/mf/parmesan-clefs.mf b/mf/parmesan-clefs.mf index 0cdf84899a..e7c603e271 100644 --- a/mf/parmesan-clefs.mf +++ b/mf/parmesan-clefs.mf @@ -111,7 +111,7 @@ def draw_vaticana_fa_clef(expr exact_center, reduction) = draw zd -- ze; %right-handed puncta as in do clef - draw_vaticana_do_clef(exact_center + (0.55reduced_il, 0), reduction); + draw_vaticana_do_clef(exact_center + (0.55reduced_il#, 0), reduction); set_char_box(0 - xpart exact_center, 1.05reduced_il# + xpart exact_center, @@ -228,7 +228,7 @@ def draw_medicaea_fa_clef(expr exact_center, reduction) = draw zc -- zd; %right-handed puncta as in do clef - draw_medicaea_do_clef(exact_center + (0.7reduced_il, 0), reduction); + draw_medicaea_do_clef(exact_center + (0.7reduced_il#, 0), reduction); set_char_box(0 - xpart exact_center, 1.7reduced_il# + xpart exact_center, @@ -936,7 +936,7 @@ fet_endchar; def draw_hufnagel_do_fa_clef(expr exact_center, reduction) = draw_hufnagel_do_clef(exact_center, reduction); - draw_hufnagel_fa_clef(exact_center + (0, -2staff_space), reduction); + draw_hufnagel_fa_clef(exact_center + (0, -2staff_space#), reduction); set_char_box(0 - xpart exact_center, 1.20reduced_il# + xpart exact_center, 1.15reduced_il# + 2staff_space# - ypart exact_center, diff --git a/scm/new-markup.scm b/scm/new-markup.scm index 8781a7304d..1e585aa7ba 100644 --- a/scm/new-markup.scm +++ b/scm/new-markup.scm @@ -1,4 +1,3 @@ - " Internally markup is stored as lists, whose head is a function. @@ -52,8 +51,8 @@ for the reader. ;; syntax, description and example. ;; -(define-public (simple-markup grob props . rest) - (Text_item::interpret_markup grob props (car rest))) +(define-public (simple-markup paper props . rest) + (Text_item::interpret_markup paper props (car rest))) (define-public (stack-molecule-line space molecules) (if (pair? molecules) @@ -72,39 +71,39 @@ for the reader. '()) ) -(define-public (line-markup grob props . rest) +(define-public (line-markup paper props . rest) "A horizontal line of markups. Syntax: \\line << MARKUPS >> " (stack-molecule-line (cdr (chain-assoc 'word-space props)) - (map (lambda (x) (interpret-markup grob props x)) (car rest))) + (map (lambda (x) (interpret-markup paper props x)) (car rest))) ) -(define-public (combine-markup grob props . rest) +(define-public (combine-markup paper props . rest) (ly:molecule-add - (interpret-markup grob props (car rest)) - (interpret-markup grob props (cadr rest)))) + (interpret-markup paper props (car rest)) + (interpret-markup paper props (cadr rest)))) (define (font-markup qualifier value) - (lambda (grob props . rest) - (interpret-markup grob (cons (cons `(,qualifier . ,value) (car props)) (cdr props)) (car rest)) + (lambda (paper props . rest) + (interpret-markup paper (cons (cons `(,qualifier . ,value) (car props)) (cdr props)) (car rest)) )) (define-public (set-property-markup qualifier) - (lambda (grob props . rest ) - (interpret-markup grob + (lambda (paper props . rest ) + (interpret-markup paper (cons (cons `(,qualifier . ,(car rest)) (car props)) (cdr props)) (cadr rest)) )) -(define-public (finger-markup grob props . rest) - (interpret-markup grob +(define-public (finger-markup paper props . rest) + (interpret-markup paper (cons (list '(font-relative-size . -3) '(font-family . number)) props) @@ -140,13 +139,13 @@ for the reader. ;; TODO: baseline-skip should come from the font. -(define-public (column-markup grob props . rest) +(define-public (column-markup paper props . rest) (stack-lines -1 0.0 (cdr (chain-assoc 'baseline-skip props)) - (map (lambda (x) (interpret-markup grob props x)) (car rest))) + (map (lambda (x) (interpret-markup paper props x)) (car rest))) ) -(define-public (dir-column-markup grob props . rest) +(define-public (dir-column-markup paper props . rest) "Make a column of args, going up or down, depending on DIRECTION." (let* ( @@ -155,13 +154,13 @@ for the reader. (stack-lines (if (number? dir) dir -1) 0.0 (cdr (chain-assoc 'baseline-skip props)) - (map (lambda (x) (interpret-markup grob props x)) (car rest))) + (map (lambda (x) (interpret-markup paper props x)) (car rest))) )) -(define-public (center-markup grob props . rest) +(define-public (center-markup paper props . rest) (let* ( - (mols (map (lambda (x) (interpret-markup grob props x)) (car rest))) + (mols (map (lambda (x) (interpret-markup paper props x)) (car rest))) (cmols (map (lambda (x) (ly:molecule-align-to! x X CENTER)) mols)) ) @@ -170,58 +169,58 @@ for the reader. mols) )) -(define-public (right-align-markup grob props . rest) - (let* ((m (interpret-markup grob props (car rest)))) +(define-public (right-align-markup paper props . rest) + (let* ((m (interpret-markup paper props (car rest)))) (ly:molecule-align-to! m X RIGHT) m)) -(define-public (halign-markup grob props . rest) +(define-public (halign-markup paper props . rest) "Set horizontal alignment. Syntax: haling A MARKUP. A=-1 is LEFT, A=1 is right, values in between vary alignment accordingly." - (let* ((m (interpret-markup grob props (cadr rest)))) + (let* ((m (interpret-markup paper props (cadr rest)))) (ly:molecule-align-to! m X (car rest)) m)) -(define-public (left-align-markup grob props . rest) - (let* ((m (interpret-markup grob props (car rest)))) +(define-public (left-align-markup paper props . rest) + (let* ((m (interpret-markup paper props (car rest)))) (ly:molecule-align-to! m X RIGHT) m)) -(define-public (musicglyph-markup grob props . rest) +(define-public (musicglyph-markup paper props . rest) (ly:find-glyph-by-name - (ly:get-font grob (cons '((font-name . ()) (font-family . music)) props)) + (ly:paper-get-font paper (cons '((font-name . ()) (font-family . music)) props)) (car rest)) ) -(define-public (lookup-markup grob props . rest) +(define-public (lookup-markup paper props . rest) "Lookup a glyph by name." (ly:find-glyph-by-name - (ly:get-font grob props) + (ly:paper-get-font paper props) (car rest)) ) -(define-public (char-markup grob props . rest) +(define-public (char-markup paper props . rest) "Syntax: \\char NUMBER. " - (ly:get-glyph (ly:get-font grob props) (car rest)) + (ly:get-glyph (ly:paper-get-font paper props) (car rest)) ) -(define-public (raise-markup grob props . rest) +(define-public (raise-markup paper props . rest) "Syntax: \\raise AMOUNT MARKUP. " (ly:molecule-translate-axis (interpret-markup - grob + paper props (cadr rest)) (car rest) Y)) -(define-public (fraction-markup grob props . rest) +(define-public (fraction-markup paper props . rest) "Make a fraction of two markups. Syntax: \\fraction MARKUP1 MARKUP2." (let* - ((m1 (interpret-markup grob props (car rest))) - (m2 (interpret-markup grob props (cadr rest)))) + ((m1 (interpret-markup paper props (car rest))) + (m2 (interpret-markup paper props (cadr rest)))) (ly:molecule-align-to! m1 X CENTER) (ly:molecule-align-to! m2 X CENTER) @@ -242,7 +241,7 @@ Syntax: \\fraction MARKUP1 MARKUP2." ))) -(define-public (note-markup grob props . rest) +(define-public (note-markup paper props . rest) "Syntax: \\note #LOG #DOTS #DIR. By using fractional values for DIR, you can obtain longer or shorter stems." @@ -251,7 +250,7 @@ for DIR, you can obtain longer or shorter stems." (log (car rest)) (dot-count (cadr rest)) (dir (caddr rest)) - (font (ly:get-font grob (cons '((font-family . music)) props))) + (font (ly:paper-get-font paper (cons '((font-family . music)) props))) (stemlen (max 3 (- log 1))) (headgl (ly:find-glyph-by-name font (string-append "noteheads-" (number->string (min log 2))))) @@ -318,73 +317,73 @@ for DIR, you can obtain longer or shorter stems." stemgl )) -(define-public (normal-size-super-markup grob props . rest) +(define-public (normal-size-super-markup paper props . rest) (ly:molecule-translate-axis (interpret-markup - grob + paper props (car rest)) (* 0.5 (cdr (chain-assoc 'baseline-skip props))) Y) ) -(define-public (super-markup grob props . rest) +(define-public (super-markup paper props . rest) "Syntax: \\super MARKUP. " (ly:molecule-translate-axis (interpret-markup - grob + paper (cons '((font-relative-size . -2)) props) (car rest)) (* 0.5 (cdr (chain-assoc 'baseline-skip props))) Y) ) -(define-public (translate-markup grob props . rest) +(define-public (translate-markup paper props . rest) "Syntax: \\translate OFFSET MARKUP. " - (ly:molecule-translate (interpret-markup grob props (cadr rest)) + (ly:molecule-translate (interpret-markup paper props (cadr rest)) (car rest)) ) -(define-public (sub-markup grob props . rest) +(define-public (sub-markup paper props . rest) "Syntax: \\sub MARKUP." (ly:molecule-translate-axis (interpret-markup - grob + paper (cons '((font-relative-size . -2)) props) (car rest)) (* -0.5 (cdr (chain-assoc 'baseline-skip props))) Y) ) -(define-public (normal-size-sub-markup grob props . rest) +(define-public (normal-size-sub-markup paper props . rest) (ly:molecule-translate-axis (interpret-markup - grob + paper props (car rest)) (* -0.5 (cdr (chain-assoc 'baseline-skip props))) Y) ) -(define-public (hbracket-markup grob props . rest) +(define-public (hbracket-markup paper props . rest) "Horizontal brackets around its single argument. Syntax \\hbracket MARKUP." (let* ( (th 0.1) ;; todo: take from GROB. - (m (interpret-markup grob props (car rest))) + (m (interpret-markup paper props (car rest))) ) (bracketify-molecule m X th (* 2.5 th) th) )) -(define-public (bracket-markup grob props . rest) +(define-public (bracket-markup paper props . rest) "Vertical brackets around its single argument. Syntax \\bracket MARKUP." (let* ( (th 0.1) ;; todo: take from GROB. - (m (interpret-markup grob props (car rest))) + (m (interpret-markup paper props (car rest))) ) (bracketify-molecule m Y th (* 2.5 th) th) )) ;; todo: fix negative space -(define (hspace-markup grob props . rest) +(define (hspace-markup paper props . rest) "Syntax: \\hspace NUMBER." (let* ((amount (car rest))) @@ -393,17 +392,17 @@ for DIR, you can obtain longer or shorter stems." (ly:make-molecule "" (cons amount amount) '(-1 . 1))) )) -(define-public (override-markup grob props . rest) +(define-public (override-markup paper props . rest) "Tack the 1st arg in REST onto PROPS, e.g. \override #'(font-family . married) \"bla\" " - (interpret-markup grob (cons (list (car rest)) props) + (interpret-markup paper (cons (list (car rest)) props) (cadr rest))) -(define-public (smaller-markup grob props . rest) +(define-public (smaller-markup paper props . rest) "Syntax: \\smaller MARKUP" (let* ( @@ -411,11 +410,11 @@ for DIR, you can obtain longer or shorter stems." (entry (cons 'font-relative-size (- fs 1))) ) (interpret-markup - grob (cons (list entry) props) + paper (cons (list entry) props) (car rest)) )) -(define-public (bigger-markup grob props . rest) +(define-public (bigger-markup paper props . rest) "Syntax: \\bigger MARKUP" (let* ( @@ -423,30 +422,30 @@ for DIR, you can obtain longer or shorter stems." (entry (cons 'font-relative-size (+ fs 1))) ) (interpret-markup - grob (cons (list entry) props) + paper (cons (list entry) props) (car rest)) )) -(define-public (box-markup grob props . rest) +(define-public (box-markup paper props . rest) "Syntax: \\box MARKUP" (let* ( (th 0.1) (pad 0.2) - (m (interpret-markup grob props (car rest))) + (m (interpret-markup paper props (car rest))) ) (box-molecule m th pad) )) -(define-public (strut-markup grob props . rest) +(define-public (strut-markup paper props . rest) "Syntax: \strut A box of the same height as the space. " (let* - ((m (Text_item::interpret_markup grob props " "))) + ((m (Text_item::interpret_markup paper props " "))) (ly:molecule-set-extent! m 0 '(1000 . -1000)) m)) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 3b074dd7b2..db608b90f4 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1510,6 +1510,18 @@ def conv (str): conversions.append (((1,9,5), conv, 'HaraKiriVerticalGroup -> RemoveEmptyVerticalGroup')) +def conv (str): + if re.search ("ly:get-font", str): + sys.stderr.write (r"(ly:get-font foo ..) has been replaced by" + \ + " (ly:paper-get-font (ly:grob-get-paper foo) .. ).\n" +\ + "please update manually.") + + raise FatalConversionError() + return str + + +conversions.append (((1,9,6), conv, 'ly:get-font deprecated.')) + ################################ # END OF CONVERSIONS ################################ -- 2.39.2