]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
73f2268a1d83ba396a24ed3923006b1dce5c1605
[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--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8   
9  */
10
11 #ifndef AFM_HH
12 #define AFM_HH
13
14 #include "string.hh"
15 #include "box.hh"
16 #include "array.hh"
17 #include "dictionary.hh"
18 #include "font-metric.hh"
19 #include "parse-afm.hh"
20
21 struct Adobe_font_metric : Font_metric
22 {
23   AFM_Font_info * font_inf_;
24
25   virtual Box get_char (int) const;
26   AFM_CharMetricInfo const *find_char_metric (String name, bool warn=true) const;
27   AFM_CharMetricInfo const *find_ascii_metric (int, bool warn=true) const;  
28
29   String str () const;
30   ~Adobe_font_metric ();
31   static SCM make_afm (AFM_Font_info*, unsigned);
32
33   unsigned int checksum_;
34 protected:
35   Array<int> ascii_to_metric_idx_;
36   Dictionary<int> name_to_metric_dict_;
37
38   virtual Molecule find_by_name (String) const;
39
40   Adobe_font_metric (AFM_Font_info*);
41 };
42
43 SCM read_afm_file (String fn);
44 Box afm_bbox_to_box (AFM_BBox bb);
45   
46
47 #endif /* AFM_HH */
48