2 font-metric.hh -- declare Font_metric
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #define FONT_METRIC_HH
13 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
19 DECLARE_CLASSNAME(Font_metric);
26 virtual Stencil text_stencil (string) const;
27 virtual Box text_dimension (string) const;
28 virtual string font_name () const;
29 virtual size_t count () const;
30 virtual Offset attachment_point (string) const;
31 virtual Offset get_indexed_wxwy (size_t) const;
32 virtual Box get_indexed_char (size_t index) const;
33 virtual Box get_ascii_char (size_t ascii) const;
38 Font_metric is not related to vector<>
40 virtual size_t name_to_index (string) const;
41 virtual size_t index_to_charcode (size_t) const;
42 virtual size_t index_to_ascii (size_t) const;
43 virtual Real design_size () const;
44 virtual Stencil find_by_name (string) const;
45 virtual Stencil get_indexed_char_stencil (size_t k) const;
46 virtual Stencil get_ascii_char_stencil (size_t k) const;
47 virtual SCM sub_fonts () const;
48 virtual SCM font_file_name () const;
49 DECLARE_SMOBS (Font_metric,);
52 /* No copying, no implicit copy constructor. */
53 Font_metric (Font_metric const &);
56 virtual void derived_mark () const;
61 int get_encoded_index (Font_metric *m, string input_coding, int code);
63 class Simple_font_metric : public Font_metric
65 DECLARE_CLASSNAME(Simple_font_metric);
69 DECLARE_UNSMOB (Font_metric, metrics);
71 Box lookup_tex_text_dimension (Font_metric *font, SCM text);
73 #endif /* FONT_METRIC_HH */