]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
release: 1.1.18
[lilypond.git] / lily / include / afm.hh
1 /*   
2   afm.hh -- declare Adobe_font_metric
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef AFM_HH
11 #define AFM_HH
12
13 #include "string.hh"
14 #include "box.hh"
15 #include "array.hh"
16 #include "dictionary.hh"
17
18 struct Adobe_font_char_metric {
19   int C_;
20   Real WX_;
21   String N_;
22   Box B_;
23   Box &bbox();
24   String &name();
25   Real &width();
26   int  &code ();
27   
28   String str () const;
29   Adobe_font_char_metric ();
30 };
31
32 struct Adobe_font_metric {
33   String  FontName_;
34   String FullName_;
35   String FamilyName_;
36   String Weight_;
37   Real ItalicAngle_;
38   bool IsFixedPitch_;
39   Box FontBBox_;
40   Real UnderlinePosition_;
41   Real UnderlineThickness_;
42   String Version_;
43   String Notice_;
44   String EncodingScheme_;
45   Array<Adobe_font_char_metric> char_metrics_;
46   Array<int> ascii_to_metric_idx_;
47   Dictionary<int> name_to_metric_dict_;
48   
49   Adobe_font_char_metric find_char (String name, bool warn=true) const;
50   Adobe_font_char_metric find_ascii (int ascii) const;
51   String str () const;
52   Adobe_font_metric ();
53   void read_char_metrics (Data_file &input);
54 };
55
56 Adobe_font_metric read_afm_file (String fn);
57
58
59
60 #endif /* AFM_HH */
61