]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/afm.hh
305007eccdc197c109abdb5f6d212ed496163a7e
[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--1999 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 #include "font-metric.hh"
18
19 struct Adobe_font_char_metric : Character_metric {
20   int C_;
21   Real WX_;
22   String N_;
23   Box B_;
24   int size_;
25   Box &bbox();
26   String &name();
27   Real &width();
28   int  &code ();
29   
30   String str () const;
31   Adobe_font_char_metric ();
32
33   Box dimensions () const;
34 };
35
36 struct Adobe_font_metric : Font_metric {
37   String  FontName_;
38   String FullName_;
39   String FamilyName_;
40   String Weight_;
41   Real ItalicAngle_;
42   bool IsFixedPitch_;
43   Box FontBBox_;
44   Real UnderlinePosition_;
45   Real UnderlineThickness_;
46   String Version_;
47   String Notice_;
48   String EncodingScheme_;
49   Array<Adobe_font_char_metric> char_metrics_;
50   Array<int> ascii_to_metric_idx_;
51   Dictionary<int> name_to_metric_dict_;
52   
53   Adobe_font_char_metric const &find_char (String name, bool warn=true) const;
54   Adobe_font_char_metric const &find_ascii (int ascii,bool warn) const;
55   String str () const;
56   Adobe_font_metric ();
57   void read_char_metrics (Data_file &input, int size);
58
59
60   Character_metric *get_char (int, bool) const;
61 };
62
63 Adobe_font_metric read_afm_file (String fn);
64
65
66
67 #endif /* AFM_HH */
68