]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/afm.cc
Some web build fixes. Are we at .58 yet?
[lilypond.git] / lily / afm.cc
index f09d63bad58ce915cad52de595cfcbc345318fdd..2c0256b04634d9a8ba4dab8accc96e3b3906107f 100644 (file)
@@ -3,19 +3,20 @@
   
   source file of the Flower Library
   
-  (c) 2000--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 #include "afm.hh"
 #include "warn.hh"
 #include "molecule.hh"
+#include "dimensions.hh"
 
 Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi)
 {
   checksum_ = 0;
   font_inf_ = fi;
 
-  for (int i= 256; i--;)
+  for (int i= 256  >? fi->numOfChars; i--;)
     ascii_to_metric_idx_.push (-1);
   
   for (int i=0; i < fi->numOfChars; i++)
@@ -82,6 +83,7 @@ Adobe_font_metric::find_char_metric (String nm, bool warn) const
 int
 Adobe_font_metric::count () const
 {
+  // return font_inf_->numOfChars ;
   return ascii_to_metric_idx_.size ();
 }
 
@@ -129,12 +131,16 @@ read_afm_file (String nm)
   return Adobe_font_metric::make_afm (fi, cs);
 }
 
-  
+
+/*
+  actually, AFMs will be printers point, usually, but our .py script dumps
+  real points.
+ */
 Box
 afm_bbox_to_box (AFM_BBox bb)
 {
-  return Box (Interval (bb.llx, bb.urx)* (1/1000.0),
-             Interval (bb.lly, bb.ury)* (1/1000.0));
+  return Box (Interval (bb.llx, bb.urx)* (1/1000.0) PT,
+             Interval (bb.lly, bb.ury)* (1/1000.0) PT);
 
 }
   
@@ -154,12 +160,16 @@ Adobe_font_metric::find_by_name (String s) const
 
   if (!cm)
     {
+      /*
+       Why don't we return empty?
+       */
+      
       Molecule m;
       m.set_empty (false);
       return m;
     }
   
-  SCM at = (scm_listify (ly_symbol2scm ("char"),
+  SCM at = (scm_list_n (ly_symbol2scm ("char"),
                      gh_int2scm (cm->code),
                      SCM_UNDEFINED));