#include <ctype.h>
#include "lookup.hh"
-#include "debug.hh"
+#include "warn.hh"
#include "dimensions.hh"
#include "bezier.hh"
#include "paper-def.hh"
#include "scope.hh"
#include "molecule.hh"
-#include "lily-guile.hh"
+
+#include "ly-smobs.icc"
Lookup::Lookup ()
{
afm_l_ = 0;
+ self_scm_ = SCM_EOL;
+ smobify_self ();
}
Lookup::Lookup (Lookup const& s)
{
font_name_ = s.font_name_;
- afm_l_ = 0;
+ self_scm_ = SCM_EOL;
+ afm_l_ = 0;
+ smobify_self ();
+}
+
+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;
}
+SCM
+Lookup::equal_p (SCM a , SCM b)
+{
+ return a == b ? SCM_BOOL_T : SCM_BOOL_F;
+}
+void
+Lookup::do_smobify_self ()
+{
+
+}
+
+IMPLEMENT_UNSMOB(Lookup, lookup);
+IMPLEMENT_SMOBS(Lookup);
+
+SCM
+Lookup::make_lookup ()
+{
+ Lookup * l = new Lookup;
+ SCM ls = l->self_scm_;
+ scm_unprotect_object (ls);
+ return ls;
+}
Molecule
gh_int2scm (cm->code),
SCM_UNDEFINED));
+
at= fontify_atom (afm_l_,at);
return Molecule ( afm_bbox_to_box (cm->charBBox), at);
}
Molecule
Lookup::blank (Box b)
{
- Molecule m;
- m.dim_ = b;
- return m;
+ return Molecule (b, SCM_EOL);
}
}
/**
-
+TODO: move into Text_item. UGH: paper_l argument shoudl be junked.
*/
Molecule
Lookup::text (String style, String text, Paper_def *paper_l)
font_mag = (int)paper_l->get_var ("magnification_" + style);
}
- /*
- UGH.
- */
- SCM l = scm_eval (gh_list (ly_symbol2scm ("style-to-cmr"),
- ly_str02scm (style.ch_C()),
- SCM_UNDEFINED));
-
+ SCM l = scm_assoc (ly_str02scm (style.ch_C()),
+ scm_eval (ly_symbol2scm ("cmr-alist")));
+
if (l != SCM_BOOL_F)
{
style = ly_scm2string (gh_cdr(l)) +to_str ((int)font_h);
}
-
-
Font_metric* metric_l = 0;
if (font_mag)