]> git.donarmstrong.com Git - lilypond.git/commitdiff
Cleanup: remove Simple_font_metric, Font_metric::text_dimension
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 15 Mar 2010 04:01:25 +0000 (01:01 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 22 Mar 2010 12:56:27 +0000 (09:56 -0300)
lily/font-metric.cc
lily/include/font-metric.hh
lily/include/modified-font-metric.hh
lily/modified-font-metric.cc

index 1ff7e47fc0714ddb4e9823d5963c0ca7ee16fde2..ed53d266187d2fdda943958f170b5e1d93ac7ebe 100644 (file)
@@ -2,7 +2,6 @@
   This file is part of LilyPond, the GNU music typesetter.
 
   Copyright (C) 1999--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -197,10 +196,3 @@ Font_metric::text_stencil (Output_def* state,
   programming_error ("Cannot get a text stencil from this font");
   return Stencil (Box (), SCM_EOL);
 }
-
-Box
-Font_metric::text_dimension (string) const
-{
-  return Box (Interval (0, 0), Interval (0, 0));
-}
-
index 04e78f8e378c84191a27bf1cd8af56c01f249757..b9dc5c7891d29ad84cf083725dfd133a7bcb6ef9 100644 (file)
@@ -44,9 +44,6 @@ public:
   virtual Stencil text_stencil (Output_def* output_state,
                                 string text, bool music) const;
 
-  // ugh.
-  virtual Box text_dimension (string) const;
-
   virtual string font_name () const;
   virtual size_t count () const;
   virtual Offset attachment_point (string) const;
@@ -82,12 +79,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);
index 35b7d5b4ccdb19c403cd9b58fda8d36e3362e6de..b72fcd4d9f64decd030e7bedfde3822718c67c7c 100644 (file)
@@ -26,8 +26,6 @@
 struct Modified_font_metric : public Font_metric
 {
 public:
-  Box text_dimension (string) const;
-  Box word_dimension (string) const;
   Stencil text_stencil (Output_def* output_state, string, bool) const;
 
   static SCM make_scaled_font_metric (Font_metric *fm, Real magnification);
index 539a27173d920eb78e62bab2fc178b1eed1b9b10..5ad26a3548ddeecddaa645377a745ac15fa5e7fc 100644 (file)
@@ -131,27 +131,6 @@ Modified_font_metric::text_stencil (Output_def* state,
   return Font_metric::text_stencil (state, text, feta);
 }
 
-Box
-Modified_font_metric::text_dimension (string text) const
-{
-  Box b;
-  Interval ydims;
-  Real w = 0.0;
-
-  for (ssize i = 0; i < text.length (); i++)
-    {
-      Box b = get_ascii_char ((unsigned char)text[i]);
-
-      w += b[X_AXIS].length ();
-      ydims.unite (b[Y_AXIS]);
-    }
-  if (ydims.is_empty ())
-    ydims = Interval (0, 0);
-
-  b = Box (Interval (0, w), ydims);
-  return b;
-}
-
 Font_metric *
 Modified_font_metric::original_font () const
 {