Fix typo in convert-ly.
[lilypond.git] / lily / include / font-metric.hh
blob793c0e14a9e065ecb9cd543c05c41585b5fc5baf
1 /*
2 font-metric.hh -- declare Font_metric
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #ifndef FONT_METRIC_HH
10 #define FONT_METRIC_HH
12 #include "box.hh"
13 #include "lily-proto.hh"
14 #include "smobs.hh"
15 #include "virtual-methods.hh"
16 #include "freetype.hh"
18 #include <map>
19 using namespace std;
21 typedef map<FT_UInt, FT_ULong> Index_to_charcode_map;
23 class Font_metric
25 DECLARE_CLASSNAME(Font_metric);
27 public:
28 SCM description_;
29 string file_name_;
31 virtual Stencil text_stencil (string) const;
32 virtual Stencil word_stencil (string) const;
34 // ugh.
35 virtual Box text_dimension (string) const;
37 virtual string font_name () const;
38 virtual size_t count () const;
39 virtual Offset attachment_point (string) const;
40 virtual Offset get_indexed_wxwy (size_t) const;
41 virtual Box get_indexed_char (size_t index) const;
42 virtual Box get_ascii_char (size_t ascii) const;
45 WTF are these vsize ?
47 Font_metric is not related to vector<>
49 virtual size_t name_to_index (string) const;
50 virtual size_t index_to_charcode (size_t) const;
51 virtual size_t index_to_ascii (size_t) const;
52 virtual Real design_size () const;
53 virtual Stencil find_by_name (string) const;
54 virtual Stencil get_indexed_char_stencil (size_t k) const;
55 virtual Stencil get_ascii_char_stencil (size_t k) const;
56 virtual SCM sub_fonts () const;
57 virtual SCM font_file_name () const;
58 DECLARE_SMOBS (Font_metric);
60 private:
61 /* No copying, no implicit copy constructor. */
62 Font_metric (Font_metric const &);
64 protected:
65 virtual void derived_mark () const;
67 Font_metric ();
70 int get_encoded_index (Font_metric *m, string input_coding, int code);
72 class Simple_font_metric : public Font_metric
74 DECLARE_CLASSNAME(Simple_font_metric);
75 public:
78 DECLARE_UNSMOB (Font_metric, metrics);
80 Box lookup_tex_text_dimension (Font_metric *font, SCM text);
82 char *pfb2pfa (Byte const *pfb, int length);
84 #endif /* FONT_METRIC_HH */