]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tfm.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / tfm.cc
index 1e8dc4fb001c0b4cd7ec81803915aad605a5b62c..9a8d7ee08a2c6289ee4cf4d7444de46e29b63ed6 100644 (file)
@@ -1,12 +1,12 @@
-/*   
+/*
   tfm.cc -- implement Tex_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+
+  (c) 1999--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 
   some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
- */
+*/
 
 #include "file-name.hh"
 #include "tfm.hh"
@@ -40,13 +40,13 @@ Tex_font_char_metric::dimensions () const
       b.set_empty ();
       return b;
     }
-  
+
   Real d = -depth_;
   Real point_constant = 1 PT;
-  
-  return Box (Interval (0, width_* point_constant ),
-             Interval ((d <? height_) * point_constant,
-                       (d >? height_) * point_constant));
+
+  return Box (Interval (0, width_ * point_constant),
+             Interval (min (d, height_) * point_constant,
+                       max (d, height_) * point_constant));
 }
 
 Tex_font_metric::Tex_font_metric ()
@@ -65,10 +65,10 @@ Tex_font_metric::find_ascii (int ascii, bool warn) const
 {
   if (ascii >= 0 && ascii < ascii_to_metric_idx_.size ()
       && ascii_to_metric_idx_[ascii] >= 0)
-    return & char_metrics_[ascii_to_metric_idx_ [ascii]];
+    return &char_metrics_[ascii_to_metric_idx_ [ascii]];
   else if (warn)
     warning (_f ("can't find ascii character: %d", ascii));
-  return &dummy_static_char_metric;  
+  return &dummy_static_char_metric;
 }
 
 /* UGH: glyphs need not be consecutive in TFM. */
@@ -126,4 +126,5 @@ int
 Tex_font_metric::name_to_index (String) const
 {
   assert (false);
+  return 0;
 }