]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.100.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Oct 2000 09:54:26 +0000 (10:54 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 30 Oct 2000 09:54:26 +0000 (10:54 +0100)
1.3.99.jcn2
===========

* Font initialisation and markup translation fixes.

CHANGES
VERSION
input/test/markup.ly
lily/afm.cc
lily/text-item.cc
scm/element-descriptions.scm
scm/font.scm

diff --git a/CHANGES b/CHANGES
index 4f26feaf91967c4253988248a9926ffdd9404296..6dbcffe5f0e858e4599e7ee5ee692f66f1045b38 100644 (file)
--- 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 b7c53f15f631170ae0ed3dd4b3608f9762bdc21b..d21cd4af30d1e62a64c08f31a482bd1c7d0cbde8 100644 (file)
--- 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.
index 6ca28e3d5d7cdb276f4c2a836230fd9ae4be685d..f64a558d4e4407c3dc9f4e446e164dc9ca8b82cc 100644 (file)
@@ -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
                }
index 1efee6721313570c77390e7045b436721d0fbbd1..1745b683a35ac6c0217b71e5d3766d722367836a 100644 (file)
@@ -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);
index c26d5509c643d500ec510ec2f256aafce8f632e2..b9207108a4f3199dc46fd55bae5ba7070f31bf4d 100644 (file)
@@ -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;
 
index 86781547158210fa18d20c0366d00aa7590c3c38..4ea382e3e70169797668c8c4493c5dab4fe39bf5 100644 (file)
@@ -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 . (
                (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 ))
        ))
                (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))
        ))
 
                (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))
        ))
                (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 . (
                (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 ))
        ))
        
        (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))
                (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 ))
        ))
        
                (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 . (
                  ,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))
        ))
                (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))
        ))
                (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))            
                (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 . (
                (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))
        ))
        (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))
        
                (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))
        ))
 
index deebd5e4c26035145a7e0a251c90c4bff36d259e..2a7d64910b5798861f14dd8e1ab6eef4de816878 100644 (file)
     ((-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")
     ;; 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)))
     )
   )
 
-
-
-(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)
        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?