2 font-metric.hh -- declare Font_metric
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #define FONT_METRIC_HH
13 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "freetype.hh"
21 typedef map<FT_UInt, FT_ULong> Index_to_charcode_map;
25 DECLARE_CLASSNAME(Font_metric);
31 virtual Stencil text_stencil (string) const;
32 virtual Stencil word_stencil (string) const;
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;
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);
61 /* No copying, no implicit copy constructor. */
62 Font_metric (Font_metric const &);
65 virtual void derived_mark () const;
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);
78 DECLARE_UNSMOB (Font_metric, metrics);
80 char *pfb2pfa (Byte const *pfb, int length);
82 #endif /* FONT_METRIC_HH */