]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tfm-reader.cc
* lily/lookup.cc (slur): Invoke bezier-bow.
[lilypond.git] / lily / tfm-reader.cc
index 176ecd195ac7a03f8b0be7d973240c84ccf3fee4..c6a7952f9ad21537080d54148b6c643b4139650c 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1999--2002 Jan Nieuwenhuizen <janneke@gnu.org>
   
 
   some code shamelessly copied from GNU fontutils-0.6/tfm/tfm_input.c
@@ -15,7 +15,8 @@
 #include "warn.hh"
 
 #define format_str String_convert::form_str
-#define FIX_UNITY (1 << 20)
+#define FIX_UNITY \
+ (1 << 20)
 static const Real fix_to_real (Fix f);
 
 
@@ -70,7 +71,7 @@ void
 Tex_font_metric_reader::read_header ()
 {
   U16 file_length = input_.get_U16 ();
 (void) file_length;
+ (void) file_length;
   U16 header_length = input_.get_U16 ();
 
   info_.first_charcode = input_.get_U16 ();
@@ -81,9 +82,9 @@ Tex_font_metric_reader::read_header ()
   U16 italic_correction_word_count = input_.get_U16 ();
   U16 lig_kern_word_count = input_.get_U16 ();
   U16 kern_word_count = input_.get_U16 ();
 (void)kern_word_count;
+ (void)kern_word_count;
   U16 extensible_word_count = input_.get_U16 ();
 (void)extensible_word_count;
+ (void)extensible_word_count;
   
   header_.param_word_count = input_.get_U16 ();
   info_.parameter_count = header_.param_word_count;
@@ -102,7 +103,7 @@ Tex_font_metric_reader::read_header ()
   /* We don't care about the extensible table.  */
 
   if (header_length < 2)
-    error (_f ("TFM header of `%s' has only %u word(s)",
+    error (_f ("TFM header of `%s' has only %u word (s)",
               input_.name_str ().ch_C (), header_length));
 
   info_.checksum = input_.get_U32 ();
@@ -113,10 +114,6 @@ Tex_font_metric_reader::read_header ()
   info_.coding_scheme = header_length > 2
     ? get_bcpl_str () : "unspecified";
 
-  DEBUG_OUT << format_str ("TFM checksum = %u, design_size = %fpt, coding scheme = `%s'.\n",
-                     info_.checksum,
-                     info_.design_size,
-                     info_.coding_scheme.ch_C ());
 }
 
 /* Although TFM files are only usable by TeX if they have at least seven
@@ -149,15 +146,11 @@ Tex_font_metric_reader::read_params ()
 
   /* The first parameter is different than all the rest, because it
      isn't scaled by the design size.  */
-  info_.parameters[(TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f ();
+  info_.parameters[ (TFM_SLANT_PARAMETER) - 1] = get_U32_fix_f ();
 
   for (Char_code i = 2; i <= header_.param_word_count; i++)
     info_.parameters[i - 1] = get_U32_fix_scaled_f ();
 
-#ifdef PRINT
-  for (Char_code i = 1; i <= header_.param_word_count; i++)
-    DEBUG_OUT << format_str ("TFM parameter %d: %.3f", i, info_.parameters[i - 1]);
-#endif
 }
 
 /* Read every character in the TFM file, storing the result in the
@@ -229,16 +222,16 @@ Tex_font_metric_reader::read_char ()
 #define GET_CHAR_DIMEN(d) \
    if (d##_index != 0) \
      { \
-       input_.seek_ch_C (header_.##d##_pos + d##_index*4); \
+       input_.seek_ch_C (header_. d##_pos + d##_index*4); \
        tfm_char.d##_fix_ = input_.get_U32 (); \
        tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
                       * info_.design_size; \
      }
 
-  GET_CHAR_DIMEN(width);
-  GET_CHAR_DIMEN(height);
-  GET_CHAR_DIMEN(depth);
-  GET_CHAR_DIMEN(italic_correction);
+  GET_CHAR_DIMEN (width);
+  GET_CHAR_DIMEN (height);
+  GET_CHAR_DIMEN (depth);
+  GET_CHAR_DIMEN (italic_correction);
 
   /* The other condition for a character existing is that it be between
      the first and last character codes given in the header.  We've
@@ -246,13 +239,6 @@ Tex_font_metric_reader::read_char ()
      `char_info_word').  */
   tfm_char.exists_b_ = width_index != 0;
 
-#ifdef PRINT
-  DEBUG_OUT << format_str ("   width = %f, height = %f, ",
-                     tfm_char.width_, tfm_char.height_);
-  DEBUG_OUT << format_str ("depth = %f, ic = %f.\n",
-                     tfm_char.depth, tfm_char.italic_correction); 
-#endif
-
   if (tag == 1)
     {
       input_.seek_ch_C (header_.lig_kern_pos + remainder * 4);
@@ -283,9 +269,6 @@ Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligature_ar
       bool kern_step_b = input_.get_U8 () >= KERN_FLAG;
       U8 remainder = input_.get_U8 ();
 
-#ifdef PRINT
-      DEBUG_OUT << format_str ("   if next = %u (%c), ", next_char, next_char);
-#endif
 
       if (kern_step_b)
        {
@@ -299,9 +282,6 @@ Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligature_ar
 
          kern_arr_p->push (kern_element);
 
-#ifdef PRINT
-         DEBUG_OUT << format_str ("kern %f.\n", kern_element.kern);
-#endif
        }
       else
        {
@@ -310,11 +290,6 @@ Tex_font_metric_reader::read_lig_kern_program (Array <Tfm_ligature>* ligature_ar
          ligature_element.ligature = remainder;
          ligature_arr_p->push (ligature_element);
 
-#ifdef PRINT
-         DEBUG_OUT format_str ("ligature %d (hex %x).\n",
-                          ligature_element.ligature,
-                          ligature_element.ligature);
-#endif
        }
   } while (!end_b);
 }