]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
*** empty log message ***
[lilypond.git] / lily / include / afm.hh
1
2 /*   
3   afm.hh -- declare Adobe_font_metric
4   
5   source file of the GNU LilyPond music typesetter
6   
7   (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8   
9  */
10
11 #ifndef AFM_HH
12 #define AFM_HH
13
14 #include <map>
15
16 #include "string.hh"
17 #include "box.hh"
18 #include "array.hh"
19 #include "font-metric.hh"
20 #include "parse-afm.hh"
21
22 class Adobe_font_metric : public Simple_font_metric
23 {
24 public:
25   AFM_Font_info *font_info_;
26   unsigned int checksum_;
27   Real design_size_;
28
29   ~Adobe_font_metric ();
30
31   virtual int name_to_index (String) const;
32   virtual int count () const;
33   virtual int index_to_ascii (int) const;
34   virtual Box get_ascii_char (int) const;
35   virtual Box get_indexed_char (int) const;
36   virtual Offset get_indexed_wxwy (int) const;
37   virtual String coding_scheme () const;
38   static SCM make_afm (AFM_Font_info*, unsigned, Real);
39   virtual Real design_size () const;
40
41 protected:
42   AFM_CharMetricInfo const *find_char_metric (String name) const;
43   AFM_CharMetricInfo const *find_ascii_metric (int) const;  
44
45   Array<int> ascii_to_metric_idx_;
46   std::map<String,int> name_to_metric_dict_;
47
48   Adobe_font_metric (AFM_Font_info*);
49 };
50
51 SCM read_afm_file (String);
52 Box afm_bbox_to_box (AFM_BBox);
53   
54 #endif /* AFM_HH */
55