]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/afm.cc
nu wel 58
[lilypond.git] / lily / afm.cc
index 4485349e2995309477f966502986323d55526814..3db634c58985b7d6bd1fdeee0872ac00e012179c 100644 (file)
@@ -9,13 +9,14 @@
 #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,7 +83,7 @@ Adobe_font_metric::find_char_metric (String nm, bool warn) const
 int
 Adobe_font_metric::count () const
 {
-  return ascii_to_metric_idx_.size ();
+  return font_inf_->numOfChars ;
 }
 
 Box
@@ -129,12 +130,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,6 +159,10 @@ 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;