]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
* flower
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
9
10 #ifndef AFM_HH
11 #define AFM_HH
12
13 #include <map>
14
15 #include "array.hh"
16 #include "font-metric.hh"
17 #include "parse-afm.hh"
18
19 class Adobe_font_metric : public Simple_font_metric
20 {
21 public:
22   AFM_Font_info *font_info_;
23   unsigned int checksum_;
24   Real design_size_;
25
26   ~Adobe_font_metric ();
27
28   virtual int name_to_index (String) const;
29   virtual int count () const;
30   virtual int index_to_ascii (int) const;
31   virtual Box get_ascii_char (int) const;
32   virtual Box get_indexed_char (int) const;
33   virtual Offset get_indexed_wxwy (int) const;
34   static SCM make_afm (AFM_Font_info *, unsigned, Real);
35   virtual Real design_size () const;
36   virtual String font_name () const;
37
38 protected:
39   AFM_CharMetricInfo const *find_char_metric (String name) const;
40   AFM_CharMetricInfo const *find_ascii_metric (int) const;
41
42   Array<int> ascii_to_metric_idx_;
43   std::map < String, int> name_to_metric_dict_;
44
45   Adobe_font_metric (AFM_Font_info *);
46 };
47
48 SCM read_afm_file (String);
49 Box afm_bbox_to_box (AFM_BBox);
50
51 #endif /* AFM_HH */
52