From: Jan Nieuwenhuizen Date: Mon, 30 Oct 2000 09:54:26 +0000 (+0100) Subject: patch::: 1.3.100.jcn1 X-Git-Tag: release/1.3.101~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2522fadff41b2b07313c4967a4f85c147fe9b9c4;p=lilypond.git patch::: 1.3.100.jcn1 1.3.99.jcn2 =========== * Font initialisation and markup translation fixes. --- diff --git a/CHANGES b/CHANGES index 4f26feaf91..6dbcffe5f0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.3.99.jcn2 +=========== + +* Font initialisation and markup translation fixes. + 1.3.99.hwn2 =========== diff --git a/VERSION b/VERSION index b7c53f15f6..d21cd4af30 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=100 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/markup.ly b/input/test/markup.ly index 6ca28e3d5d..f64a558d4e 100644 --- a/input/test/markup.ly +++ b/input/test/markup.ly @@ -21,6 +21,7 @@ \translator{ \ScoreContext TextScript \push #'font-family = #'roman + TextScript \push #'font-shape = #'upright TextScript \pop #'no-spacing-rods TextScript \push #'direction = #1 } diff --git a/lily/afm.cc b/lily/afm.cc index 1efee67213..1745b683a3 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -95,7 +95,7 @@ read_afm_file (String nm) if (ok) { - error (_("Error parsing AFM file")); + error (_f ("Error parsing AFM file: %s", nm.ch_C ())); exit (2); } fclose (f); diff --git a/lily/text-item.cc b/lily/text-item.cc index c26d5509c6..b9207108a4 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -105,15 +105,13 @@ Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain) SCM proc = gh_cdr (scm_assoc (ly_symbol2scm ("properties-to-font"), sheet)); SCM font_name = gh_call2 (proc, fonts, alist_chain); -#if 0 - SCM lookup = scm_assoc (ly_symbol2scm ("lookup"), properties); + SCM lookup = ly_assoc_chain (ly_symbol2scm ("lookup"), alist_chain); Molecule mol; if (gh_pair_p (lookup) && ly_symbol2string (gh_cdr (lookup)) == "name") mol = lookup_character (me, font_name, text); else -#endif - Molecule mol = lookup_text (me, font_name, text); + mol = lookup_text (me, font_name, text); return mol; } @@ -163,30 +161,32 @@ Text_item::markup_sentence2molecule (Score_element *me, SCM markup_sentence, { /* FIXME + + huh? */ - return Molecule (); + // return Molecule (); SCM sheet = me->paper_l ()->style_sheet_; - SCM f = gh_cdr (scm_assoc (ly_symbol2scm ("markup-abbrev-to-properties-alist"), sheet)); + SCM f = gh_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet)); SCM markup = gh_car (markup_sentence); SCM sentence = gh_cdr (markup_sentence); - SCM p = gh_cons (gh_call1 (f, markup), alist_chain); + SCM p = gh_cons (gh_call2 (f, sheet, markup), alist_chain); Axis align = X_AXIS; - SCM a = scm_assoc (ly_symbol2scm ("align"), p); + SCM a = ly_assoc_chain (ly_symbol2scm ("align"), p); if (gh_pair_p (a) && gh_number_p (gh_cdr (a))) align = (Axis)gh_scm2int (gh_cdr (a)); Real staff_space = Staff_symbol_referencer::staff_space (me); Real kern = 0; - SCM k = scm_assoc (ly_symbol2scm ("kern"), p); + SCM k = ly_assoc_chain (ly_symbol2scm ("kern"), p); if (gh_pair_p (k) && gh_number_p (gh_cdr (k))) kern = gh_scm2double (gh_cdr (k)) * staff_space; Real raise = 0; - SCM r = scm_assoc (ly_symbol2scm ("raise"), p); + SCM r = ly_assoc_chain (ly_symbol2scm ("raise"), p); if (gh_pair_p (r) && gh_number_p (gh_cdr (r))) raise = gh_scm2double (gh_cdr (r)) * staff_space; diff --git a/scm/element-descriptions.scm b/scm/element-descriptions.scm index 8678154715..4ea382e3e7 100644 --- a/scm/element-descriptions.scm +++ b/scm/element-descriptions.scm @@ -38,9 +38,7 @@ (visibility-lambda . ,begin-of-line-visible) (padding . 1.0) (direction . 1) - (markup-to-properties . ,markup-to-properties) (font-family . roman) - (font-relative-size . -1) (meta . ,(element-description "BarNumber" text-interface font-interface break-aligned-interface)) @@ -91,8 +89,8 @@ (molecule-callback . ,Chord_name::brew_molecule) (after-line-breaking-callback . ,Chord_name::after_line_breaking) (chord-name-function . ,default-chord-name-function) - (markup-to-properties . ,markup-to-properties) - (meta . ,(element-description "ChordNames" font-interface chord-name-interface)) + (font-family . roman) + (meta . ,(element-description "ChordNames" font-interface text-interface chord-name-interface)) )) (NoteCollision . ( @@ -133,8 +131,8 @@ (Y-offset-callbacks . (,Side_position::aligned_on_self)) (molecule-callback . ,Text_item::brew_molecule) (script-priority . 100) - (font-style . dynamic) - (markup-to-properties . ,markup-to-properties) + (font-series . bold) + (font-family . dynamic) (self-alignment-Y . 0) (meta . ,(element-description "DynamicText" font-interface text-interface )) )) @@ -158,9 +156,9 @@ (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self)) (padding . 3.0) (self-alignment-X . 0) - - (font-style . finger) - (markup-to-properties . ,markup-to-properties) + (font-family . number) + (font-relative-size . -3) + (font-shape . upright) (meta . ,(element-description "Fingering" finger-interface font-interface text-script-interface text-interface side-position-interface)) )) @@ -196,7 +194,6 @@ (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Instrument_name) (visibility-lambda . ,begin-of-line-visible) - (markup-to-properties . ,markup-to-properties) (font-family . roman) (meta . ,(element-description "InstrumentName" font-interface text-interface break-aligned-interface)) )) @@ -237,23 +234,20 @@ (self-alignment-X . 0) (non-rhythmic . #t) (word-space . 0.6) - - (markup-to-properties . ,markup-to-properties) (font-family . roman) (font-shape . upright) (font-relative-size . 0) - (meta . ,(element-description "LyricText" lyric-syllable-interface text-interface font-interface )) )) (RehearsalMark . ( - (molecule-callback . ,Text_item::brew_molecule) - (breakable . #t) - (markup-to-properties . ,markup-to-properties) - (font-style . mark) - (visibility-lambda . ,end-of-line-invisible) - (padding . 4.0) - (meta . ,(element-description "RehearsalMark" mark-interface side-position-interface)) + (molecule-callback . ,Text_item::brew_molecule) + (breakable . #t) + (font-family . number) + (font-relative-size . 1) + (visibility-lambda . ,end-of-line-invisible) + (padding . 4.0) + (meta . ,(element-description "RehearsalMark" mark-interface side-position-interface)) )) (MultiMeasureRest . ( @@ -263,8 +257,8 @@ (expand-limit . 10) (padding . 2.0) ; staffspace (minimum-width . 12.5) ; staffspace - (markup-to-properties . ,markup-to-properties) - (font-style . mmrest) + (font-family . number) + (font-relative-size . 1) (meta . ,(element-description "MultiMeasureRest" multi-measure-rest-interface font-interface )) )) @@ -285,7 +279,6 @@ (NoteName . ( (style . default) (molecule-callback . ,Text_item::brew_molecule) - (markup-to-properties . ,markup-to-properties) (meta . ,(element-description "NoteName" note-name-interface font-interface general-element-interface)) @@ -299,8 +292,6 @@ (Y-offset-callbacks . (,Side_position::aligned_side)) (molecule-callback . ,Text_item::brew_molecule) (font-shape . italic) - (markup-to-properties . ,markup-to-properties) - (meta . ,(element-description "OctavateEight" text-interface font-interface )) )) @@ -380,9 +371,8 @@ (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) - (markup-to-properties . ,markup-to-properties) (font-family . roman) -(meta . ,(element-description "StanzaNumber" break-aligned-interface text-interface font-interface)) + (meta . ,(element-description "StanzaNumber" break-aligned-interface text-interface font-interface)) )) (StaffSymbol . ( @@ -399,8 +389,6 @@ ,Side_position::centered_on_parent)) (no-spacing-rods . #t) (font-shape . italic) - (markup-to-properties . ,markup-to-properties) - (self-alignment-X . 0) (meta . ,(element-description "SostenutoPedal" text-interface font-interface)) )) @@ -446,8 +434,8 @@ (self-alignment-X . 0) (X-offset-callbacks . (,Side_position::aligned_on_self)) (Y-offset-callbacks . - (,Side_position::aligned_side - ,Side_position::centered_on_parent)) + (,Side_position::aligned_side + ,Side_position::centered_on_parent)) (meta . ,(element-description "SustainPedal" sustain-pedal-interface side-position-interface font-interface)) )) @@ -474,16 +462,14 @@ (molecule-callback . ,Text_item::brew_molecule) (no-spacing-rods . #t) (padding . 0.5) - (markup-to-properties . ,markup-to-properties) - (font-family . roman) - (font-shape . italic) - (font-relative-size . 0) + (font-family . roman) + (font-shape . italic) + (font-relative-size . 0) (meta . ,(element-description "TextScript" text-script-interface text-interface side-position-interface font-interface )) )) (TextSpanner . ( (molecule-callback . ,Text_spanner::brew_molecule) (font-shape . italic) - (markup-to-properties . ,markup-to-properties) (type . "line") (direction . 1) (meta . ,(element-description "TextSpanner" text-spanner-interface font-interface)) @@ -509,9 +495,8 @@ (break-align-symbol . Time_signature) (visibility-lambda . ,all-visible) (breakable . #t) - (markup-to-properties . ,markup-to-properties) - (font-style . timesig) - (meta . ,(element-description "TimeSignature" time-signature-interface font-interface)) + (font-family . number) + (meta . ,(element-description "TimeSignature" time-signature-interface font-interface)) )) (TupletBracket . ( @@ -520,8 +505,8 @@ (thick . 1.0) (after-line-breaking-callback . ,Tuplet_spanner::after_line_breaking) (molecule-callback . ,Tuplet_spanner::brew_molecule) - (markup-to-properties . ,markup-to-properties) - (font-style . tuplet) + (font-shape . italic) + (font-relative-size . -1) (meta . ,(element-description "TupletBracket" text-interface tuplet-bracket-interface font-interface)) )) @@ -529,7 +514,6 @@ (UnaChordaPedal . ( (molecule-callback . ,Text_item::brew_molecule) (font-shape . italic) - (markup-to-properties . ,markup-to-properties) (no-spacing-rods . #t) (self-alignment-X . 0) (X-offset-callbacks . (,Side_position::aligned_on_self)) @@ -544,12 +528,13 @@ (direction . 1) (padding . 1) - (markup-to-properties . ,markup-to-properties) (font-style . volta) (Y-offset-callbacks . (,Side_position::aligned_side)) (thickness . 1.6) ; stafflinethickness (height . 2.0) ; staffspace; (minimum-space . 25) + (font-family . number) + (font-relative-size . -2) (meta . ,(element-description "VoltaBracket" volta-bracket-interface side-position-interface font-interface)) )) diff --git a/scm/font.scm b/scm/font.scm index deebd5e4c2..2a7d64910b 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -70,9 +70,11 @@ ((-1 medium italic roman cmti 8) . "cmti8") ((0 medium italic roman cmti 10) . "cmti10") ((1 medium italic roman cmti 12) . "cmti12") - ((2 bold upright roman cmbx 10) . "cmbx10") - ((1 bold upright roman cmbx 12) . "cmbx12") ((2 bold upright roman cmbx 14) . "cmbx14") + ((1 bold upright roman cmbx 12) . "cmbx12") + ((0 bold upright roman cmbx 10) . "cmbx10") + ((-1 bold upright roman cmbx 8) . "cmbx8") + ((-2 bold upright roman cmbx 7) . "cmbx7") ((-3 medium upright math msam 10) . "msam10") ((-2 medium upright math msam 10) . "msam10") ((-1 medium upright math msam 10) . "msam10") @@ -168,11 +170,12 @@ ;; FIXME: this is a not-so-cool idea to use ALIGN ;; RAISE, LOOKUP, since they are not proper elt-properties, ;; and might interfere with them. - (markup-abbrev-to-properties-alist + (markup-to-properties . ,markup-to-properties) + (abbreviation-alist . ((rows . ((align . 0))) (lines . ((align . 1))) (roman . ((font-family . roman))) - (music . ((font-family . music))) + (music . ((font-family . music) (font-shape . upright))) (finger . ((font-style . finger))) (bold . ((font-series . bold))) (italic . ((font-shape . italic))) @@ -186,17 +189,6 @@ ) ) - - -(define (font-regexp-to-font-name paper regexp) - (let ((style-sheet (cdr (assoc paper style-sheet-alist)))) - (let loop ((fonts style-sheet)) - (if (string-match regexp (caar fonts)) - (cdar fonts) - (if (pair? (cdr fonts)) - (loop (cdr fonts)) - '()))))) - ;; reduce the font list by successively applying a font-qualifier. (define (qualifiers-to-fontnames qualifiers font-descr-alist) (if (null? qualifiers) @@ -292,19 +284,18 @@ selected) ; return the topmost. )) -(define markup-abbrev-to-properties-alist - (append - (map (lambda (x) (cons (car x) (cons 'font-style (car x)))) - style-to-font-alist))) - -(define (markup-to-properties markup) +(define (markup-to-properties sheet markup) ;;(display "markup: `") - ;;(display markup) + ;;(write markup) ;;(display "'\n") (if (pair? markup) (list markup) - (let ((entry (assoc markup markup-abbrev-to-properties-alist))) - (if entry (cdr entry) + (let ((entry (assoc markup + ;; assoc-chain? + (append (cdr (assoc 'abbreviation-alist sheet)) + (cdr (assoc 'style-alist sheet)))))) + (if entry + (cdr entry) (list (cons markup #t)))))) ; fixme, how's this supposed to work?