]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/tfm.hh
* lily/include/tie.hh (struct Tie_details): add x_gap_
[lilypond.git] / lily / include / tfm.hh
index 685c92120165be802572a07abf744dcb2fd5630c..32f1222589475a09b36ae0ab3ed274d95e26cf79 100644 (file)
@@ -1,18 +1,23 @@
-/*   
+/*
   tfm.hh -- declare Tex_font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999 Jan Nieuwenhuizen <janneke@gnu.org>
-  
- */
+
+  (c) 1999--2005 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;
@@ -123,46 +128,43 @@ struct Tfm_kern
 
 struct Tex_font_char_metric
 {
-  bool exists_b_;
+  bool exists_;
   Char_code code_;
   Real width_, height_, depth_, italic_correction_;
   Fix width_fix_, height_fix_, depth_fix_, italic_correction_fix_;
-  Array<Tfm_kern> kern_arr_;
-  Array<Tfm_ligature> ligature_arr_;
+  Array<Tfm_kern> kerns_;
+  Array<Tfm_ligature> ligatures_;
 
-  String str () const;
   Tex_font_char_metric ();
-};
 
+  Box dimensions () const;
+};
 
-class Tex_font_metric
+class Tex_font_metric : public Simple_font_metric
 {
 public:
-  Tex_font_metric ();
-  Tex_font_char_metric find_ascii (int ascii, bool warn=true) const;
-  String str () const;
+  static SCM make_tfm (String file_name);
+
+  virtual int count () const;
+  virtual Box get_ascii_char (int) const;
+  virtual Real design_size () const;
+  virtual void derived_mark () const;
+  virtual int name_to_index (String) const;
+  virtual String font_name () const;
 
-  /// the reader
+  Tfm_info const &info () const;
+
+protected:
   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_;
-
+  SCM encoding_table_;
+  String font_name_;
 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_char_metric const *find_ascii (int ascii, bool warn = true) const;
+  Tex_font_metric ();
 };
 
-
 #endif /* TFM_HH */