]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
1e9cf55509dbbcc8feae691d9008593208fc7d60
[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 struct Adobe_font_metric : Font_metric
23 {
24   AFM_Font_info * font_inf_;
25
26   virtual int name_to_index (String) const;
27   virtual int count () const;
28   virtual Box get_ascii_char (int) const;
29   virtual Box get_indexed_char (int) const;
30   virtual Offset get_indexed_wxwy (int) const;
31   
32   AFM_CharMetricInfo const *find_char_metric (String name) const;
33   AFM_CharMetricInfo const *find_ascii_metric (int) const;  
34
35   String to_string () const;
36   ~Adobe_font_metric ();
37   static SCM make_afm (AFM_Font_info*, unsigned);
38
39   unsigned int checksum_;
40 protected:
41   Array<int> ascii_to_metric_idx_;
42   std::map<String,int> name_to_metric_dict_;
43
44   virtual Molecule find_by_name (String) const;
45
46   Adobe_font_metric (AFM_Font_info*);
47 };
48
49 SCM read_afm_file (String fn);
50 Box afm_bbox_to_box (AFM_BBox bb);
51   
52
53 #endif /* AFM_HH */
54