From: fred Date: Tue, 26 Mar 2002 21:32:24 +0000 (+0000) Subject: lilypond-1.0.14 X-Git-Tag: release/1.5.59~2731 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=316d6154b1214db32827b4c6aebc75c234b6b211;p=lilypond.git lilypond-1.0.14 --- diff --git a/lily/dimen.cc b/lily/dimen.cc deleted file mode 100644 index a03b01caf2..0000000000 --- a/lily/dimen.cc +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include "dimension.hh" -#include "debug.hh" -#include "string.hh" - -Real -parse_dimen (String dim) -{ - int i=dim.length_i()-1; - char const *s = dim.ch_C (); - while (i > 0 && (isspace (s[i]) || isalpha (s[i]))) - { - i--; - } - String unit (s + i+1); - return convert_dimen (dim.value_f(), unit); -} - - -Real -convert_dimen (Real quant, String unit) -{ - if (unit == "cm") - return quant * CM_TO_PT; - if (unit == "pt") - return quant; - if (unit == "mm") - return quant*CM_TO_PT/10; - if (unit == "in") - return quant * INCH_TO_PT; - error (_f ("unknown length unit: `%s\'", unit)); -} - -String -print_dimen (Real r) -{ - String s = to_str (r, "%.3f"); - if (s.index_i ("NaN") != -1) - { - warning (_ ("NaN")); - s = "0.0"; - } - s += "pt"; - return s; -} - diff --git a/lily/include/dimension.hh b/lily/include/dimension.hh deleted file mode 100644 index ac8267f187..0000000000 --- a/lily/include/dimension.hh +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef DIMEN_HH -#define DIMEN_HH - -#include "real.hh" -#include "string.hh" - -const Real INCH_TO_PT=72.270; -const Real CM_TO_PT=INCH_TO_PT/2.54; -const Real MM_TO_PT=CM_TO_PT/10; -const Real PT_TO_PT =1.0; - -#define PT *PT_TO_PT -#define MM *MM_TO_PT -#define CM *CM_TO_PT -#define INCH *INCH_TO_PT - -Real parse_dimen (String); -String print_dimen (Real); -Real convert_dimen (Real, String); -#endif - diff --git a/lily/include/tex.hh b/lily/include/tex.hh deleted file mode 100644 index 3d5cf308b3..0000000000 --- a/lily/include/tex.hh +++ /dev/null @@ -1,35 +0,0 @@ -/* - tex.hh -- declare various functions for TeX output - - source file of the LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - - - -#ifndef TEX_HH -#define TEX_HH - -#include "string.hh" -#include "box.hh" -#include "scalar.hh" - -/** paratime_signature substitution in TeX_strings. - this function provides a simple macro mechanism: - - if source == "tex%bla%", then - substitute_args (source, {"X","Y"}) == "texXblaY" - */ -String -substitute_args (String source, Array args); - -/// paratime_signature substitution in TeX_strings -String -substitute_args (String source, Array args); - -/// #h# is in points -String vstrut (Real h); - - -#endif diff --git a/lily/tex.cc b/lily/tex.cc deleted file mode 100644 index 635b281aa6..0000000000 --- a/lily/tex.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* - tex.cc -- implement TeX related misc functions - - source file of the GNU LilyPond music typesetter - - (c) 1996, 1997--1998 Han-Wen Nienhuys -*/ - -#include "dimension.hh" -#include "tex.hh" -#include "atom.hh" -#include "array.hh" - -String -vstrut (Real h) -{ - return String ("\\vrule height ") + print_dimen (h) + "depth 0pt width 0pt"; -} - - -static void -substitute_arg (String& r, String arg) -{ - int p = r.index_i ('%'); - if (p < 0) - return ; - - r = r.left_str (p) + arg + r.right_str (r.length_i() - p -1); -} - - -String -substitute_args (String source, Array args) -{ - String retval (source); - for (int i = 0 ; i < args.size(); i++) - substitute_arg (retval, args[i]); - return retval; -} - -String -substitute_args (String source, Array args) -{ - Array sv; - for (int i = 0 ; i < args.size(); i++) - sv.push (args[i]); - - return substitute_args (source, sv); -}