]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/font-metric.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / font-metric.hh
index 769a16095a83b252fa7d53924c9d21510985ab0d..2efea228e2fa9597f93d95c3ef119003b3d0928e 100644 (file)
@@ -1,44 +1,65 @@
-/*   
+/*
   font-metric.hh -- declare Font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+
+  (c) 1999--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #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"
 
-struct Font_metric
+#include <map>
+using namespace std;
+
+typedef map<FT_UInt, FT_ULong> Index_to_charcode_map;
+
+class Font_metric
 {
+  DECLARE_CLASSNAME(Font_metric);
+
 public:
   SCM description_;
-  String filename_;
-  
-  virtual int count () const;
-  virtual Offset get_indexed_wxwy (int) const;
-  virtual Box get_indexed_char (int index) const;
-  virtual Box get_ascii_char (int ascii) const;
-  virtual int name_to_index (String) const;
-  virtual int index_to_ascii (int) const;
+  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 (int k) const;
-  virtual Stencil get_ascii_char_stencil (int k) const;
-  virtual String coding_scheme () const;
-  
-  DECLARE_SMOBS (Font_metric,);
+  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:
   /* No copying, no implicit copy constructor.  */
-  Font_metric (Font_metric const&);
+  Font_metric (Font_metric const &);
 
 protected:
   virtual void derived_mark () const;
@@ -46,15 +67,18 @@ protected:
   Font_metric ();
 };
 
-int get_encoded_index (Font_metric *m, String input_coding, int code);
+int get_encoded_index (Font_metric *m, string input_coding, int code);
 
-struct Simple_font_metric : public Font_metric
+class Simple_font_metric : public Font_metric
 {
+  DECLARE_CLASSNAME(Simple_font_metric);
 public:
-  
 };
-  
 
-DECLARE_UNSMOB(Font_metric, metrics);
+DECLARE_UNSMOB (Font_metric, metrics);
+
+Box lookup_tex_text_dimension (Font_metric *font, SCM text);
+
+char *pfb2pfa (Byte const *pfb, int length);
 
 #endif /* FONT_METRIC_HH */