X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Ffont-metric.hh;h=1107ba9af8e4d08fd6231f60f7ed2279078cbd0d;hb=66adac8fa4ba5126100ff8748a2576c6983637c5;hp=d3ae05da69a3cc15b017642e7d4eee459443cdc6;hpb=5c2afd9ecbe4d91998a325f6323f05ea4d658d96;p=lilypond.git diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index d3ae05da69..1107ba9af8 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -1,40 +1,82 @@ -/* +/* font-metric.hh -- declare Font_metric - + source file of the GNU LilyPond music typesetter - - (c) 1999--2001 Han-Wen Nienhuys - - */ + + (c) 1999--2006 Han-Wen Nienhuys +*/ #ifndef FONT_METRIC_HH #define FONT_METRIC_HH #include "box.hh" -#include "lily-guile.hh" -#include "smobs.hh" #include "lily-proto.hh" -#include "string.hh" +#include "smobs.hh" +#include "virtual-methods.hh" +#include "freetype.hh" + +#include +using namespace std; + +typedef map Index_to_charcode_map; -struct Font_metric +class Font_metric { + DECLARE_CLASSNAME(Font_metric); + public: SCM description_; - String path_; - - virtual int count () const; - virtual Box get_char (int ascii) const; - virtual Box text_dimension (String) const; - virtual Molecule find_by_name (String) const; - - DECLARE_SMOBS (Font_metric,); + string file_name_; + + virtual Stencil text_stencil (string) const; + virtual Stencil word_stencil (string) const; + + // ugh. + virtual Box text_dimension (string) const; + + virtual string font_name () const; + virtual size_t count () const; + virtual Offset attachment_point (string) const; + virtual Offset get_indexed_wxwy (size_t) const; + virtual Box get_indexed_char (size_t index) const; + virtual Box get_ascii_char (size_t ascii) const; + + /* + WTF are these vsize ? + + Font_metric is not related to vector<> + */ + virtual size_t name_to_index (string) const; + virtual size_t index_to_charcode (size_t) const; + virtual size_t index_to_ascii (size_t) const; + virtual Real design_size () const; + virtual Stencil find_by_name (string) const; + virtual Stencil get_indexed_char_stencil (size_t k) const; + virtual Stencil get_ascii_char_stencil (size_t k) const; + virtual SCM sub_fonts () const; + virtual SCM font_file_name () const; + DECLARE_SMOBS (Font_metric); + private: - Font_metric (Font_metric const&); // no copy. + /* No copying, no implicit copy constructor. */ + Font_metric (Font_metric const &); + protected: + virtual void derived_mark () const; + Font_metric (); }; -DECLARE_UNSMOB(Font_metric, metrics); +int get_encoded_index (Font_metric *m, string input_coding, int code); -#endif /* FONT_METRIC_HH */ +class Simple_font_metric : public Font_metric +{ + DECLARE_CLASSNAME(Simple_font_metric); +public: +}; + +DECLARE_UNSMOB (Font_metric, metrics); +Box lookup_tex_text_dimension (Font_metric *font, SCM text); + +#endif /* FONT_METRIC_HH */