]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Mar 2004 23:24:45 +0000 (23:24 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Mar 2004 23:24:45 +0000 (23:24 +0000)
23 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/changing-defaults.itely
Documentation/user/introduction.itely
Documentation/user/preface.itely
input/regression/spacing-ragged-last.ly [new file with mode: 0644]
lily/duration.cc
lily/engraver.cc
lily/font-metric.cc
lily/font-select.cc
lily/gourlay-breaking.cc
lily/grob-scheme.cc
lily/horizontal-bracket.cc
lily/mark-engraver.cc
lily/moment.cc
lily/music-iterator.cc
lily/rest-collision.cc
lily/slur.cc
lily/stem-tremolo.cc
lily/tie-engraver.cc
ly/declarations-init.ly
make/mutopia-rules.make
scm/font.scm

index 04e9213e3555d70435481db2724725ba1d42c4ba..361b0709372beab42d87fdb312a26eaf41e1ada9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2004-03-25  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/duration.cc (LY_DEFINE): dotcount argument is now optional.
+
+       * input/regression/spacing-ragged-last.ly: new file.
+
+       * lily/gourlay-breaking.cc (do_solve): add raggedlast support for
+       spacing.
+
+       * scm/font.scm: rewrite using GOOPS.
+       
        * lily/context-def.cc (filter_engravers): derefence pointer.
 
        * lily/lily-guile.cc (type_check_assignment): use
index bf4ac1541987f797ee576fdacf0fc3a1adec0d31..9c45fff780fd3254b2317b118e5b64ea157e7811 100644 (file)
@@ -134,13 +134,10 @@ It is shorter, cleaner and faster.  The special construct
 @code{mbinclude} has been removed, plain @code{@@include} or
 @code{\input} can be used now.
 
-@ignore
-It now supports
-running convert-ly on the lilypond snippets like so:
+It now supports running convert-ly on the lilypond snippets,
 @example
     lilypond-book --filter='convert-ly --from=2.0.0' my-book.tely
 @end example
-@end ignore
 
 @item The @code{LyricsVoice} context has been removed. Lyrics should only
 be constructed in @code{Lyrics}.
@@ -168,7 +165,7 @@ performed in a @code{DrumStaff} context:
 result, the syntax has been simplified as well:
 
 @example
-  \autochange @var{the music}
+  \autochange @var{the-music}
 @end example
 
 @item The ergonomic syntax of @code{\markup} now has an equivalent in
@@ -250,7 +247,10 @@ Both have the same effect on the global layout of a piece. Similarly,
 the paper size may be changed as follows
 
 @example
-  #(set-paper-size "a4")
+  #(set-default-paper-size "a4")
+  \paper @{
+    #(set-paper-size "a4")
+  @}
 @end example 
 
 
@@ -308,11 +308,11 @@ expression. For example,
 @end example 
 
 @item Features of spanner contexts, like @code{Staff}, can now be changed
-  using @code{\property}, eg.
+  using @code{\set}, eg.
 
 @example
   \new Staff @{
-       \property Staff.StaffSymbol \set #'line-count = #4
+       \override Staff.StaffSymbol #'line-count = #4
        c'4
   @} 
 @end example
index 0ec0a80c8861d083f462632740925fabec8c20f7..1e3a0575c268ca48a383ff64fab8b5e26e58586c 100644 (file)
@@ -1929,6 +1929,11 @@ spacing is.
 @cindex page layout
 @cindex vertical spacing
 
+The option @code{raggedlast} is similar to @code{raggedright}, but
+only affects the last line of the piece. No restrictions are put on
+that line. The result is similar to formatting paragraphs. In a
+paragraph, the last line simply takes its natural length.
+
 The page layout process happens outside the LilyPond formatting
 engine: variables controlling page layout are passed to the output,
 and are further interpreted by @code{lilypond} wrapper program. It
index ca85187c688ef3eec97d5b3ccb64045afe1d0838..786a44ece074d53c923bb635376085dc3488738e 100644 (file)
@@ -1,10 +1,22 @@
 @c -*-texinfo-*-
 
-
 @node Introduction
 @chapter Introduction
 
-[TODO: should have introduction of introduction]
+This manual 
+
+
+@menu
+* Automated engraving::         
+* What symbols to engrave?::    
+* Music representation::        
+* Example applications::        
+* About this manual::           
+@end menu
+
+
+@node Engraving
+@section Engraving
 
 The art of music typography is called @emph{(plate) engraving}. The
 term derives from the traditional process of music printing. Only a
@@ -160,13 +172,6 @@ see and love to play from.
 
 
 
-@menu
-* Automated engraving::         
-* What symbols to engrave?::    
-* Music representation::        
-* Example applications::        
-* About this manual::           
-@end menu
 
 @node Automated engraving
 @section Automated engraving
index 6ba59df78b26510b46f10d414ada11a9a9a37ac7..8748e65b59f06300ac939e6282e7d64db888aa3f 100644 (file)
 @end menu
 
 
+@node Preface to version 2.2
+@unnumberedsec Preface to version 2.2
+
+During the 2.1 development cycle, the cleanup of the existing features
+has continued unabated. Major areas of change are: orchestral
+notation, lyrics formatting and font size handling.
+
+Han-Wen and Jan
+
+Utrecht/Eindhoven, The Netherlands, March 2003. 
+
+
 @node Preface to version 2.0
 @unnumberedsec Preface to version 2.0
 
diff --git a/input/regression/spacing-ragged-last.ly b/input/regression/spacing-ragged-last.ly
new file mode 100644 (file)
index 0000000..8493e66
--- /dev/null
@@ -0,0 +1,18 @@
+\version "2.1.34"
+
+\header {
+
+    texidoc = "If @code{raggedlast} is set, the systems are broken
+    similar to paragraph formatting in text: the last line is
+    justified. "
+
+         }
+
+
+\score  {
+    \notes \relative c'' \new Staff { \repeat unfold 20 { c1 } }
+    \paper{
+       raggedlast = ##t
+    }
+}
+       
index a85bf11093728113a995f4233a83aac1facf2c21..39fe26ca397f482c892fe694bf621e200d422be6 100644 (file)
@@ -145,11 +145,11 @@ LY_DEFINE (duration_less, "ly:duration<?",
 }
 
 LY_DEFINE (make_duration, "ly:make-duration",
-          2, 2, 0, (SCM length, SCM dotcount, SCM num, SCM den),
+          1, 3, 0, (SCM length, SCM dotcount, SCM num, SCM den),
           "@var{length} is the negative logarithm (base 2) of the duration:\n"
           "1 is a half note, 2 is a quarter note, 3 is an eighth\n"
           "note, etc.  The number of dots after the note is given by\n"
-          "@var{dotcount}.\n"
+          "the optional argument @var{dotcount}.\n"
           "\n"
           "The duration factor is optionally given by @var{num}\n"
           "and @var{den}.\n\n"
@@ -158,8 +158,16 @@ LY_DEFINE (make_duration, "ly:make-duration",
           "(whole, half, quarter, etc.) and a number of augmentation\n"
           "dots. \n")
 {
-  SCM_ASSERT_TYPE (gh_number_p (length), length, SCM_ARG1, __FUNCTION__, "integer");
-  SCM_ASSERT_TYPE (gh_number_p (dotcount), dotcount, SCM_ARG2, __FUNCTION__, "integer");
+  SCM_ASSERT_TYPE (scm_integer_p (length) == SCM_BOOL_T,
+                  length, SCM_ARG1, __FUNCTION__, "integer");
+
+  int dots = 0;
+  if (dotcount != SCM_UNDEFINED)
+    {
+      SCM_ASSERT_TYPE (scm_integer_p (dotcount) == SCM_BOOL_T,
+                      dotcount, SCM_ARG2, __FUNCTION__, "integer");
+      dots = gh_scm2int (dotcount);
+    }
 
   bool compress = false;
   if (num != SCM_UNDEFINED)
@@ -178,7 +186,7 @@ LY_DEFINE (make_duration, "ly:make-duration",
   else
     den = gh_int2scm (1);
 
-  Duration p (gh_scm2int (length), gh_scm2int (dotcount));
+  Duration p (gh_scm2int (length), dots);
   if (compress)
     p = p.compressed (Rational (gh_scm2int (num), gh_scm2int (den)));
 
index 044908680ce58da9a0c7cc65d7ecba694cb1b237..4119670e7a7948b6045fa79600cbf9228b499508 100644 (file)
@@ -37,10 +37,6 @@ Engraver::announce_grob (Grob_info inf)
 void
 Engraver::announce_grob (Grob* e, SCM cause)
 {
-  /*
-    TODO: junk grob-info, and make a cause grob-property to store
-    `causes' generically.
-  */
   if (unsmob_music (cause) || unsmob_grob (cause))
     e->set_property ("cause", cause);
 
index e125775587b71dadd70e277aa72efb181e58e8ff..fb041fe3daeb2f8ca786def8dd3b545e3c0d302a 100644 (file)
@@ -178,7 +178,6 @@ LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0,
 
   /*
     TODO: make optional argument for default if not found.
-    
    */
   return m.smobbed_copy ();
 }
index ae78641b11419f340200ee6dc923abdd043e25a9..26d3cad0d39dec92896ef282d5f6d3020281b660 100644 (file)
@@ -117,10 +117,10 @@ select_font (Paper_def *paper, SCM chain)
   
       return paper->find_font (name, rmag);
     }
-  else if (gh_pair_p (name)) // (DEFAULT . FONT-VEC) pair
+  else if (scm_instance_p (name))
     {
-      SCM vec = gh_cdr (name);
-      SCM base_size = gh_car (name);
+      SCM base_size  = scm_slot_ref (name, ly_symbol2scm ("default-size"));
+      SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
       
       SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
       Real req = 0.0;
index 2b935037ddb4e1ad6c18c4be9e69468b842bafaa..93192d1a289ad5fc0927f108de501fac7e257e99 100644 (file)
@@ -79,6 +79,9 @@ Gourlay_breaking::do_solve () const
   Break_node first_node ;
   optimal_paths.push (first_node);
 
+  bool ragged_right = to_boolean (pscore_->paper_->get_scmvar ("raggedright"));
+  bool ragged_last = to_boolean (pscore_->paper_->get_scmvar ("raggedlast"));
+
   Real worst_force = 0.0;
   for (int break_idx = 1; break_idx< breaks.size (); break_idx++) 
     {
@@ -92,13 +95,11 @@ Gourlay_breaking::do_solve () const
       
       Real minimal_demerits = infinity_f;
 
-      bool ragged = to_boolean (pscore_->paper_->get_scmvar ("raggedright"));
-
       for (int start_idx = break_idx; start_idx--;)
        {
          Link_array<Grob> line = all.slice (breaks[start_idx], breaks[break_idx]+1);
   
-         line[0]     = dynamic_cast<Item*> (line[0])    ->find_prebroken_piece (RIGHT);
+         line[0]     = dynamic_cast<Item*> (line[0])->find_prebroken_piece (RIGHT);
          line.top () = dynamic_cast<Item*> (line.top ())->find_prebroken_piece (LEFT);
            
          Column_x_positions cp;
@@ -107,9 +108,17 @@ Gourlay_breaking::do_solve () const
          Interval line_dims
            = pscore_->paper_->line_dimensions_int (optimal_paths[start_idx].line_);
          Simple_spacer * sp = generate_spacing_problem (line, line_dims);
+         bool last_line = break_idx == breaks.size ()-1;
+         bool ragged = ragged_right
+           || (last_line && ragged_last);
+         
          sp->solve (&cp, ragged);
+         
          delete sp;
 
+         if (ragged && last_line)
+           cp.force_ = 0.0;
+         
          if (fabs (cp.force_) > worst_force)
            worst_force = fabs (cp.force_);
 
index 587a692c3835cc44472e3cf848c59fe56c544982..77cc5d914e5a46f0fd4da53a57ee773424176bfe 100644 (file)
@@ -147,8 +147,8 @@ LY_DEFINE (get_broken_into, "ly:spanner-broken-into",
   SCM_ASSERT_TYPE (me, spanner, SCM_ARG1, __FUNCTION__, "spanner");
 
   SCM s = SCM_EOL;
-  for (int i = me->broken_intos_.size (); i; i--)
-    s = gh_cons (me->broken_intos_[i-1]->self_scm (), s);
+  for (int i = me->broken_intos_.size (); i--;)
+    s = gh_cons (me->broken_intos_[i]->self_scm (), s);
   return s;
 }
 
index fdbdd058791035ec75cadbc6347b31a51b13ed22..4961721496ee18c0939e96fdfc7ac52b5e7420be 100644 (file)
@@ -27,9 +27,7 @@ struct Horizontal_bracket
   This doesn't look very elegant: should support winged edges.
 
   Support texts on the brackets?
-
 */
-
 MAKE_SCHEME_CALLBACK (Horizontal_bracket, print, 1);
 
 SCM
index 3dc5cda20944957eca91270c9c4151bace49e5fe..ade82a0c23e3d84c8060e6b5539178f5ce70d3e6 100644 (file)
@@ -96,11 +96,7 @@ Mark_engraver::try_music (Music* r)
 
 
 /*
-
   TODO: make the increment function in Scheme.
-
-
-  TODO: junk the number type for rehearsalMark
 */
 void
 Mark_engraver::process_music ()
index 57fc8b65352df592feab2def87fa51928bc006e3..a180bedd6cb26e02922a60c3312ac02a2225480a 100644 (file)
@@ -41,8 +41,9 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *)
 /*
   TODO: add optional factor argument.
 */
-LY_DEFINE (make_moment,"ly:make-moment", 2,0,0, (SCM n, SCM d),
-          "Create the rational number with main timing @var{n}/@var{d}. \n"
+LY_DEFINE (make_moment,"ly:make-moment", 2,2,0, (SCM n, SCM d, SCM gn, SCM gd),
+          "Create the rational number with main timing @var{n}/@var{d}, "
+          "and optional grace timin @var{gn}/@var{gd}.\n"
           "\n"
           "\n"
           "Moment is a point in musical time. It is consists of a pair of\n"
@@ -54,7 +55,22 @@ LY_DEFINE (make_moment,"ly:make-moment", 2,0,0, (SCM n, SCM d),
   SCM_ASSERT_TYPE (SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer");
   SCM_ASSERT_TYPE (SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer");
 
-  return Moment (Rational (gh_scm2int (n), gh_scm2int (d))).smobbed_copy ();
+  int grace_num = 0;
+  if (gn != SCM_UNDEFINED)
+    {
+      SCM_ASSERT_TYPE (SCM_INUMP (gn), gn, SCM_ARG3, __FUNCTION__, "integer");
+      grace_num = gh_scm2int (gn);
+    }
+
+  int grace_den = 1;
+  if (gd != SCM_UNDEFINED)
+    {
+      SCM_ASSERT_TYPE (SCM_INUMP (gd), gd, SCM_ARG4, __FUNCTION__, "integer");
+      grace_den = gh_scm2int (gd);
+    }
+
+  return Moment (Rational (gh_scm2int (n), gh_scm2int (d)),
+                Rational (grace_num, grace_den)).smobbed_copy ();
 }
 
 LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b),
index 43e28e3ebde725b92cdeefe065d1410acc2aca41..14bbebebd9da988d5d048aaf1efa1c3b997b6ce6 100644 (file)
@@ -150,7 +150,7 @@ Music_iterator::get_iterator (Music *m) const
 }
 
 /*
-  TODO: rename to prevent confusion between Translator::try_music and
+  TODO: rename to prevent confusion between Context::try_music and
   Iterator::try_music
   
  */
index 9bdfad3cc9116cc13aa4439eb3e62d65ae541021..c815db634efbd875f3576f7969c4a969f54b4d76 100644 (file)
@@ -75,11 +75,8 @@ head_characteristic (Grob * col)
 }
 
 /*
-  TODO: fixme, fucks up if called twice on the same set of rests.
-
   TODO: look at horizontal-shift to determine ordering between rests
   for more than two voices.
-
   
  */
 SCM
index d5ffc85aada89f42b25b35ff6c46d004a32412d3..5a34e272f46b92c64c590c463aa556e618b539db 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  slur.cc -- implement  Slur
+  slur.cc -- implement Slur
 
   source file of the GNU LilyPond music typesetter
 
index 4eae91b91f8a0aff0a7ae34f1ed76e15f5168a81..abee9361b67b35e404bb1b3345b625c1df390ad6 100644 (file)
@@ -141,10 +141,6 @@ Stem_tremolo::print (SCM grob)
   // ugh, rather calc from Stem_tremolo_req
   int beam_count = (beam) ? (Stem::beam_multiplicity (stem).length () + 1): 0;
 
-  /*
-    TODO.
-   */
-
 
   Real beamthickness = 0.0;
   SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
index b176a34092670af11224b6008212e009e1e8b1ca..a1df498c98f356877b2cf7a56c44538167b20819 100644 (file)
@@ -27,8 +27,6 @@
 
    TODO: Remove the dependency on musical info. We should tie on the
    basis of position and duration-log of the heads (not of the events).
-
-   TODO: support sparseTies.
 */
 class Tie_engraver : public Engraver
 {
index c2b185f66e44ef87cd1ac3a6d148afc1fe8ff3a6..00ae0f46f619c4239768459c733667501854fac7 100644 (file)
@@ -52,6 +52,7 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
     cm = #(* 10 mm)
 
     raggedright = ##f
+    raggedlast = ##f 
     packed = ##f
     #(define $is-paper #t)
     
index af73902b9719b4b0042c182038be6465894e9b4f..b9452646f8a663757385869fcfe59d807bba20ac 100644 (file)
@@ -20,7 +20,7 @@ $(outdir)/%.ly: %.abc
        $(PYTHON) $(ABC2LY) --strict -o $@ $< 
 
 $(outdir)/%.dvi: $(outdir)/%.ly
-       $(PYTHON) $(LY2DVI) --output=$@ --dependencies $< 
+       $(PYTHON) $(LY2DVI) --output=$@ --dependencies $<  
 
 # don't junk intermediate .dvi files.  They're easier to view than
 # .ps or .png
index 15c48da40e9d150a620e0c61f9ceae897831cafc..ec561cc5abd66b55c36a4c80449041e2261b2086 100644 (file)
@@ -7,40 +7,74 @@
 ;;
 ;; should dump tree to .texi as internal documentation
 ;; 
-;; * should extract design sizes from fonts.
+;; * should extract design sizes from fonts: fonts should 
+;; be read off the disk, on demand, something like:
+;;  
+;; cmr -> ((font-load "cmr6") (font-load "cmr8")  .. )
+;;
+
+(define-class <Font-tree-element>
+  ()
+  )
 
-(define font-tree-record
-  (make-record-type
-   "font-tree-node"
-   '(qualifier default children)))
+(define-class <Font-tree-leaf> (<Font-tree-element>)
+  (default-size #:init-keyword #:default-size)
+  (size-vector  #:init-keyword #:size-vector))
 
-(define-public font-tree-node?
-  (record-predicate font-tree-record))
-(define-public font-tree-default
-  (record-accessor font-tree-record 'default))
-(define-public font-tree-qualifier
-  (record-accessor font-tree-record 'qualifier))
-(define-public font-tree-children
-  (record-accessor font-tree-record 'children))
+(define-class <Font-tree-node> (<Font-tree-element>)
+  (qualifier #:init-keyword #:qualifier  #:accessor font-qualifier)
+  (default #:init-keyword #:default #:accessor font-default)
+  (children #:init-keyword #:children #:accessor font-children))
 
+(define (make-font-tree-leaf size size-font-vector)
+  (make <Font-tree-leaf> #:default-size size #:size-vector size-font-vector))
 
 (define (make-font-tree-node
         qualifier default)
-  ((record-constructor font-tree-record)
-    qualifier
-    default
-    (make-hash-table 11)))             ;ugh. hardcoded.
+  (make <Font-tree-node>
+     #:qualifier qualifier
+     #:default default 
+     #:children (make-hash-table 11)))
+
+(define-method (display (leaf <Font-tree-leaf>) port)
+  (map (lambda (x) (display x port))
+   (list
+    "Font-size-family: \n"
+     (slot-ref leaf 'default-size) 
+     (slot-ref leaf 'size-vector) )))
+  
+(define-method (display (node <Font-tree-node>) port)
+  
+    (map
+     (lambda (x)
+       (display x port))
+     
+     (list
+      "Font_node { \nqual: "
+      (font-qualifier node)
+      "(def: "
+      (font-default node)
+      ") {\n"))
+    (for-each 
+     (lambda (x)
+       (display "\n")
+       (display (car x) port)
+       (display "=" port)
+       (display (cdr x) port))
+     (hash-table->alist (font-children node)))
+    (display "} } \n"))
+
+
 
 (define default-qualifier-order
   '(font-encoding font-family font-shape font-series))
 
-
-(define-public (add-font node fprops size-family)
+(define-method (add-font (node <Font-tree-node>) fprops size-family)
   (define (assoc-delete key alist)
     (assoc-remove! (list-copy alist) key))
   (define (make-node fprops size-family)
     (if (null? fprops)
-       size-family
+       (make-font-tree-leaf (car size-family) (cdr size-family))
        (let*
            ((qual (next-qualifier default-qualifier-order fprops)))
          (make-font-tree-node qual
          (next-qualifier (cdr order) props))
       )))
 
-  (if (font-tree-node? node)
-      (let*
-         ((q (font-tree-qualifier node))
-          (d (font-tree-default node))
-          (v (assoc-get q fprops d))
-          (new-fprops (assoc-delete q fprops))
-          (child (hashq-ref (font-tree-children node)
-                            v #f)))
+  (let*
+      ((q (font-qualifier node))
+       (d (font-default node))
+       (v (assoc-get q fprops d))
+       (new-fprops (assoc-delete q fprops))
+       (child (hashq-ref (slot-ref node 'children)
+                        v #f)))
 
 
-       (if (not child)
-           (begin
-             (set! child (make-node new-fprops size-family))
-             (hashq-set! (font-tree-children node) v child)))
+    (if (not child)
+       (begin
+         (set! child (make-node new-fprops size-family))
+         (hashq-set! (slot-ref node 'children) v child)))
+    (if (pair? new-fprops)
+       (add-font child new-fprops size-family))))
 
-       (add-font child new-fprops size-family))
-      (if (not (equal? size-family node))
-         (throw 'invalid-font props size-family)))
-  )
 
-(define-public (display-font-node node . rest)
-  (let*
-      ((port (if (pair? rest) (car rest) (current-output-port)))
-       )
-    (cond
-     ((font-tree-node? node)
-      (map
-       (lambda (x)
-        (display x port))
-       
-       (list
-       "Font_node { \nqual: "
-       (font-tree-qualifier node)
-       "(def: "
-       (font-tree-default node)
-       ") {\n"))
-      (for-each 
-       (lambda (x)
-        (display "\n")
-        (display (car x) port)
-        (display "=" port)
-        (display-font-node (cdr x) port))
-       (hash-table->alist (font-tree-children node)))
-      (display "} } \n"))
+(define-method (add-font (node <Font-tree-leaf>) fprops size-family)
+  (throw "must add to node, not leaf"))
 
-     (else
-      (display node port))))
-  )
 
-(define-public (lookup-font node alist-chain)
-  (cond
-   ((font-tree-node? node)
-    (let*
-       ((qual (font-tree-qualifier node))
-        (def (font-tree-default node))
+(define-method (g-lookup-font (node <Font-tree-node>) alist-chain)
+  (let*
+       ((qual (font-qualifier node))
+        (def (font-default node))
         (val (chain-assoc-get qual alist-chain def))
         (desired-font (lookup-font
-                       (hashq-ref (font-tree-children node)
+                       (hashq-ref (font-children node)
                                   val) alist-chain))
+
+        (default (hashq-ref (font-children node) def))
         (font (if desired-font
                   desired-font
-                  (lookup-font (hashq-ref (font-tree-children node)
+                  (g-lookup-font (hashq-ref (font-children node)
                                           def) alist-chain)))
         )
       font))
-   (else node)))
+
+(define-method (g-lookup-font (node <Font-tree-leaf>) alist-chain)
+  node)
+
+(define (lookup-font node alist-chain)
+  (g-lookup-font node alist-chain))
+
 
 (define-public (make-font-tree factor)
   (let*
        ))
     n))
 
+; (display (make-font-tree 1.0))
+
 (define-public (magstep x)
   (exp (* (/ x 6) (log 2))))