]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/virtual-font-metric.cc
* lily/dots.cc (print): replace -
[lilypond.git] / lily / virtual-font-metric.cc
index 9c679e6adedef632c616685c0611b8ca1d5d984f..a2fd658558fc7913a325682b0e4d9e4895476ec9 100644 (file)
@@ -7,15 +7,15 @@ source file of the GNU LilyPond music typesetter
 
  */
 
-#include "warn.hh"
 #include "virtual-font-metric.hh"
+
 #include "all-font-metrics.hh"
 #include "stencil.hh"
-#include "paper-def.hh"
-
+#include "output-def.hh"
+#include "warn.hh"
 
 /*
-  passing DEF is ughish. Should move into paperdef?
+  passing DEF is ughish. Should move into layoutdef?
   */
 Virtual_font_metric::Virtual_font_metric (SCM font_list)
 {
@@ -26,18 +26,18 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list)
   SCM name_list = SCM_EOL;
   SCM *name_tail = &name_list;
   
-  for (SCM s = font_list; gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list; scm_is_pair (s); s = scm_cdr (s))
     {
-      if (Font_metric *fm = unsmob_metrics (gh_car (s)))
+      if (Font_metric *fm = unsmob_metrics (scm_car (s)))
        {
-         *tail =  scm_cons (gh_car (s),SCM_EOL);
+         *tail =  scm_cons (scm_car (s),SCM_EOL);
          tail = SCM_CDRLOC (*tail);
 
-         if (!gh_number_p (mag))
+         if (!scm_is_number (mag))
            /* Ugh.  */
-           mag = gh_cdr (fm->description_);
+           mag = scm_cdr (fm->description_);
 
-         *name_tail = scm_cons (gh_car (fm->description_), SCM_EOL);
+         *name_tail = scm_cons (scm_car (fm->description_), SCM_EOL);
          name_tail = SCM_CDRLOC (*name_tail);
        }
     }
@@ -48,7 +48,7 @@ Virtual_font_metric::Virtual_font_metric (SCM font_list)
 Real 
 Virtual_font_metric::design_size () const
 {
-  return unsmob_metrics (gh_car (font_list_))-> design_size ();
+  return unsmob_metrics (scm_car (font_list_))-> design_size ();
 }
 
 void
@@ -61,8 +61,8 @@ int
 Virtual_font_metric::count () const
 {
   int k = 0;
-  for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
-      k += unsmob_metrics (gh_car (s))->count ();
+  for (SCM s = font_list_; scm_is_pair (s); s = scm_cdr (s))
+      k += unsmob_metrics (scm_car (s))->count ();
   return k;
 }
 
@@ -70,10 +70,8 @@ Stencil
 Virtual_font_metric::find_by_name (String glyph) const
 {
   Stencil m;  
-  for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
-    {
-      m = unsmob_metrics (gh_car (s))->find_by_name (glyph);
-    }
+  for (SCM s = font_list_; m.is_empty () && scm_is_pair (s); s = scm_cdr (s))
+    m = unsmob_metrics (scm_car (s))->find_by_name (glyph);
 
   return m;
 }
@@ -96,9 +94,9 @@ Offset
 Virtual_font_metric::get_indexed_wxwy (int code)  const
 {
   int total = 0;
-  for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Font_metric *fm = unsmob_metrics (gh_car (s));
+      Font_metric *fm = unsmob_metrics (scm_car (s));
       if (code < total + fm->count ())
        return fm->get_indexed_wxwy (code - total);
       total += fm->count ();
@@ -110,9 +108,9 @@ Box
 Virtual_font_metric::get_indexed_char (int code)  const
 {
   int total = 0;
-  for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Font_metric *fm = unsmob_metrics (gh_car (s));
+      Font_metric *fm = unsmob_metrics (scm_car (s));
       if (code < total + fm->count ())
        return fm->get_indexed_char (code - total);
       total += fm->count ();
@@ -125,9 +123,9 @@ Virtual_font_metric::name_to_index (String glyph) const
 {
   Stencil m;
   int total = 0; 
-  for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; m.is_empty () && scm_is_pair (s); s = scm_cdr (s))
     {
-      Font_metric *m =unsmob_metrics (gh_car (s));
+      Font_metric *m = unsmob_metrics (scm_car (s));
       int k = m->name_to_index (glyph);
       if (k >= 0)
        return total + k;
@@ -143,9 +141,9 @@ Virtual_font_metric::get_indexed_char_stencil (int code)  const
   Stencil  m ;  
   int total = 0;
   
-  for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = font_list_; scm_is_pair (s); s = scm_cdr (s))
     {
-      Font_metric *fm = unsmob_metrics (gh_car (s));
+      Font_metric *fm = unsmob_metrics (scm_car (s));
       if (code < total + fm->count ())
        {
          /* Ugh.  */
@@ -166,16 +164,16 @@ Virtual_font_metric::get_font_list () const
 
 LY_DEFINE (ly_make_virtual_font, "ly:make-virtual-font", 0, 0, 1,
           (SCM args),
-          "Make a virtual font metric from @var{args}, a list of font objects.")
+          "Make a virtual font metric from @var{args}, "
+          "a list of font objects.")
 {
-  Virtual_font_metric *fm = new  Virtual_font_metric (args);
-
+  Virtual_font_metric *fm = new Virtual_font_metric (args);
   return scm_gc_unprotect_object (fm->self_scm ());
 }
 
 String
 Virtual_font_metric::coding_scheme () const
 {
-  Font_metric *fm = unsmob_metrics (gh_car (font_list_));
+  Font_metric *fm = unsmob_metrics (scm_car (font_list_));
   return fm->coding_scheme ();
 }