]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
release: 1.3.93
[lilypond.git] / lily / lookup.cc
index 166af27043c12223fa57c58a0d667fe424853e7a..62ad7fbb916c52c9ead74cba161b23784bee3172 100644 (file)
@@ -14,7 +14,7 @@
 #include <ctype.h>
 
 #include "lookup.hh"
-#include "debug.hh"
+#include "warn.hh"
 #include "dimensions.hh"
 #include "bezier.hh"
 #include "paper-def.hh"
@@ -27,7 +27,8 @@
 #include "scope.hh"
 #include "molecule.hh"
 
-#include "lily-guile.hh"
+
+#include "ly-smobs.icc"
 
 
 Lookup::Lookup ()
@@ -38,10 +39,33 @@ Lookup::Lookup ()
 Lookup::Lookup (Lookup const& s)
 {
   font_name_ = s.font_name_;
-  afm_l_ = 0;  
+  afm_l_ = 0;
+}
+
+SCM
+Lookup::mark_smob (SCM s)
+{
+  return s;  
 }
 
+int
+Lookup::print_smob (SCM s, SCM p, scm_print_state*)
+{
+  scm_puts ("#<Lookup >#", p);
+  return 1;
+}
+
+
+IMPLEMENT_UNSMOB(Lookup, lookup);
+IMPLEMENT_SIMPLE_SMOBS(Lookup);
+IMPLEMENT_DEFAULT_EQUAL_P(Lookup);
 
+SCM
+Lookup::make_lookup ()
+{
+  Lookup * l = new Lookup;
+  return l->smobbed_self();
+}
 
 
 Molecule
@@ -71,6 +95,7 @@ Lookup::afm_find (String s, bool warn) const
                    gh_int2scm (cm->code),
                    SCM_UNDEFINED));
 
+
   at= fontify_atom (afm_l_,at);
   return Molecule ( afm_bbox_to_box (cm->charBBox), at);
 }
@@ -127,9 +152,7 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash)
 Molecule
 Lookup::blank (Box b) 
 {
-  Molecule m;
-  m.dim_ = b;
-  return m;
+  return Molecule (b, SCM_EOL);
 }
 
 
@@ -222,7 +245,7 @@ sanitise_PS_string (String t)
 }
 
 /**
-
+TODO: move into Text_item. UGH: paper_l argument shoudl be junked.
 */
 Molecule
 Lookup::text (String style, String text, Paper_def *paper_l) 
@@ -244,19 +267,17 @@ Lookup::text (String style, String text, Paper_def *paper_l)
     }
 
   /*
-    UGH.
-  */
-  SCM l = scm_eval (gh_list (ly_symbol2scm ("style-to-cmr"),
-                            ly_str02scm (style.ch_C()),
-                            SCM_UNDEFINED));
+    FIXME !
+   */
   
+  SCM l = scm_assoc (ly_str02scm (style.ch_C()),
+                    scm_eval2 (ly_symbol2scm ("cmr-alist"), SCM_EOL));
+
   if (l != SCM_BOOL_F)
     {
       style = ly_scm2string (gh_cdr(l)) +to_str  ((int)font_h);
     }
 
-  
-
   Font_metric* metric_l = 0;
 
   if (font_mag)