]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/tfm.hh
''
[lilypond.git] / lily / include / tfm.hh
index 685c92120165be802572a07abf744dcb2fd5630c..5d0d2f118947467a9cee42dcd5f464163c9790ff 100644 (file)
@@ -3,16 +3,24 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999 Jan Nieuwenhuizen <janneke@gnu.org>
-  
+  (c) 1999--2002 Jan Nieuwenhuizen <janneke@gnu.org>
+
+
+  revamped code from GNU Fontutils-0.6
+
  */
 
+/*
+  TODO: aren't there standard libs?  Ideally it is better to just link
+  to a C-library.  */
+
 #ifndef TFM_HH
 #define TFM_HH
 
 #include "string.hh"
 #include "array.hh"
 #include "lily-proto.hh"
+#include "font-metric.hh"
 
 /* The type.  */
 typedef long Fix;
@@ -132,35 +140,30 @@ struct Tex_font_char_metric
 
   String str () const;
   Tex_font_char_metric ();
+
+  Box dimensions () const; 
 };
 
 
-class Tex_font_metric
+class Tex_font_metric : public Font_metric
 {
 public:
-  Tex_font_metric ();
-  Tex_font_char_metric find_ascii (int ascii, bool warn=true) const;
+  static  SCM make_tfm (String filename);
+
+  virtual int count () const;
+  virtual Box get_char (int) const;
+  Tex_font_char_metric const *find_ascii (int ascii, bool warn=true) const;
+
   String str () const;
 
-  /// the reader
+
+  
   Tfm_info info_;
   Tfm_header header_;
-  void clear (int n);
-  void read_file (String name);
-
   Array<Tex_font_char_metric> char_metrics_;
   Array<int> ascii_to_metric_idx_;
-
 private:
-  Real get_U32_fix_f (Binary_source_file* input);
-  Real get_U32_fix_scaled_f (Binary_source_file* input);
-  String get_bcpl_str (Binary_source_file* input);
-  void read_header (Binary_source_file* input);
-  void read_params (Binary_source_file* input);
-  void read_char_metrics (Binary_source_file* input);
-  Tex_font_char_metric read_char_metric (Binary_source_file* input, Char_code code);
-  Tex_font_char_metric read_char (Binary_source_file* input);
-  void read_lig_kern_program (Binary_source_file* input, Array <Tfm_ligature>* ligature_arr_p, Array <Tfm_kern>* kern_arr_p);
+  Tex_font_metric ();
 };