From: fred Date: Sun, 24 Mar 2002 19:29:32 +0000 (+0000) Subject: lilypond-0.0.30 X-Git-Tag: release/1.5.59~5514 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dfa3af543916be802d631a11f4ea547e85029ef4;p=lilypond.git lilypond-0.0.30 --- diff --git a/hdr/dimen.hh b/hdr/dimen.hh index 4ee17ea140..a3f4e8876b 100644 --- a/hdr/dimen.hh +++ b/hdr/dimen.hh @@ -4,9 +4,18 @@ #include "real.hh" #include "string.hh" +const Real INCH_TO_PT=72.0; +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); -Real convert_dimen(Real, String); String print_dimen(Real); - +Real convert_dimen(Real, String); #endif diff --git a/src/texbeam.cc b/src/texbeam.cc index a3b38dde9e..c9f3c95481 100644 --- a/src/texbeam.cc +++ b/src/texbeam.cc @@ -23,7 +23,7 @@ Lookup::beam_element(int sidx, int widx, Real slope) args.push(widx); bs.tex = substitute_args(bs.tex,args); int w = 2 << widx; - Real width = convert_dimen(w,"pt"); + Real width = w PT; bs.dim.x = Interval(0,width); bs.dim.y = Interval(0,width*slope); return bs; @@ -34,7 +34,7 @@ static int slope_index(Real &s) { if (abs(s) > 0.5) { - WARN << "beam steeper than 0.5\n"; + WARN << "beam steeper than 0.5 (" << s << ")\n"; s = sign(s) * 0.5; } @@ -65,12 +65,12 @@ Lookup::beam(Real &slope, Real width) { int sidx = slope_index(slope); if (!slope) - return rule_symbol(convert_dimen(2,"pt"), width); - if (width < convert_dimen(2,"pt")) { - WARN<<"Beam too narrow.\n"; - width = convert_dimen(2,"pt"); + return rule_symbol(2 PT, width); + if (width < 2 PT) { + WARN<<"Beam too narrow. (" << print_dimen(width) <<")\n"; + width = 2 PT; } - Real elemwidth = convert_dimen(64,"pt"); + Real elemwidth = 64 PT; int widx = 5; Molecule m;