]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
* buildscripts/mf-to-table.py (base): add DesignSize comment.
[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, Real);
38
39   unsigned int checksum_;
40   Real design_size_;
41 protected:
42   Array<int> ascii_to_metric_idx_;
43   std::map<String,int> name_to_metric_dict_;
44
45   virtual Stencil find_by_name (String) const;
46
47   Adobe_font_metric (AFM_Font_info*);
48 };
49
50 SCM read_afm_file (String fn);
51 Box afm_bbox_to_box (AFM_BBox bb);
52   
53
54 #endif /* AFM_HH */
55