]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/font-metric.hh
* The grand 2005-2006 replace.
[lilypond.git] / lily / include / font-metric.hh
index 2ebbf303b106544fadb20870684b945f11390ed2..df3be0645c1901841215604538d9bb4ba0114bd5 100644 (file)
@@ -1,38 +1,66 @@
-/*   
+/*
   font-metric.hh -- declare Font_metric
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+
+  (c) 1999--2006 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"
 
-struct Font_metric
+class Font_metric
 {
+  DECLARE_CLASSNAME(Font_metric);
+
 public:
   SCM description_;
-  String path_;
-  virtual Box get_char (int ascii) const;
-  virtual Box text_dimension (String)  const;
-  virtual Molecule find_by_name (String) const;
+  String file_name_;
+
+  virtual Stencil text_stencil (String) const;
+  virtual Box text_dimension (String) const;
+  virtual String font_name () const;
+  virtual int count () const;
+  virtual Offset attachment_point (String) 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 unsigned index_to_charcode (int) const;
+  virtual int index_to_ascii (int) 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 SCM sub_fonts () const;
+  virtual SCM font_file_name () const;
+  DECLARE_SMOBS (Font_metric,);
 
-  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 ();
 };
 
-Font_metric * unsmob_metrics (SCM s);
+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 */