]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/afm.hh
release: 1.5.29
[lilypond.git] / lily / include / afm.hh
index 8a932d05fc0c988d5fe9921ee85f3a96cad98a43..5679d83279da9a202fd04ae65ceb650f8df52a42 100644 (file)
@@ -1,9 +1,10 @@
+
 /*   
   afm.hh -- declare Adobe_font_metric
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 #include "string.hh"
 #include "box.hh"
 #include "array.hh"
+#include "dictionary.hh"
+#include "font-metric.hh"
+#include "parse-afm.hh"
 
-struct Adobe_font_char_metric {
-  int C_;
-  Real WX_;
-  String N_;
-  Box B_;
-  Box &bbox();
-  String &name();
-  Real &width();
-  int  &code ();
-  
-  String str () const;
-  Adobe_font_char_metric ();
-};
+struct Adobe_font_metric : Font_metric
+{
+  AFM_Font_info * font_inf_;
+
+  virtual int count () const;
+  virtual Box get_char (int) const;
+  AFM_CharMetricInfo const *find_char_metric (String name, bool warn=true) const;
+  AFM_CharMetricInfo const *find_ascii_metric (int, bool warn=true) const;  
 
-struct Adobe_font_metric {
-  String  FontName_;
-  String FullName_;
-  String FamilyName_;
-  String Weight_;
-  Real ItalicAngle_;
-  bool IsFixedPitch_;
-  Box FontBBox_;
-  Real UnderlinePosition_;
-  Real UnderlineThickness_;
-  String Version_;
-  String Notice_;
-  String EncodingScheme_;
-  Array<Adobe_font_char_metric> char_metrics_;
-
-  Adobe_font_char_metric find_char (String name) const;
   String str () const;
-  Adobe_font_metric ();
-};
+  ~Adobe_font_metric ();
+  static SCM make_afm (AFM_Font_info*, unsigned);
+
+  unsigned int checksum_;
+protected:
+  Array<int> ascii_to_metric_idx_;
+  Dictionary<int> name_to_metric_dict_;
 
-Adobe_font_metric read_afm (String fn);
+  virtual Molecule find_by_name (String) const;
 
+  Adobe_font_metric (AFM_Font_info*);
+};
 
+SCM read_afm_file (String fn);
+Box afm_bbox_to_box (AFM_BBox bb);
+  
 
 #endif /* AFM_HH */