X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Ffont-metric.hh;h=429801db5520800c1043afafc43306b39346f303;hb=8cf69a467ad7650f5ca9da6fe2dfd4c7c088b239;hp=8c287da18b50026137fc9932a808bc47ff191d98;hpb=1c846b2c2348b4e0ca4a3c2e8fb267047ba2d203;p=lilypond.git diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 8c287da18b..429801db55 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2011 Han-Wen Nienhuys + Copyright (C) 1999--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,9 +30,15 @@ typedef std::map Index_to_charcode_map; -class Font_metric +class Font_metric : public Smob { - DECLARE_CLASSNAME(Font_metric); +public: + int print_smob (SCM, scm_print_state *) const; + SCM mark_smob () const; + static const char * const type_p_name_; + virtual ~Font_metric (); +private: + DECLARE_CLASSNAME (Font_metric); public: SCM description_; @@ -41,20 +47,21 @@ public: // Return stencil for given string. output_state may be modified to // record the font. virtual Stencil text_stencil (Output_def *output_state, - string text, bool music) const; + const string &text, + bool music, + const string &features_str) const; virtual string font_name () const; virtual size_t count () const; - virtual Offset attachment_point (string) const; + virtual Offset attachment_point (const string&) const; virtual Offset get_indexed_wxwy (size_t) const; virtual Box get_indexed_char_dimensions (size_t index) const; - virtual size_t name_to_index (string) const; + virtual size_t name_to_index (string) const=0; virtual size_t index_to_charcode (size_t) const; virtual Real design_size () const; virtual Stencil find_by_name (string) const; virtual SCM sub_fonts () const; virtual SCM font_file_name () const; - DECLARE_SMOBS (Font_metric); private: /* No copying, no implicit copy constructor. */ @@ -66,10 +73,7 @@ protected: Font_metric (); }; -int get_encoded_index (Font_metric *m, string input_coding, int code); - -DECLARE_UNSMOB (Font_metric, metrics); -char *pfb2pfa (Byte const *pfb, int length); +vector pfb2pfa (const vector &pfb); #endif /* FONT_METRIC_HH */