]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/afm.hh
* lily/system.cc (do_derived_mark): don't mark from object_alist_
[lilypond.git] / lily / include / afm.hh
index fea4592ad5fc2ced77e818cccc72dec761ffa9d0..3f815e946127cacd609500fe15d7594cf92e2f13 100644 (file)
@@ -1,67 +1,52 @@
-/*   
+
+/*
   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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef AFM_HH
 #define AFM_HH
 
-#include "string.hh"
-#include "box.hh"
+#include <map>
+
 #include "array.hh"
-#include "dictionary.hh"
 #include "font-metric.hh"
+#include "parse-afm.hh"
+
+class Adobe_font_metric : public Simple_font_metric
+{
+public:
+  AFM_Font_info *font_info_;
+  unsigned int checksum_;
+  Real design_size_;
+
+  ~Adobe_font_metric ();
+
+  virtual int name_to_index (String) const;
+  virtual int count () const;
+  virtual int index_to_ascii (int) const;
+  virtual Box get_ascii_char (int) const;
+  virtual Box get_indexed_char (int) const;
+  virtual Offset get_indexed_wxwy (int) const;
+  static SCM make_afm (AFM_Font_info *, unsigned, Real);
+  virtual Real design_size () const;
+  virtual String font_name () const;
+
+protected:
+  AFM_CharMetricInfo const *find_char_metric (String name) const;
+  AFM_CharMetricInfo const *find_ascii_metric (int) const;
 
-struct Adobe_font_char_metric : Character_metric {
-  int C_;
-  Real WX_;
-  String N_;
-  Box B_;
-  Box &bbox();
-  String &name();
-  Real &width();
-  int  &code ();
-  
-  String str () const;
-  Adobe_font_char_metric ();
-
-  Box dimensions () const;
-};
-
-struct Adobe_font_metric : 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_;
   Array<int> ascii_to_metric_idx_;
-  Dictionary<int> name_to_metric_dict_;
-  
-  Adobe_font_char_metric const &find_char (String name, bool warn=true) const;
-  Adobe_font_char_metric const &find_ascii (int ascii,bool warn) const;
-  String str () const;
-  Adobe_font_metric ();
-  void read_char_metrics (Data_file &input);
-
+  std::map<String, int> name_to_metric_dict_;
 
-  Character_metric *get_char (int, bool) const;
+  Adobe_font_metric (AFM_Font_info *);
 };
 
-Adobe_font_metric read_afm_file (String fn);
-
-
+SCM read_afm_file (String);
+Box afm_bbox_to_box (AFM_BBox);
 
 #endif /* AFM_HH */