]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-item.cc
* input/mozart-hrn3-defs.ly (startGraceContext): Customize grace init.
[lilypond.git] / lily / text-item.cc
index e4320a3dafee35193f2d17989dddc2f79335f832..a63c3784d5000ca9424c1339abb7e7904e5cf079 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
  */
 #include <math.h>
@@ -90,41 +90,24 @@ Text_item::lookup_character (Grob *, Font_metric*fm, SCM char_name)
 Molecule
 Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text)
 {
-#if 0
-  /*
-    Fixme; should be done differently, move to font-interface?
-
-    differently -- how/why?
-   */
-
-  SCM magnification = me->get_grob_property ("font-magnification");
-
-  Font_metric* metric = 0;
-  if (gh_number_p (magnification))
-    {
-
-      Real realmag = pow (1.2, gh_scm2int (magnification));
-      metric = all_fonts_global_p->find_scaled (ly_scm2string (font_name), realmag);
-
-      assert (false);
-    }
-#else
-  SCM magnification = me->get_grob_property ("font-magnification");
-
-  if (gh_number_p (magnification) && gh_scm2double (magnification) > 1)
-    programming_error ("font-magnification disabled");
-#endif
-  
-
   SCM list = scm_list_n (ly_symbol2scm ("text"), text, SCM_UNDEFINED);
   list = fontify_atom (fm, list);
   
   return Molecule (fm->text_dimension (ly_scm2string (text)), list);
 }
 
+/*
+  TODO:
+
+  DOCME.
+
+
+  MARKUP_TEXT must be compound (may not be simple string.)
+  
+ */
 Molecule
 Text_item::markup_text2molecule (Grob *me, SCM markup_text,
-                              SCM alist_chain)
+                                SCM alist_chain)
 {
   SCM sheet = me->paper_l ()->style_sheet_;
   SCM f = ly_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet));
@@ -142,7 +125,7 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
   Axis axis = X_AXIS;
 
   SCM a = ly_assoc_chain (ly_symbol2scm ("axis"), p);
-  if (gh_pair_p (a) && isaxis_b (ly_cdr (a)))
+  if (gh_pair_p (a) && ly_axis_p (ly_cdr (a)))
     axis = (Axis)gh_scm2int (ly_cdr (a));
 
   Real baseline_skip = 0;
@@ -231,20 +214,13 @@ Text_item::markup_text2molecule (Grob *me, SCM markup_text,
   
   if (extent_b)
     {
-#if 0
-      /* Hmm, we're not allowed to change a Molecule's extent? */
-      mol.dim_[axis] = extent;
-      Molecule::ly_set_molecule_extent_x (mol.self_scm (), gh_int2scm (axis),
-                                         ly_cdr (e));
-#else
-      // burp: unpredictable names, these...
+      /* we're not setting extents for unknown reasons. */
       Box b = mol.extent_box ();
       SCM expr = mol.get_expr ();
 
       b[axis] = extent;
       mol = Molecule (b, expr);
-#endif
-       }  
+    }  
   return mol;
 }
 
@@ -270,3 +246,8 @@ Text_item::brew_molecule (SCM smob)
   return mol.smobbed_copy (); 
 }
 
+
+
+ADD_INTERFACE (Text_item,"text-interface",
+  "A scheme markup text",
+  "text align baseline-skip lookup raise kern word-space magnify");