X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Ffont-metric.hh;h=4743e42b609ed794c255697c29a303d2f75599af;hb=c95f2748cdc044c16714c59cd138813eeac222ea;hp=efa3dbf9372c9114f34e32ff83c69f1793b0afa0;hpb=b7a0cffbf9d1069860368f289a5b50e9d1d90ba8;p=lilypond.git diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index efa3dbf937..4743e42b60 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--2009 Han-Wen Nienhuys + Copyright (C) 1999--2012 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 @@ -21,49 +21,37 @@ #define FONT_METRIC_HH #include "box.hh" +#include "freetype.hh" #include "lily-proto.hh" #include "smobs.hh" #include "virtual-methods.hh" -#include "freetype.hh" #include -using namespace std; -typedef map Index_to_charcode_map; +typedef std::map Index_to_charcode_map; class Font_metric { - DECLARE_CLASSNAME(Font_metric); + DECLARE_CLASSNAME (Font_metric); public: SCM description_; string file_name_; - virtual Stencil text_stencil (string, bool) const; - virtual Stencil word_stencil (string, bool) const; - - // ugh. - virtual Box text_dimension (string) const; + // 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; 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 Box get_indexed_char_dimensions (size_t index) const; 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); @@ -80,12 +68,6 @@ protected: int get_encoded_index (Font_metric *m, string input_coding, int code); -class Simple_font_metric : public Font_metric -{ - DECLARE_CLASSNAME(Simple_font_metric); -public: -}; - DECLARE_UNSMOB (Font_metric, metrics); char *pfb2pfa (Byte const *pfb, int length);