]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/atom.cc
release: 1.3.19
[lilypond.git] / lily / atom.cc
index 00660aac555a6751a9918ae6299a23c231794a73..eccf3b984351df7181b9ef13405cff5127a504e7 100644 (file)
@@ -3,60 +3,36 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
-#include "symbol.hh"
-#include "tex.hh"
+
+#include "atom.hh"
 #include "interval.hh"
-#include "dimen.hh"
 #include "string.hh"
-#include "varray.hh"
+#include "array.hh"
 #include "debug.hh"
+#include "dimensions.hh"
+#include "lookup.hh"
+#include "main.hh"
+#include "global-ctor.hh"
+#include "font-metric.hh"
 
-void
-Atom::print() const
-{
-#ifndef NPRINT
-  DOUT << "texstring: " <<sym_.tex<<"\n";    
-#endif
-}
-
-Box
-Atom::extent() const
+Atom::Atom(SCM s)
 {
-  Box b (sym_.dim);
-  b.translate (off_);
-  return b;
+  func_ = s;
 }
 
-Atom::Atom (Symbol s)
+void
+Atom::fontify (Font_metric * met)
 {
-  sym_=s;
-}
+  SCM desc = ly_quote_scm (met->description ());
+  SCM font_switch = gh_list (ly_symbol2scm ("select-font"),
+                            desc,
+                            SCM_UNDEFINED);
 
+  SCM f =func_;
+  func_ = gh_list (ly_symbol2scm ("string-append"),
+                  font_switch , f,
+                  SCM_UNDEFINED);
 
-String
-Atom::TeX_string() const
-{
-  String tex_str = sym_.tex;
-  Offset off = off_;
-
-  /* infinity checks. */
-  for (int a =X_AXIS; a < NO_AXES; a++)
-    {
-      Axis ax = (Axis)a;
-      if (abs (off[ax]) >= 100 CM)
-       {
-         warning ("ridiculous dimension " + axis_name_str (ax)  + ", " 
-                  +print_dimen(off[ax]));
-         off[ax] = 0.0;
-         tex_str += "\errormark"; 
-       }
-    }
-  // whugh.. Hard coded...
-  String s ("\\placebox{");
-  s += print_dimen (off[Y_AXIS])+"}{";
-  s += print_dimen (off[X_AXIS]) + "}{";
-  s += tex_str + "}";
-  return s;
 }