From: fred Date: Tue, 26 Mar 2002 21:27:09 +0000 (+0000) Subject: lilypond-1.0.14 X-Git-Tag: release/1.5.59~2849 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=266c0518f29522fcb3c3d09b113aeaf561195f39;p=lilypond.git lilypond-1.0.14 --- diff --git a/TODO b/TODO index 0ff8de840f..275774c463 100644 --- a/TODO +++ b/TODO @@ -10,6 +10,39 @@ grep for TODO and ugh/ugr/urg BUGS: + + + > \notes{ a \< b \cr } + > + > work but + > + > \notes{ a \< b \! } + > + > give a parse error? + + + * if possible, it might be nice for a warning to appear if someone does + > \translator with no name and without assigning it to an +identifier. possible, it might be nice for a warning to appear if +someone does + > \translator with no name and without assigning it to an +identifier. + + * space after bars? + + * [/3 c8 c16 c c c]/1 + + * I see that \prallprall and \prallmordent are identical. I think this is a + mistake, that \prallprall should not have the vertical line. + This can be fixex by removing the line + > draw_mordent(twidth-0.5toverlap); + from the definition of \prallprall in mf/feta-slag.mf (see below) + + * fix singleStaffBracket + + * repeat bars: need distance after ":|" and before "|:" + + - The time signature warnings still remain, will be fixed later. + * fix \n after proccing Summary of minor spelling irregularities: @@ -26,6 +59,29 @@ BUGS: **** + > lbheel = \script { "bheel" 0 0 -1 0 0 } +> rbheel = \script { "bheel" 0 0 1 0 0 } +> lbtoe = \script { "btoe" 0 0 -1 0 0 } +> rbtoe = \script { "btoe" 0 0 1 0 0 } +> lfheel = \script { "fheel" 0 0 -1 0 0 } +> rfheel = \script { "fheel" 0 0 1 0 0 } +> lftoe = \script { "ftoe" 0 0 -1 0 0 } +> rftoe = \script { "ftoe" 0 0 1 0 0 } +> +> and also +> +> portato= \script { "portato" 0 -1 0 1 0 } + + * MIDI spelling. + + * foo = 1 + + \score{ + \notes { a } + \paper{ foo = \translator{ \StaffContext}; } + } + + * Align_element::padding ? * uniformise property names. diff --git a/VERSION b/VERSION index e7a8da66cd..41cbf15065 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=0 -PATCH_LEVEL=13 +PATCH_LEVEL=14 MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a diff --git a/buildscripts/mf-to-xpms.sh b/buildscripts/mf-to-xpms.sh index 8ea9134e3a..03729893d9 100644 --- a/buildscripts/mf-to-xpms.sh +++ b/buildscripts/mf-to-xpms.sh @@ -6,7 +6,7 @@ if [ $# -ne 1 ]; then exit 2 fi -font=$1 +font=`basename $1 .mf` mf=$font.mf afm=out/$font.afm PKTOPBM=pktopbm diff --git a/buildscripts/ps-to-pfa.py b/buildscripts/ps-to-pfa.py new file mode 100644 index 0000000000..33ee75ddec --- /dev/null +++ b/buildscripts/ps-to-pfa.py @@ -0,0 +1,165 @@ +#!@PYTHON@ + +# ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files +# +# source file of the GNU LilyPond music typesetter +# +# (c) 1998 Jan Nieuwenhuizen + +name = 'ps-to-pfa' +version = '0.2' + +outdir = 'out/' +datadir = '' + +import os +import sys + +import getopt +from string import * +import regex +import regsub +import time + +def program_id (): + return name + ' version ' + version; + +def identify (): + sys.stdout.write (program_id () + '\n') + +def help (): + sys.stdout.write ("Usage: %s [options] [files]\n" + "ps-to-pfa.py -- make PostScript Type 3 font from separate ps char files\n\n" + + "Options:\n" + + " -d, --datadir=DIR use DIR for ps header/footer\n" + + " -h, --help print this help\n" + % (program_name) + ) + sys.exit (0) + +identify () +(options, files) = getopt.getopt ( + sys.argv[1:], 'd:', ['help', 'package']) +for opt in options: + o = opt[0] + a = opt[1] + if o== '--help' or o == '-h': + help () + elif o == '-d' or o == '--datadir': + datadir = a + else: + print o + raise getopt.error + + +def gulp_file (f): + sys.stderr.write ('[%s' % f) + try: + i = open (f) + i.seek (0, 2) + n = i.tell () + i.seek (0,0) + except: + sys.stderr.write ('can\'t open file %s\n ' % f) + return '' + s = i.read (n) + sys.stderr.write (']') + if len (s) <= 0: + sys.stderr.write ('gulped empty file: %s\n'% f) + return s + +mf = files[0] +# urg ? +font = os.path.basename (os.path.splitext (mf)[0]) +sys.stderr.write ('Font: %s\n'% font) + +def header (f): + f.write ('%!PS-AdobeFont-3.0: ' + font + '\n') + f.write ('%%%%Creator: %s-%s\n' % (name, version)) + f.write ('\n') + f.write ('/setgray { 1 add } bind def\n' + '\n' +'8 dict begin\n' +'/FontType 3 def %% Required elements of font\n' +'/FontName /%s def\n' +'/FontMatrix [.001 0 0 .001 0 0] def\n' +'%%/FontMatrix [.01 0 0 .01 0 0] def\n' +'%%/FontMatrix [0.1 0 0 0.1 0 0] def\n' +'%% /FontBBox [-1000 -1000 1000 1000] def\n' +' /FontBBox [-3000 -3000 3000 3000] def\n' +'%% /FontBBox [-300 -300 300 300] def\n' +'%%/FontBBox [-30 -30 30 30] def\n' +'\n' +'/Encoding 256 array def %% Trivial encoding vector\n' +'0 1 255 {Encoding exch /.notdef put} for\n' % (font)) + +def footer (f): + f.write ('\n' +'/BuildGlyph { % Stack contains: font charname\n' +'% 1000 0 % Width\n' +'% -750 -750 750 750 % Bounding Box\n' +' 3000 0 % Width\n' +' -3000 -3000 3000 3000 % Bounding Box\n' +'% 300 0 % Width\n' +'% -300 -300 300 300 % Bounding Box\n' +'% 30 0 % Width\n' +'% -30 -30 30 30 % Bounding Box\n' +' setcachedevice\n' +' exch /CharProcs get exch % Get CharProcs dictionary\n' +' 2 copy known not {pop /.notdef} if % See if charname is known\n' +' get exec % Execute character procedure\n' +'} bind def\n' +'\n' +'/BuildChar { % Level 1 compatibility\n' +' 1 index /Encoding get exch get\n' +' 1 index /BuildGlyph get exec\n' +'} bind def\n' +'\n' +'currentdict\n' +'end % of font dictionary\n') + f.write ('\n') + f.write ('/%s\n' % font) + f.write ('' +'exch definefont pop % Define the font\n') + +def characters (f): + #urg + # chars = os.listdir () + # chars.sort () + sys.stderr.write ('[') + pipe = os.popen ('/bin/ls -1 ' + font + '.[0-9] ' + font + '.[0-9][0-9] ' + font + '.[0-9][0-9][0-9] 2> /dev/null') + chars = [] + i = pipe.readline () + while i: + chars.append (i[0:len (i)-1]) + i = pipe.readline () + f.write ('\n' +'/CharProcs 3 dict def % Subsidiary dictiorary for\n' +'CharProcs begin % individual character definitions\n') + charprocs = ' /.notdef {} def\n' + encoding = '' + for i in chars: + s = gulp_file (i) + s = regsub.gsub ('^%.*\n', '', s) + s = regsub.gsub ('^showpage\n', '', s) + s = regsub.gsub ('^', ' ', s) + n = atoi (regsub.gsub ('.*\.', '', i)) + s = '\n /%s-%d{\n%s} bind def\n' % (font, n, s) + encoding = encoding + 'Encoding %d /%s-%d put\n' % (n, font, n) + charprocs = charprocs + s + f.write (charprocs) + f.write ('\n') + f.write ('end % of CharProcs\n') + f.write (encoding) + f.write ('\n') + sys.stderr.write (']') + +ps = outdir + font + '.pfa' +ps_file = open (ps, 'w') +header (ps_file) +characters (ps_file) +footer (ps_file) +sys.stderr.write ('\n') +ps_file.close () +sys.stderr.write ('Wrote PostScript font: %s\n'% ps) + diff --git a/flower/include/interval.tcc b/flower/include/interval.tcc index 537b9236cf..45d754abd3 100644 --- a/flower/include/interval.tcc +++ b/flower/include/interval.tcc @@ -28,13 +28,13 @@ int _Interval__compare (const Interval_t&a,Interval_t const&b) { if (a.left == b.left && a.right == b.right) - return 0; + return 0; if (a.left <= b.left && a.right >= b.right) - return 1; + return 1; if (a.left >= b.left && a.right <= b.right) - return -1; + return -1; return -2; } @@ -45,7 +45,7 @@ Interval_t::contains_b (Interval_t const& a) const { int c_i= _Interval__compare (*this, a); if (c_i == -2) - return false; + return false; return c_i >= 0; } @@ -55,7 +55,7 @@ Interval__compare (const Interval_t&a,Interval_t const&b) { int i = _Interval__compare (a,b); if (i < -1) - assert (false); + assert (false); return i; } @@ -82,9 +82,9 @@ void Interval_t::unite (Interval_t h) { if (h.leftright) - right = h.right; + right = h.right; } /** @@ -117,7 +117,7 @@ String Interval_t::str() const { if (empty_b()) - return "[empty]"; + return "[empty]"; String s ("["); return s + T_to_str (left) + String ("," ) + T_to_str (right ) + String ("]" ); @@ -132,6 +132,6 @@ Interval_t::elem_b (T r) #define INTERVAL__INSTANTIATE(T) struct Interval_t;\ - template int Interval__compare(const Interval_t&,Interval_t const&) +template int Interval__compare(const Interval_t&,Interval_t const&) #endif // INTERVAL_TCC diff --git a/flower/interval.cc b/flower/interval.cc index 571d23f530..aaadcc196c 100644 --- a/flower/interval.cc +++ b/flower/interval.cc @@ -11,8 +11,6 @@ #include "real.hh" #include "interval.tcc" -template INTERVAL__INSTANTIATE (Real); - Real Interval_t::infinity () { @@ -25,7 +23,6 @@ Interval_t::T_to_str (Real r) return to_str (r); } -template INTERVAL__INSTANTIATE (int); int Interval_t::infinity () @@ -39,3 +36,6 @@ Interval_t::T_to_str (int i) return to_str (i); } +template INTERVAL__INSTANTIATE (int); +template INTERVAL__INSTANTIATE (Real); + diff --git a/init/paper16.ly b/init/paper16.ly index af51b3277a..ea7a7a0529 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -20,7 +20,8 @@ paper_sixteen = \paper { arithmetic_basicspace = 2.; arithmetic_multiplier = 4.8\pt; texsetting = "\\input lilyponddefs \\musixsixteendefs "; - + pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; + 0 = \symboltables { \table_sixteen } -1 = \symboltables { \table_thirteen } -2 = \symboltables { \table_eleven } diff --git a/init/paper20.ly b/init/paper20.ly index ecc8a3eac7..b73b3817bf 100644 --- a/init/paper20.ly +++ b/init/paper20.ly @@ -20,7 +20,7 @@ paper_twenty = \paper { arithmetic_basicspace = 2.; arithmetic_multiplier = 6.\pt; texsetting = "\\input lilyponddefs \\musixtwentydefs "; - + pssetting = "(lilyponddefs.ps) findlibfile {exch pop //systemdict /run get exec} { /undefinedfilename signalerror } ifelse\n"; -2 = \symboltables { \table_thirteen } -1 = \symboltables { \table_sixteen } diff --git a/init/table11.ly b/init/table11.ly index 646a0b843c..11cb57b9b1 100644 --- a/init/table11.ly +++ b/init/table11.ly @@ -8,68 +8,68 @@ table_eleven = \symboltables { \font "feta11.afm" - % index TeXstring, xmin xmax ymin ymax + % index symbol #parameters xmin xmax ymin ymax "style" = \table { - "bold" "\\setbold{%}" 0.0\pt 7.50\pt 0.0\pt 8.0\pt - "dynamic" "\\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "finger" "\\setfinger{%}" 0.0\pt 0.0\pt 0.0\pt 5.0\pt - "italic" "\\setitalic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "large" "\\setlarge{%}" 0.0\pt 9.50\pt 0.0\pt 12.0\pt - "number" "\\setnumber{%}" 0.0\pt 9.50\pt 0.0\pt 12.0\pt - "roman" "\\settext{%}" 0.0\pt 7.5\pt 0.0\pt 10.0\pt + "bold" "setbold" 1 0.0\pt 7.50\pt 0.0\pt 8.0\pt + "dynamic" "setdynamic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "finger" "setfinger" 1 0.0\pt 0.0\pt 0.0\pt 5.0\pt + "italic" "setitalic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "large" "setlarge" 1 0.0\pt 9.50\pt 0.0\pt 12.0\pt + "number" "setnumber" 1 0.0\pt 9.50\pt 0.0\pt 12.0\pt + "roman" "settext" 1 0.0\pt 7.5\pt 0.0\pt 10.0\pt } "dynamics" = \table { - "mf" "\\dynmf" - "fff" "\\dynfff" - "ff" "\\dynff" - "f" "\\dynf" + "mf" "dynmf" 0 + "fff" "dynfff" 0 + "ff" "dynff" 0 + "f" "dynf" 0 - "mp" "\\dynmp" - "p" "\\dynp" - "pp" "\\dynpp" - "ppp" "\\dynppp" - "fp" "\\dynfp" - "sf" "\\dynsf" - "sfz" "\\dynsfz" + "mp" "dynmp" 0 + "p" "dynp" 0 + "pp" "dynpp" 0 + "ppp" "dynppp" 0 + "fp" "dynfp" 0 + "sf" "dynsf" 0 + "sfz" "dynsfz" 0 } "align" = \table { - "-1" "\\leftalign{%}" - "0" "\\centeralign{%}" - "1" "\\rightalign{%}" + "-1" "leftalign" 1 + "0" "centeralign" 1 + "1" "rightalign" 1 } "bars" = \table { - "empty" "\\emptybar" - "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt - "|" "\\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt - "||" "\\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt - "|." "\\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt - ".|" "\\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - ".|." "\\fatdoublebar{%}" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|" "\\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt - "|:" "\\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|:" "\\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt + "empty" "emptybar" 0 + "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 20.0\pt + "||" "doublebar" 1 0.0\pt 5.0\pt 0.0\pt 20.0\pt + "|." "finishbar" 1 -5.0\pt 0.0\pt 0.0\pt 20.0\pt + ".|" "startbar" 1 0.0\pt 4.0\pt 0.0\pt 20.0\pt + ".|." "fatdoublebar" 1 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|" "repeatbar" 0 -10.0\pt 0.0\pt 0.0\pt 20.0\pt + "|:" "startrepeat" 0 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|:" "repeatbarstartrepeat" 0 0.0\pt 20.0\pt 0.0\pt 20.0\pt } "foobar" = \table { - "C" "\\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "\\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt } % dims ignored for this table "param" = \table { - "brace" "\\pianobrace{%}" 0.0\pt 0.0\pt 32.0\pt 96.0\pt - "time_signature" "\\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "stem" "\\stem{%}{%}" - "fill" "\\hbox{}" - "rule" "\\rulesym{%}{%}" + "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 96.0\pt + "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "stem" "stem" 2 + "fill" "hbox{}" 0 + "rule" "rulesym" 2 } } diff --git a/init/table13.ly b/init/table13.ly index 1432209b8e..c57132ec46 100644 --- a/init/table13.ly +++ b/init/table13.ly @@ -8,68 +8,68 @@ table_thirteen = \symboltables { \font "feta13.afm" - % index TeXstring, xmin xmax ymin ymax + % index symbol #parameters xmin xmax ymin ymax "style" = \table { - "bold" "\\setbold{%}" 0.0\pt 7.50\pt 0.0\pt 8.0\pt - "dynamic" "\\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "finger" "\\setfinger{%}" 0.0\pt 0.0\pt 0.0\pt 5.0\pt - "italic" "\\setitalic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "large" "\\setlarge{%}" 0.0\pt 9.50\pt 0.0\pt 12.0\pt - "number" "\\setnumber{%}" 0.0\pt 9.50\pt 0.0\pt 12.0\pt - "roman" "\\settext{%}" 0.0\pt 7.5\pt 0.0\pt 10.0\pt + "bold" "setbold" 1 0.0\pt 7.50\pt 0.0\pt 8.0\pt + "dynamic" "setdynamic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "finger" "setfinger" 1 0.0\pt 0.0\pt 0.0\pt 5.0\pt + "italic" "setitalic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "large" "setlarge" 1 0.0\pt 9.50\pt 0.0\pt 12.0\pt + "number" "setnumber" 1 0.0\pt 9.50\pt 0.0\pt 12.0\pt + "roman" "settext" 1 0.0\pt 7.5\pt 0.0\pt 10.0\pt } "dynamics" = \table { - "mf" "\\dynmf" - "fff" "\\dynfff" - "ff" "\\dynff" - "f" "\\dynf" + "mf" "dynmf" 0 + "fff" "dynfff" 0 + "ff" "dynff" 0 + "f" "dynf" 0 - "mp" "\\dynmp" - "p" "\\dynp" - "pp" "\\dynpp" - "ppp" "\\dynppp" - "fp" "\\dynfp" - "sf" "\\dynsf" - "sfz" "\\dynsfz" + "mp" "dynmp" 0 + "p" "dynp" 0 + "pp" "dynpp" 0 + "ppp" "dynppp" 0 + "fp" "dynfp" 0 + "sf" "dynsf" 0 + "sfz" "dynsfz" 0 } "align" = \table { - "-1" "\\leftalign{%}" - "0" "\\centeralign{%}" - "1" "\\rightalign{%}" + "-1" "leftalign" 1 + "0" "centeralign" 1 + "1" "rightalign" 1 } "bars" = \table { - "empty" "\\emptybar" - "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt - "|" "\\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt - "||" "\\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt - "|." "\\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt - ".|" "\\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - ".|." "\\fatdoublebar{%}" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|" "\\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt - "|:" "\\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|:" "\\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt + "empty" "emptybar" 0 + "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 20.0\pt + "||" "doublebar" 1 0.0\pt 5.0\pt 0.0\pt 20.0\pt + "|." "finishbar" 1 -5.0\pt 0.0\pt 0.0\pt 20.0\pt + ".|" "startbar" 1 0.0\pt 4.0\pt 0.0\pt 20.0\pt + ".|." "fatdoublebar" 1 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|" "repeatbar" 0 -10.0\pt 0.0\pt 0.0\pt 20.0\pt + "|:" "startrepeat" 0 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|:" "repeatbarstartrepeat" 0 0.0\pt 20.0\pt 0.0\pt 20.0\pt } "time_signatures" = \table { - "C" "\\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "\\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt } % dims ignored for this table "param" = \table { - "brace" "\\pianobrace{%}" 0.0\pt 0.0\pt 32.0\pt 96.0\pt - "time_signature" "\\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "stem" "\\stem{%}{%}" - "fill" "\\hbox{}" - "rule" "\\rulesym{%}{%}" + "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 96.0\pt + "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "stem" "stem" 2 + "fill" "hbox{}" 0 + "rule" "rulesym" 2 } } diff --git a/init/table16.ly b/init/table16.ly index c7ca13d246..df5ae32e8c 100644 --- a/init/table16.ly +++ b/init/table16.ly @@ -9,71 +9,71 @@ table_sixteen= \symboltables { \font "feta16.afm" - % index TeXstring, xmin xmax ymin ymax + % index symbol #parameters xmin xmax ymin ymax "style" = \table { - "bold" "\\setbold{%}" 0.0\pt 7.50\pt 0.0\pt 8.0\pt - "dynamic" "\\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 8.0\pt - "finger" "\\setfinger{%}" 0.0\pt 2.0\pt 0.0\pt 4.0\pt - "italic" "\\setitalic{%}" 0.0\pt 4.\pt 0.0\pt 8.0\pt - "typewriter" "\\settypewriter{%}" 0.0\pt 4.\pt 0.0\pt 8.0\pt - "large" "\\setlarge{%}" 0.0\pt 9.50\pt 0.0\pt 10.0\pt - "number" "\\setnumber{%}" 0.0\pt 6.0\pt 0.0\pt 8.0\pt - "roman" "\\settext{%}" 0.0\pt 4.5\pt 0.0\pt 8.0\pt + "bold" "setbold" 1 0.0\pt 7.50\pt 0.0\pt 8.0\pt + "dynamic" "setdynamic" 1 0.0\pt 0.0\pt 0.0\pt 8.0\pt + "finger" "setfinger" 1 0.0\pt 2.0\pt 0.0\pt 4.0\pt + "italic" "setitalic" 1 0.0\pt 4.\pt 0.0\pt 8.0\pt + "typewriter" "settypewriter" 1 0.0\pt 4.\pt 0.0\pt 8.0\pt + "large" "setlarge" 1 0.0\pt 9.50\pt 0.0\pt 10.0\pt + "number" "setnumber" 1 0.0\pt 6.0\pt 0.0\pt 8.0\pt + "roman" "settext" 1 0.0\pt 4.5\pt 0.0\pt 8.0\pt } "dynamics" = \table { - "mf" "\\dynmf" - "fff" "\\dynfff" - "ff" "\\dynff" - "f" "\\dynf" - "mp" "\\dynmp" - "p" "\\dynp" - "pp" "\\dynpp" - "ppp" "\\dynppp" - "fp" "\\dynfp" - "sf" "\\dynsf" - "sfz" "\\dynsfz" + "mf" "dynmf" 0 + "fff" "dynfff" 0 + "ff" "dynff" 0 + "f" "dynf" 0 + "mp" "dynmp" 0 + "p" "dynp" 0 + "pp" "dynpp" 0 + "ppp" "dynppp" 0 + "fp" "dynfp" 0 + "sf" "dynsf" 0 + "sfz" "dynsfz" 0 } "align" = \table { - "-1" "\\leftalign{%}" - "0" "\\centeralign{%}" - "1" "\\rightalign{%}" + "-1" "leftalign" 1 + "0" "centeralign" 1 + "1" "rightalign" 1 } "bars" = \table { - "empty" "\\emptybar" - "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt - "|" "\\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 16.0\pt - "||" "\\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt - "|." "\\finishbar{%}" -4.0\pt 0.0\pt 0.0\pt 16.0\pt - ".|" "\\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt - ".|." "\\fatdoublebar{%}" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|" "\\repeatbar" -8.0\pt 0.0\pt 0.0\pt 16.0\pt - "|:" "\\startrepeat" 0.0\pt 8.0\pt 0.0\pt 16.0\pt - ":|:" "\\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 16.0\pt + "empty" "emptybar" 0 + "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 16.0\pt + "||" "doublebar" 1 0.0\pt 4.0\pt 0.0\pt 16.0\pt + "|." "finishbar" 1 -4.0\pt 0.0\pt 0.0\pt 16.0\pt + ".|" "startbar" 1 0.0\pt 4.0\pt 0.0\pt 16.0\pt + ".|." "fatdoublebar" 1 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|" "repeatbar" 0 -8.0\pt 0.0\pt 0.0\pt 16.0\pt + "|:" "startrepeat" 0 0.0\pt 8.0\pt 0.0\pt 16.0\pt + ":|:" "repeatbarstartrepeat" 0 0.0\pt 16.0\pt 0.0\pt 16.0\pt } "meters" = \table { - "C" "\\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "\\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt } % dims ignored for this table "param" = \table { - "brace" "\\pianobrace{%}" 0.0\pt 0.0\pt 32.0\pt 80.0\pt - "bracket" "\\staffbracket{%}" 0.0\pt 4.0\pt 16.0\pt 128.0\pt - "time_signature" "\\generalmeter{%}{%}" 0.0\pt 10.0\pt -8.0\pt 8.0\pt - "rule" "\\rulesym{%}{%}" - "stem" "\\stem{%}{%}" - "fill" "\\hbox{}" + "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 80.0\pt + "bracket" "staffbracket" 1 0.0\pt 4.0\pt 16.0\pt 128.0\pt + "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -8.0\pt 8.0\pt + "rule" "rulesym" 2 + "stem" "stem" 2 + "fill" "hbox{}" 0 } "beamslopes" = \table { - "slope" "\\beamslope{%}{%}" 2.0\pt 64.0\pt 0.0\pt 0.0\pt - "horizontal" "\\rulesym{%}{%}" + "slope" "beamslope" 2 2.0\pt 64.0\pt 0.0\pt 0.0\pt + "horizontal" "rulesym" 2 } } diff --git a/init/table20.ly b/init/table20.ly index 483c775ef2..2ba7508064 100644 --- a/init/table20.ly +++ b/init/table20.ly @@ -9,74 +9,74 @@ table_twenty = \font "feta20.afm" - % index TeXstring, xmin xmax ymin ymax + % index symbol #parameters xmin xmax ymin ymax "style" = \table { - "bold" "\\setbold{%}" 0.0\pt 5.50\pt 0.0\pt 8.0\pt - "dynamic" "\\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "finger" "\\setfinger{%}" 0.0\pt 4.5\pt 0.0\pt 5.0\pt - "typewriter" "\\settypewriter{%}" 0.0\pt 5.5\pt 0.0\pt 10.0\pt - "italic" "\\setitalic{%}" 0.0\pt 5.5\pt 0.0\pt 10.0\pt - "large" "\\setlarge{%}" 0.0\pt 6.50\pt 0.0\pt 12.0\pt - "Large" "\\setLarge{%}" 0.0\pt 6.50\pt 0.0\pt 12.0\pt - "mark" "\\setmark{%}" 0.0\pt 6.50\pt 0.0\pt 12.0\pt - "number" "\\setnumber{%}" 0.0\pt 8.0\pt 0.0\pt 10.0\pt - "roman" "\\settext{%}" 0.0\pt 5.6\pt 0.0\pt 10.0\pt + "bold" "setbold" 1 0.0\pt 5.50\pt 0.0\pt 8.0\pt + "dynamic" "setdynamic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "finger" "setfinger" 1 0.0\pt 4.5\pt 0.0\pt 5.0\pt + "typewriter" "settypewriter" 1 0.0\pt 5.5\pt 0.0\pt 10.0\pt + "italic" "setitalic" 1 0.0\pt 5.5\pt 0.0\pt 10.0\pt + "large" "setlarge" 1 0.0\pt 6.50\pt 0.0\pt 12.0\pt + "Large" "setLarge" 1 0.0\pt 6.50\pt 0.0\pt 12.0\pt + "mark" "setmark" 1 0.0\pt 6.50\pt 0.0\pt 12.0\pt + "number" "setnumber" 1 0.0\pt 8.0\pt 0.0\pt 10.0\pt + "roman" "settext" 1 0.0\pt 5.6\pt 0.0\pt 10.0\pt } "dynamics" = \table { - "mf" "\\dynmf" - "fff" "\\dynfff" - "ff" "\\dynff" - "f" "\\dynf" - "mp" "\\dynmp" - "p" "\\dynp" - "pp" "\\dynpp" - "ppp" "\\dynppp" - "fp" "\\dynfp" - "sf" "\\dynsf" - "sfz" "\\dynsfz" + "mf" "dynmf" 0 + "fff" "dynfff" 0 + "ff" "dynff" 0 + "f" "dynf" 0 + "mp" "dynmp" 0 + "p" "dynp" 0 + "pp" "dynpp" 0 + "ppp" "dynppp" 0 + "fp" "dynfp" 0 + "sf" "dynsf" 0 + "sfz" "dynsfz" 0 } "align" = \table { - "-1" "\\leftalign{%}" - "0" "\\centeralign{%}" - "1" "\\rightalign{%}" + "-1" "leftalign" 1 + "0" "centeralign" 1 + "1" "rightalign" 1 } "bars" = \table { - "empty" "\\emptybar" - "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt - "|" "\\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt - "||" "\\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt - "|." "\\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt - ".|" "\\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - ".|." "\\fatdoublebar{%}" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|" "\\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt - "|:" "\\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|:" "\\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt + "empty" "emptybar" 0 + "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 20.0\pt + "||" "doublebar" 1 0.0\pt 5.0\pt 0.0\pt 20.0\pt + "|." "finishbar" 1 -5.0\pt 0.0\pt 0.0\pt 20.0\pt + ".|" "startbar" 1 0.0\pt 4.0\pt 0.0\pt 20.0\pt + ".|." "fatdoublebar" 1 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|" "repeatbar" 0 -10.0\pt 0.0\pt 0.0\pt 20.0\pt + "|:" "startrepeat" 0 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|:" "repeatbarstartrepeat" 0 0.0\pt 20.0\pt 0.0\pt 20.0\pt } "meters" = \table { - "C" "\\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "\\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt } % dims ignored for this table "param" = \table { - "bracket" "\\staffbracket{%}" 0.0\pt 0.0\pt 20.0\pt 160.0\pt - "rule" "\\rulesym{%}{%}" - "brace" "\\pianobrace{%}" 0.0\pt 0.0\pt 40.0\pt 100.0\pt - "time_signature" "\\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "stem" "\\stem{%}{%}" - "fill" "\\hbox{}" + "bracket" "staffbracket" 1 0.0\pt 0.0\pt 20.0\pt 160.0\pt + "rule" "rulesym" 2 + "brace" "pianobrace" 1 0.0\pt 0.0\pt 40.0\pt 100.0\pt + "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "stem" "stem" 2 + "fill" "hbox{}" 0 } "beamslopes" = \table { - "slope" "\\beamslope{%}{%}" 2.0\pt 64.0\pt 0.0\pt 0.0\pt - "horizontal" "\\rulesym{%}{%}" + "slope" "beamslope" 2 2.0\pt 64.0\pt 0.0\pt 0.0\pt + "horizontal" "rulesym" 2 } } diff --git a/init/table26.ly b/init/table26.ly index c9d7dbc412..07590b0353 100644 --- a/init/table26.ly +++ b/init/table26.ly @@ -8,68 +8,68 @@ table_twentysix = \symboltables { \font "feta26.afm" - % index TeXstring, xmin xmax ymin ymax + % index symbol #parameters xmin xmax ymin ymax "style" = \table { - "bold" "\\setbold{%}" 0.0\pt 7.50\pt 0.0\pt 8.0\pt - "dynamic" "\\setdynamic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "finger" "\\setfinger{%}" 0.0\pt 0.0\pt 0.0\pt 5.0\pt - "italic" "\\setitalic{%}" 0.0\pt 0.0\pt 0.0\pt 10.0\pt - "large" "\\setlarge{%}" 0.0\pt 9.50\pt 0.0\pt 12.0\pt - "number" "\\setnumber{%}" 0.0\pt 8.0\pt 0.0\pt 10.0\pt - "roman" "\\settext{%}" 0.0\pt 7.5\pt 0.0\pt 10.0\pt + "bold" "setbold" 1 0.0\pt 7.50\pt 0.0\pt 8.0\pt + "dynamic" "setdynamic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "finger" "setfinger" 1 0.0\pt 0.0\pt 0.0\pt 5.0\pt + "italic" "setitalic" 1 0.0\pt 0.0\pt 0.0\pt 10.0\pt + "large" "setlarge" 1 0.0\pt 9.50\pt 0.0\pt 12.0\pt + "number" "setnumber" 1 0.0\pt 8.0\pt 0.0\pt 10.0\pt + "roman" "settext" 1 0.0\pt 7.5\pt 0.0\pt 10.0\pt } "dynamics" = \table { - "mf" "\\dynmf" - "fff" "\\dynfff" - "ff" "\\dynff" - "f" "\\dynf" + "mf" "dynmf" 0 + "fff" "dynfff" 0 + "ff" "dynff" 0 + "f" "dynf" 0 - "mp" "\\dynmp" - "p" "\\dynp" - "pp" "\\dynpp" - "ppp" "\\dynppp" - "fp" "\\dynfp" - "sf" "\\dynsf" - "sfz" "\\dynsfz" + "mp" "dynmp" 0 + "p" "dynp" 0 + "pp" "dynpp" 0 + "ppp" "dynppp" 0 + "fp" "dynfp" 0 + "sf" "dynsf" 0 + "sfz" "dynsfz" 0 } "align" = \table { - "-1" "\\leftalign{%}" - "0" "\\centeralign{%}" - "1" "\\rightalign{%}" + "-1" "leftalign" 1 + "0" "centeralign" 1 + "1" "rightalign" 1 } "bars" = \table { - "empty" "\\emptybar" - "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt - "|" "\\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 20.0\pt - "||" "\\doublebar{%}" 0.0\pt 5.0\pt 0.0\pt 20.0\pt - "|." "\\finishbar{%}" -5.0\pt 0.0\pt 0.0\pt 20.0\pt - ".|" "\\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 20.0\pt - ".|." "\\fatdoublebar{%}" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|" "\\repeatbar" -10.0\pt 0.0\pt 0.0\pt 20.0\pt - "|:" "\\startrepeat" 0.0\pt 10.0\pt 0.0\pt 20.0\pt - ":|:" "\\repeatbarstartrepeat" 0.0\pt 20.0\pt 0.0\pt 20.0\pt + "empty" "emptybar" 0 + "" "" 0 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "maatstreep" 1 0.0\pt 0.64\pt 0.0\pt 20.0\pt + "||" "doublebar" 1 0.0\pt 5.0\pt 0.0\pt 20.0\pt + "|." "finishbar" 1 -5.0\pt 0.0\pt 0.0\pt 20.0\pt + ".|" "startbar" 1 0.0\pt 4.0\pt 0.0\pt 20.0\pt + ".|." "fatdoublebar" 1 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|" "repeatbar" 0 -10.0\pt 0.0\pt 0.0\pt 20.0\pt + "|:" "startrepeat" 0 0.0\pt 10.0\pt 0.0\pt 20.0\pt + ":|:" "repeatbarstartrepeat" 0 0.0\pt 20.0\pt 0.0\pt 20.0\pt } "meters" = \table { - "C" "\\fourfourmeter" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "C2" "\\allabreve" 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C" "fourfourmeter" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "C2" "allabreve" 0 0.0\pt 10.0\pt -5.0\pt 5.0\pt } % dims ignored for this table "param" = \table { - "brace" "\\pianobrace{%}" 0.0\pt 0.0\pt 32.0\pt 96.0\pt - "time_signature" "\\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt - "stem" "\\stem{%}{%}" - "fill" "\\hbox{}" - "rule" "\\rulesym{%}{%}" + "brace" "pianobrace" 1 0.0\pt 0.0\pt 32.0\pt 96.0\pt + "time_signature" "generalmeter" 2 0.0\pt 10.0\pt -5.0\pt 5.0\pt + "stem" "stem" 2 + "fill" "hbox{}" 0 + "rule" "rulesym" 2 } } diff --git a/lily/abbrev.cc b/lily/abbrev.cc index b5cf16e378..4af78938bc 100644 --- a/lily/abbrev.cc +++ b/lily/abbrev.cc @@ -13,7 +13,6 @@ #include "paper-def.hh" #include "lookup.hh" #include "stem.hh" -#include "dimension.hh" Abbreviation::Abbreviation () { diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index 91f4ff21f9..05464b9670 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -10,7 +10,6 @@ #include "p-col.hh" #include "array.hh" #include "proto.hh" -#include "dimension.hh" #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" diff --git a/lily/afm.cc b/lily/afm.cc index afd43bf1af..ac38313de7 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -39,7 +39,7 @@ Adobe_font_char_metric::width () Adobe_font_char_metric::Adobe_font_char_metric () { - C_ = 0; + C_ = -1; } Adobe_font_metric::Adobe_font_metric () diff --git a/lily/atom.cc b/lily/atom.cc index cbb5579563..76b59197d3 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -8,12 +8,12 @@ #include "atom.hh" -#include "tex.hh" #include "interval.hh" -#include "dimension.hh" #include "string.hh" #include "array.hh" #include "debug.hh" +#include "dimensions.hh" +#include "lookup.hh" #include "main.hh" inline bool @@ -29,7 +29,7 @@ Atom::check_infinity_b ()const if (abs (off_[ax]) >= 100 CM) { warning (_f ("ridiculous dimension: %s, %s", axis_name_str (ax), - print_dimen (off_[ax]))); + global_lookup_l->print_dimen (off_[ax]))); if (experimental_features_global_b) assert (false); @@ -76,7 +76,7 @@ Atom::Atom () But Atom is used as a simple type *everywhere*, and we don't have virtual contructors. */ - str_ = ps_output_global_b ? "unknown" : "\\unknown"; + str_ = global_lookup_l->unknown_str (); } Atom::Atom (String s, Box b) diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 8a79324621..76163d5b3f 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -16,7 +16,6 @@ #include "span-bar.hh" #include "stem.hh" #include "time-description.hh" -#include "dimension.hh" Bar_number_engraver::Bar_number_engraver() { diff --git a/lily/beam.cc b/lily/beam.cc index dea856499b..075f08df2d 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -21,7 +21,7 @@ #include "p-col.hh" #include "array.hh" #include "proto.hh" -#include "dimension.hh" +#include "dimensions.hh" #include "beam.hh" #include "abbreviation-beam.hh" #include "misc.hh" diff --git a/lily/bezier.cc b/lily/bezier.cc index e851e74f03..6eb7bbecfd 100644 --- a/lily/bezier.cc +++ b/lily/bezier.cc @@ -11,8 +11,8 @@ #include "misc.hh" #ifndef STANDALONE +#include "dimensions.hh" #include "direction.hh" -#include "dimension.hh" #include "paper-def.hh" #include "debug.hh" #include "main.hh" diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index f973976774..05644f0261 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -7,7 +7,7 @@ */ #include "break-align-item.hh" -#include "dimension.hh" +#include "dimensions.hh" void Break_align_item::do_pre_processing() diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 4b59b529ad..4af8ceadcd 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -7,9 +7,9 @@ */ #include "molecule.hh" -#include "dimension.hh" #include "crescendo.hh" #include "lookup.hh" +#include "dimensions.hh" #include "paper-def.hh" #include "debug.hh" #include "score-column.hh" diff --git a/lily/header.cc b/lily/header.cc index 680245dc1a..fc95d2f8b2 100644 --- a/lily/header.cc +++ b/lily/header.cc @@ -29,7 +29,7 @@ Header::tex_string () const s+= "\\def\\LilyIdString{" + lily_id_str_ + "}"; for (Dictionary_iter i (*this); i.ok (); i++) - s += "\\def\\mudela" + i.key () + "{" + i.val () + "}"; + s += "\\def\\mudela" + i.key () + "{" + i.val () + "}\n"; return s; } @@ -41,7 +41,7 @@ Header::ps_string () const s+= "/lily_id_string\n{" + lily_id_str_ + "} bind def\n"; for (Dictionary_iter i (*this); i.ok (); i++) - s += "/mudela" + i.key () + "{" + i.val () + "} bind def"; + s += "/mudela" + i.key () + "{" + i.val () + "} bind def\n"; return s; } diff --git a/lily/include/dimensions.hh b/lily/include/dimensions.hh new file mode 100644 index 0000000000..777d80e89c --- /dev/null +++ b/lily/include/dimensions.hh @@ -0,0 +1,18 @@ +#ifndef DIMENSIONS_HH +#define DIMENSIONS_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 + +#endif // DIMENSIONS_HH + diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index a1bedc7a24..40dc740c14 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -17,6 +17,7 @@ #include "curve.hh" #include "afm.hh" #include "symtable.hh" +#include "box.hh" /** handy interface to symbol table */ @@ -32,9 +33,12 @@ public: void add (String, Symtable*); virtual Atom afm_find (String s) const = 0; Atom afm_find (String, String) const; + virtual Atom* atom_p (String, int, Box) const = 0; Atom ball (int) const; Atom bar (String, Real height) const; + String base_output_str () const; Atom beam (Real,Real, Real) const; + virtual String character_str (int i) const; Atom clef (String) const; virtual Atom dashed_slur (Array controls, Real thick, Real dash) const = 0; Atom dots () const; @@ -42,17 +46,32 @@ public: Atom fill (Box b) const; Atom flag (int, Direction) const; virtual Atom hairpin (Real width, bool decresc, bool continued) const = 0; + virtual Lookup* lookup_p (Lookup const&) const = 0; + virtual Lookup* lookup_p (Symtables const&) const = 0; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const = 0; + virtual Paper_stream* paper_stream_p () const = 0; virtual Atom plet (Real dy, Real dx, Direction dir) const = 0; void print () const; virtual Atom ps_beam (Real slope, Real width, Real thick) const = 0; + virtual String print_dimen (Real) const; Atom rest (int, bool outside) const; Atom rule_symbol (Real height, Real width) const; Atom script (String idx) const; + /** paratime_signature substitution in lookup 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) const; + /// paratime_signature substitution in lookup strings + String substitute_args (String source, Array args) const; virtual Atom stem (Real y1_pos, Real y2_pos) const = 0; Atom stem (Real y1_pos, Real y2_pos, String) const; virtual Atom slur (Array controls) const = 0; Atom streepje (int type) const; - Atom text (String style, String text) const; + virtual Atom text (String style, String text) const; + virtual String unknown_str () const = 0; Atom vbrace (Real &dy) const; virtual Atom vbracket (Real &dy) const = 0; Atom special_time_signature (String, Array) const; diff --git a/lily/include/main.hh b/lily/include/main.hh index f5be0ca9ab..072813b2f1 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -24,7 +24,7 @@ extern bool no_timestamps_global_b; extern bool find_quarts_global_b; extern int exit_status_i_; extern bool experimental_features_global_b; -extern bool ps_output_global_b; +extern Lookup* global_lookup_l; extern bool dependency_global_b; extern bool version_ignore_global_b; diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 553cc89375..6b627f9377 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -21,12 +21,8 @@ */ -class Paper_score : public Music_output { - Paper_outputter *open_paper_outputter (Paper_stream*); - Paper_outputter *open_ps_outputter (Ps_stream*); - Paper_outputter *open_tex_outputter (Tex_stream*); - Paper_stream *open_output_stream (); - +class Paper_score : public Music_output +{ public: Paper_def *paper_l_; diff --git a/lily/include/ps-lookup.hh b/lily/include/ps-lookup.hh index 3e2c5e0821..84f4abdcee 100644 --- a/lily/include/ps-lookup.hh +++ b/lily/include/ps-lookup.hh @@ -20,13 +20,21 @@ public: virtual ~Ps_lookup (); virtual Atom afm_find (String s) const; - virtual Atom Ps_lookup::dashed_slur (Array controls, Real thick, Real dash) const; - virtual Atom Ps_lookup::hairpin (Real width, bool decresc, bool continued) const; - virtual Atom Ps_lookup::plet (Real dy , Real dx, Direction dir) const; - virtual Atom Ps_lookup::ps_beam (Real slope, Real width, Real thick) const; - virtual Atom Ps_lookup::slur (Array controls) const; + virtual Atom* atom_p (String, int, Box) const; + virtual String character_str (int i) const; + virtual Atom dashed_slur (Array controls, Real thick, Real dash) const; + virtual Atom hairpin (Real width, bool decresc, bool continued) const; + virtual Lookup* lookup_p (Lookup const&) const; + virtual Lookup* lookup_p (Symtables const&) const; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const; + virtual Paper_stream* paper_stream_p () const; + virtual Atom plet (Real dy , Real dx, Direction dir) const; + virtual Atom ps_beam (Real slope, Real width, Real thick) const; + virtual Atom slur (Array controls) const; virtual Atom stem (Real y1, Real y2) const; - virtual Atom Ps_lookup::vbracket (Real &y) const; + virtual Atom text (String style, String text) const; + virtual String unknown_str () const; + virtual Atom vbracket (Real &y) const; }; #endif // PS_LOOKUP_HH diff --git a/lily/include/tex-lookup.hh b/lily/include/tex-lookup.hh index fb306b927d..24aadf1644 100644 --- a/lily/include/tex-lookup.hh +++ b/lily/include/tex-lookup.hh @@ -21,13 +21,22 @@ public: virtual ~Tex_lookup(); virtual Atom afm_find (String s) const; + virtual String character_str (int i) const; virtual Atom dashed_slur (Array controls, Real thick, Real dash) const; + virtual Atom* atom_p (String, int, Box) const; Atom embed (Atom a) const; virtual Atom hairpin (Real width, bool decresc, bool continued) const; + virtual Lookup* lookup_p (Lookup const&) const; + virtual Lookup* lookup_p (Symtables const&) const; + virtual Paper_outputter* paper_outputter_p (Paper_stream*, Paper_def*, Header*, String) const; + virtual Paper_stream* paper_stream_p () const; virtual Atom plet (Real dy , Real dx, Direction dir) const; + virtual String print_dimen (Real) const; virtual Atom ps_beam (Real slope, Real width, Real thick) const; virtual Atom slur (Array controls) const; virtual Atom stem (Real y1, Real y2) const; + virtual Atom text (String style, String text) const; + virtual String unknown_str () const; virtual Atom vbracket (Real &y) const; }; diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 23f341dfa7..7933239518 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -7,7 +7,6 @@ */ #include "line-of-score.hh" -#include "dimension.hh" #include "spanner.hh" #include "atom.hh" #include "paper-def.hh" diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 3791f48b97..564b66ea9a 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -5,7 +5,6 @@ (c) 1997--1998 Han-Wen Nienhuys */ -#include "dimension.hh" #include "local-key-item.hh" #include "molecule.hh" #include "scalar.hh" diff --git a/lily/lookup.cc b/lily/lookup.cc index fc6843a497..8ba88483f5 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -14,9 +14,8 @@ #include "lookup.hh" #include "debug.hh" +#include "dimensions.hh" #include "symtable.hh" -#include "dimension.hh" -#include "tex.hh" #include "scalar.hh" #include "paper-def.hh" #include "string-convert.hh" @@ -78,7 +77,7 @@ Lookup::afm_find (String s, String str) const Adobe_font_char_metric m = afm_p_->find_char (s); Atom a; - if (m.width () ==0) + if (m.code () < 0) return a; a.dim_ = m.B_; @@ -110,6 +109,22 @@ Lookup::bar (String str, Real h) const return s; } +String +Lookup::base_output_str () const +{ + assert (paper_l_); + String str = paper_l_->get_default_output (); + + if (str.empty_b ()) + { + str = default_outname_base_global; + int def = paper_l_->get_next_default_count (); + if (def) + str += "-" + to_str (def); + } + return str; +} + Atom Lookup::beam (Real slope, Real width, Real thick) const { @@ -123,6 +138,12 @@ Lookup::beam (Real slope, Real width, Real thick) const return a; } +String +Lookup::character_str (int i) const +{ + return to_str (i); +} + Atom Lookup::clef (String st) const { @@ -166,6 +187,18 @@ Lookup::print () const #endif } +String +Lookup::print_dimen (Real r) const +{ + String s = to_str (r, "%.3f"); + if (s.index_i ("NaN") != -1) + { + warning (_ ("NaN")); + s = "0.0"; + } + return s; +} + Atom Lookup::rest (int j, bool o) const { @@ -180,9 +213,9 @@ Lookup::rule_symbol (Real height, Real width) const Array args; args.push (print_dimen (height)); args.push (print_dimen (width)); - bs.str_ = substitute_args (bs.str_,args); - bs.dim_.x () = Interval (0,width); - bs.dim_.y () = Interval (0,height); + bs.str_ = substitute_args (bs.str_, args); + bs.dim_.x () = Interval (0, width); + bs.dim_.y () = Interval (0, height); return bs; } @@ -195,16 +228,44 @@ Lookup::script (String str) const Atom Lookup::special_time_signature (String s, Array arr) const { - String symbolname="timesig-"+s+"%/%"; - Atom a (afm_find (substitute_args(symbolname,arr))); - if (!a.empty()) + String symbolname = "timesig-"+s+"%/%"; + Atom a (afm_find (substitute_args (symbolname, arr))); + if (!a.empty ()) return a; // Try if the full name was given - a=afm_find ("timesig-"+s); - if (!a.empty()) + a = afm_find ("timesig-"+s); + if (!a.empty ()) return a; // Resort to default layout with numbers - return time_signature(arr); + return time_signature (arr); +} + +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 +Lookup::substitute_args (String source, Array args) const +{ + String str (source); + for (int i = 0 ; i < args.size (); i++) + substitute_arg (str, args[i]); + return str; +} + +String +Lookup::substitute_args (String source, Array args) const +{ + Array sv; + for (int i = 0 ; i < args.size (); i++) + sv.push (args[i]); + return substitute_args (source, sv); } Atom @@ -295,7 +356,7 @@ Lookup::vbrace (Real &y) const { Array a; - a.push (to_str (idx)); + a.push (character_str (idx)); brace.str_ = substitute_args (brace.str_,a); brace.dim_[Y_AXIS] = Interval (-y/2,y/2); } diff --git a/lily/main.cc b/lily/main.cc index e07e46c750..33df5a1c83 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -11,6 +11,7 @@ #include #include #include "proto.hh" +#include "dimensions.hh" #include "plist.hh" #include "getopt-long.hh" #include "misc.hh" @@ -20,6 +21,8 @@ #include "config.hh" #include "file-results.hh" #include "debug.hh" +#include "ps-lookup.hh" +#include "tex-lookup.hh" #if HAVE_GETTEXT #include @@ -30,11 +33,13 @@ bool version_ignore_global_b = false; bool no_paper_global_b = false; bool no_timestamps_global_b = false; bool find_quarts_global_b = false; -bool ps_output_global_b = false; String default_outname_base_global = "lelie"; int default_count_global; File_path global_path; +Ps_lookup ps_lookup; +Tex_lookup tex_lookup; +Lookup* global_lookup_l = &tex_lookup; bool experimental_features_global_b = false; bool dependency_global_b = false; @@ -235,7 +240,7 @@ main (int argc, char **argv) { case 't': experimental_features_global_b = true; - ps_output_global_b = true; + global_lookup_l = &ps_lookup; break; case 'o': outname_str = oparser.optional_argument_ch_C_; diff --git a/lily/molecule.cc b/lily/molecule.cc index 032f0742fb..def5674fcf 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -7,12 +7,10 @@ */ #include "interval.hh" -#include "dimension.hh" #include "string.hh" #include "molecule.hh" #include "atom.hh" #include "debug.hh" -#include "tex.hh" Box Molecule::extent() const diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 279b6b9b36..c1df9ba763 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -11,7 +11,6 @@ #include "debug.hh" #include "paper-def.hh" #include "lookup.hh" -#include "dimension.hh" #include "rest.hh" #include "script.hh" #include "text-def.hh" diff --git a/lily/note-head.cc b/lily/note-head.cc index 00539b06d0..8245b67640 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -9,7 +9,6 @@ #include "misc.hh" #include "dots.hh" #include "note-head.hh" -#include "dimension.hh" #include "debug.hh" #include "paper-def.hh" #include "lookup.hh" diff --git a/lily/p-score.cc b/lily/p-score.cc index 0ab995f15c..25eaac2aa4 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -207,8 +207,9 @@ Paper_score::process () line_l_->space_processing (); Array breaking = calc_breaking (); - Paper_stream *paper_stream_p = open_output_stream (); - outputter_l_ = open_paper_outputter (paper_stream_p); + + Paper_stream* paper_stream_p = global_lookup_l->paper_stream_p (); + outputter_l_ = global_lookup_l->paper_outputter_p (paper_stream_p, paper_l_, header_l_, origin_str_); Link_array lines; for (int i=0; i < breaking.size (); i++) @@ -235,17 +236,12 @@ Paper_score::process () } - if (ps_output_global_b) - *paper_stream_p << "\nshowpage\n"; - else - *paper_stream_p << "\n\\EndLilyPondOutput"; - + // huh? delete outputter_l_; delete paper_stream_p; outputter_l_ = 0; } - void Paper_score::remove_line (Line_of_score *l) { @@ -276,101 +272,6 @@ Paper_score::remove_line (Line_of_score *l) } } -Paper_stream * -Paper_score::open_output_stream () -{ - // output - String base_outname=paper_l_->get_default_output (); - - if (base_outname.empty_b ()) - { - base_outname = default_outname_base_global; - int def = paper_l_->get_next_default_count (); - if (def) - { - base_outname += "-" + to_str (def); - } - } - - String outname = base_outname; - - Paper_stream* p; - if (ps_output_global_b) - { - if (outname != "-") - outname += ".ps"; - *mlog << _f ("PostScript output to %s...", - outname == "-" ? String ("") : outname ) << endl; - p = new Ps_stream (outname); - } - else - { - if (outname != "-") - outname += ".tex"; - *mlog << _f ("TeX output to %s...", - outname == "-" ? String ("") : outname ) << endl; - p = new Tex_stream (outname); - } - target_str_global_array.push (outname); - return p; -} - -// urg -Paper_outputter* -Paper_score::open_paper_outputter (Paper_stream* paper_stream_p) -{ - if (ps_output_global_b) - return open_ps_outputter ((Ps_stream*)paper_stream_p); - else - return open_tex_outputter ((Tex_stream*)paper_stream_p); -} - -// urg urg urg -Paper_outputter* -Paper_score::open_ps_outputter (Ps_stream *ps_out_p) -{ - Ps_outputter *interfees_p = new Ps_outputter (ps_out_p); - - if (header_global_p) - *ps_out_p << header_global_p->ps_string (); - - *ps_out_p << _ ("% outputting Score, defined at: ") << origin_str_ << '\n'; - - // urg - if (header_l_) - *ps_out_p << header_l_->ps_string (); - //aaarg - *ps_out_p << paper_l_->ps_output_settings_str (); - - if (experimental_features_global_b) - *ps_out_p << "turnOnExperimentalFeatures\n"; - - return interfees_p; -} - -Paper_outputter* -Paper_score::open_tex_outputter (Tex_stream *tex_out_p) -{ - Tex_outputter *interfees_p= new Tex_outputter (tex_out_p); - - if (header_global_p) - *tex_out_p << header_global_p->tex_string (); - - - *tex_out_p << _ ("% outputting Score, defined at: ") << origin_str_ << '\n'; - - if (header_l_) - *tex_out_p << header_l_->tex_string(); - *tex_out_p << paper_l_->tex_output_settings_str (); - - - if (experimental_features_global_b) - *tex_out_p << "\\turnOnExperimentalFeatures%\n"; - - *tex_out_p << "\\turnOnPostScript%\n"; - return interfees_p; -} - /** Get all breakable columns between l and r, (not counting l and r). */ Link_array Paper_score::breakable_col_range (Paper_column*l, Paper_column*r) const diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 2c006ad097..d3d4a67954 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -15,7 +15,6 @@ #include "lookup.hh" #include "ps-lookup.hh" #include "tex-lookup.hh" -#include "dimension.hh" #include "assoc-iter.hh" #include "score-engraver.hh" #include "p-score.hh" @@ -47,8 +46,7 @@ Paper_def::Paper_def (Paper_def const&s) lookup_p_assoc_p_ = new Assoc; for (Assoc_iter ai(*s.lookup_p_assoc_p_); ai.ok (); ai++) { - Lookup * l = ps_output_global_b ? new Ps_lookup (*ai.val ()) - : new Tex_lookup (*ai.val ()); + Lookup * l = global_lookup_l->lookup_p (*ai.val ()); l->paper_l_ = this; set_lookup (ai.key(), l); } @@ -219,7 +217,7 @@ Paper_def::ps_output_settings_str () const for (Assoc_iter i (*scope_p_); i.ok (); i++) s += String ("/mudelapaper") + i.key () + "{" + i.val ()->str () + "} bind def\n"; - s += *scope_p_->elem ("texsetting")->access_String (); + s += *scope_p_->elem ("pssetting")->access_String (); return s; } diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 2c47177b43..1e8d450c7b 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -12,11 +12,10 @@ #include "molecule.hh" #include "atom.hh" #include "array.hh" -#include "dimension.hh" -// urg, silly name -#include "tex.hh" #include "string-convert.hh" #include "debug.hh" +#include "lookup.hh" +#include "main.hh" Paper_outputter::Paper_outputter (Paper_stream *s) { @@ -43,10 +42,10 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm, St Array a; String r; - a.push (print_dimen (a_off.y())); - a.push (print_dimen (a_off.x())); + a.push (global_lookup_l->print_dimen (a_off.y())); + a.push (global_lookup_l->print_dimen (a_off.x())); a.push (i->str_); - r += substitute_args (s, a); + r += global_lookup_l->substitute_args (s, a); *outstream_l_ << r; } } diff --git a/lily/paper-stream.cc b/lily/paper-stream.cc index c878f4b4d0..72d14a69b5 100644 --- a/lily/paper-stream.cc +++ b/lily/paper-stream.cc @@ -9,7 +9,6 @@ #include #include -//#include "tex.hh" #include "main.hh" #include "paper-stream.hh" #include "debug.hh" @@ -79,6 +78,11 @@ Paper_stream::operator << (Scalar s) delete os; // we want to see the remains. assert (nest_level>=0); } + + /* don't break line if not nested; very ugly for ps */ + if (nest_level == 0) + break; + /* FALLTHROUGH */ case '\n': diff --git a/lily/ps-lookup.cc b/lily/ps-lookup.cc index fd9d887350..f488b5e92a 100644 --- a/lily/ps-lookup.cc +++ b/lily/ps-lookup.cc @@ -8,13 +8,17 @@ #include "ps-lookup.hh" #include "debug.hh" +#include "dimensions.hh" #include "symtable.hh" -#include "dimension.hh" -#include "tex.hh" #include "scalar.hh" #include "paper-def.hh" #include "string-convert.hh" #include "main.hh" +#include "file-results.hh" +#include "header.hh" +#include "paper-stream.hh" +#include "ps-stream.hh" +#include "ps-outputter.hh" Ps_lookup::Ps_lookup () : Lookup () @@ -38,7 +42,21 @@ Ps_lookup::~Ps_lookup () Atom Ps_lookup::afm_find (String s) const { - return Lookup::afm_find (s, String ("(%d)")); + return Lookup::afm_find (s, String ("(\\%03o) show ")); +} + +Atom* +Ps_lookup::atom_p (String s, int n, Box b) const +{ + for (int i = 0; i < n; i++) + s.prepend ("% "); + return new Atom (s, b); +} + +String +Ps_lookup::character_str (int i) const +{ + return to_str (i, "(\\%03o)"); } Atom @@ -64,7 +82,7 @@ Ps_lookup::dashed_slur (Array controls, Real thick, Real dash) const ps += "[" + String_convert::double_str (on) + " "; ps += String_convert::double_str (off) + "] "; ps += String_convert::int_str (0) + " "; - ps += " draw_dashed_slur"; + ps += "draw_dashed_slur "; Atom a; a.str_ = ps; @@ -94,6 +112,53 @@ Ps_lookup::hairpin (Real width, bool decresc, bool continued) const return a; } +Lookup* +Ps_lookup::lookup_p (Lookup const& l) const +{ + return new Ps_lookup (l); +} + +Lookup* +Ps_lookup::lookup_p (Symtables const& s) const +{ + return new Ps_lookup (s); +} + +Paper_outputter* +Ps_lookup::paper_outputter_p (Paper_stream* os_p, Paper_def* paper_l, Header* header_l, String origin_str) const +{ + if (header_global_p) + *os_p << header_global_p->ps_string (); + + *os_p << _ ("\n% outputting Score, defined at: ") << origin_str << '\n'; + + if (header_l) + *os_p << header_l->ps_string (); + *os_p << paper_l->ps_output_settings_str (); + + if (experimental_features_global_b) + *os_p << "turnOnExperimentalFeatures\n"; + + return new Ps_outputter (os_p); +} + +Paper_stream* +Ps_lookup::paper_stream_p () const +{ +#if 1 + String outname = base_output_str (); +#else + String outname = "lelie"; +#endif + + if (outname != "-") + outname += ".ps"; + *mlog << _f ("PostScript output to %s...", + outname == "-" ? String ("") : outname ) << endl; + target_str_global_array.push (outname); + return new Ps_stream (outname); +} + Atom Ps_lookup::plet (Real dy , Real dx, Direction dir) const { @@ -102,7 +167,7 @@ Ps_lookup::plet (Real dy , Real dx, Direction dir) const ps += String_convert::double_str (dx) + " " + String_convert::double_str (dy) + " " + String_convert::int_str ( (int)dir) + - " draw_plet"; + " draw_plet "; Atom s; s.str_ = ps; @@ -114,7 +179,7 @@ Ps_lookup::ps_beam (Real slope, Real width, Real thick) const { String ps; ps += to_str (width) + " "+ to_str (slope) + " " + to_str (thick) - + " draw_beam"; + + " draw_beam "; Atom s; s.str_ = ps; @@ -145,7 +210,7 @@ Ps_lookup::slur (Array controls) const ps += String_convert::double_str (controls[0].x ()) + " " + String_convert::double_str (controls[0].y ()) + " "; - ps += " draw_slur"; + ps += " draw_slur "; Atom s; s.str_ = ps; @@ -159,8 +224,19 @@ Ps_lookup::slur (Array controls) const Atom Ps_lookup::stem (Real y1, Real y2) const { - // return Lookup::stem (y1, y2, "\\kern %\\vrule width % height % depth %"); - return Lookup::stem (y1, y2, "% % moveto % % lineto"); + return Lookup::stem (y1, y2, "\n% % % % draw_stem "); +} + +Atom +Ps_lookup::text (String style, String text) const +{ + return Lookup::text (style, "(" + text + ")"); +} + +String +Ps_lookup::unknown_str () const +{ + return "unknown "; } Atom @@ -174,7 +250,7 @@ Ps_lookup::vbracket (Real &y) const + " " + _ ("too small") + " (" + print_dimen (y) + ")"); // y = min_y; } - psbracket.str_ = to_str (y) + " draw_bracket"; + psbracket.str_ = to_str (y) + " draw_bracket "; psbracket.dim_[Y_AXIS] = Interval (-y/2,y/2); psbracket.dim_[X_AXIS] = Interval (0,4 PT); return psbracket; diff --git a/lily/ps-outputter.cc b/lily/ps-outputter.cc index 768270a8a2..d0ad70ef39 100644 --- a/lily/ps-outputter.cc +++ b/lily/ps-outputter.cc @@ -12,8 +12,6 @@ #include "molecule.hh" #include "atom.hh" #include "array.hh" -#include "dimension.hh" -#include "tex.hh" #include "string-convert.hh" #include "debug.hh" @@ -32,7 +30,9 @@ Ps_outputter::~Ps_outputter () static String ps_font_command(int i) { - return "\\font" +String_convert::form_str ("%c", 'A' + i) ; +// urg +// return "%\\font" + String_convert::form_str ("%c", 'A' + i) + "\n"; + return "\n/feta20 findfont 12 scalefont setfont "; } void @@ -52,8 +52,8 @@ Ps_outputter::switch_to_font (String fontname) font_arr_.push (fontname); - *outstream_l_ << "\\font" + ps_font_command (i) << "=" + fontname << "\n"; - *outstream_l_<< ps_font_command (i); + *outstream_l_ << "%\\font" + ps_font_command (i) << "% =" + fontname << "\n"; + *outstream_l_<< ps_font_command (i) << "\n"; } void @@ -62,20 +62,19 @@ Ps_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) if (check_debug) *outstream_l_ << String ("\n%start: ") << nm << "\n"; - Paper_outputter::output_molecule (m, o, nm, "% % % placebox"); + Paper_outputter::output_molecule (m, o, nm, "% % {%}placebox \n"); } void Ps_outputter::start_line () { - *outstream_l_ << "\\hbox{%\n"; + *outstream_l_ << "\nstart_line {\n"; } void Ps_outputter::stop_line () { - *outstream_l_ << "}"; - *outstream_l_ << "\\interscoreline"; + *outstream_l_ << "}\nstop_line\n"; current_font_ = ""; font_arr_.clear (); } diff --git a/lily/ps-stream.cc b/lily/ps-stream.cc index 970b75f695..4bdbc9e2bf 100644 --- a/lily/ps-stream.cc +++ b/lily/ps-stream.cc @@ -20,17 +20,22 @@ Ps_stream::Ps_stream (String filename) header (); } +Ps_stream::~Ps_stream () +{ + *os << "\nshowpage\n"; +} + void Ps_stream::header () { - *os << _ ("%%!PS Adobe\n"); + *os << _ ("%!PS-Adobe-3.0\n"); // urg, merge with Tex - *os << _ ("% Creator: "); + *os << _ ("%%Creator: "); if (no_timestamps_global_b) *os << "GNU LilyPond\n"; else *os << get_version_str () << '\n'; - *os << _ ("% Automatically generated"); + *os << _ ("%%Automatically generated"); if (no_timestamps_global_b) *os << ".\n"; else @@ -41,10 +46,6 @@ Ps_stream::header () } } -Ps_stream::~Ps_stream () -{ -} - // print string. don't forget indent. Paper_stream& Ps_stream::operator << (Scalar s) diff --git a/lily/rod.cc b/lily/rod.cc index 1b2ae4f824..229af033c2 100644 --- a/lily/rod.cc +++ b/lily/rod.cc @@ -9,8 +9,8 @@ #include "rod.hh" #include "p-col.hh" #include "debug.hh" +#include "dimensions.hh" #include "single-malt-grouping-item.hh" -#include "dimension.hh" Rod::Rod (Single_malt_grouping_item *l, Single_malt_grouping_item *r) diff --git a/lily/score-element.cc b/lily/score-element.cc index 64b0a422da..b92945e285 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -16,8 +16,6 @@ #include "molecule.hh" #include "score-element.hh" #include "debug.hh" -#include "tex.hh" -#include "dimension.hh" #include "spanner.hh" #include "line-of-score.hh" #include "item.hh" diff --git a/lily/scores.cc b/lily/scores.cc index 257ead14c1..9b2a80bee3 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -17,6 +17,7 @@ #include "file-results.hh" #include "my-lily-parser.hh" #include "source.hh" +#include "lookup.hh" Sources* source_global_l = 0; Array inclusion_global_array; @@ -124,6 +125,16 @@ do_one_file (String init_str, String file_str) parser.set_version_check (version_ignore_global_b); parser.parse_file (init_str, file_str); + /* + urg + when calling {Ps,Tex}_lookup::paper_stream_p (), + it *appears* (aaargh, latest gdb on ppc is gdb 4.16.97) + that (global_lookup_l's) + paper_l_ is invalid but not NULL + (deleted without being reset maybe?) + */ + global_lookup_l->paper_l_ = parser.default_paper_p (); + if (parser.error_level_i_) { exit_status_i_ = 1; diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 678853185b..331201d4d0 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -6,9 +6,9 @@ (c) 1997--1998 Han-Wen Nienhuys */ -#include "dimension.hh" #include "span-bar.hh" #include "lookup.hh" +#include "dimensions.hh" #include "atom.hh" #include "paper-def.hh" #include "molecule.hh" diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc index 22ed79da20..99939fcd6b 100644 --- a/lily/spring-spacer.cc +++ b/lily/spring-spacer.cc @@ -12,13 +12,13 @@ #include "spring-spacer.hh" #include "p-col.hh" #include "debug.hh" +#include "dimensions.hh" #include "qlp.hh" #include "unionfind.hh" #include "idealspacing.hh" #include "pointer.tcc" #include "score-column.hh" #include "paper-def.hh" -#include "dimension.hh" #include "colhpos.hh" Vector diff --git a/lily/staff-side.cc b/lily/staff-side.cc index ec82d64aad..bec8df6367 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -8,10 +8,10 @@ #include "interval.hh" #include "paper-def.hh" -#include "dimension.hh" #include "staff-side.hh" #include "staff-sym.hh" #include "debug.hh" +#include "dimensions.hh" Staff_side::Staff_side() diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc index d329e82185..88a3a457c6 100644 --- a/lily/staff-sym.cc +++ b/lily/staff-sym.cc @@ -7,10 +7,10 @@ */ #include "staff-sym.hh" #include "lookup.hh" +#include "dimensions.hh" #include "paper-def.hh" #include "molecule.hh" #include "debug.hh" -#include "dimension.hh" #include "item.hh" diff --git a/lily/stem-info.cc b/lily/stem-info.cc index 535cc6f7d7..1f17c945dc 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -8,7 +8,6 @@ */ #include "proto.hh" -#include "dimension.hh" #include "misc.hh" #include "debug.hh" #include "atom.hh" diff --git a/lily/stem.cc b/lily/stem.cc index 454f6d7f7a..b9e7e59b8a 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -9,7 +9,6 @@ */ #include "stem.hh" -#include "dimension.hh" #include "debug.hh" #include "paper-def.hh" #include "note-head.hh" diff --git a/lily/symtable.cc b/lily/symtable.cc index d09dbb0b44..94aba34bea 100644 --- a/lily/symtable.cc +++ b/lily/symtable.cc @@ -7,7 +7,6 @@ */ #include "misc.hh" -#include "dimension.hh" #include "debug.hh" #include "real.hh" #include "atom.hh" diff --git a/lily/tex-lookup.cc b/lily/tex-lookup.cc index 480ff14468..3e82c82a59 100644 --- a/lily/tex-lookup.cc +++ b/lily/tex-lookup.cc @@ -10,12 +10,15 @@ #include "tex-lookup.hh" #include "debug.hh" #include "symtable.hh" -#include "dimension.hh" -#include "tex.hh" #include "scalar.hh" #include "paper-def.hh" #include "string-convert.hh" #include "main.hh" +#include "file-results.hh" +#include "header.hh" +#include "paper-stream.hh" +#include "tex-stream.hh" +#include "tex-outputter.hh" Tex_lookup::Tex_lookup () : Ps_lookup () @@ -42,6 +45,22 @@ Tex_lookup::afm_find (String s) const return Lookup::afm_find (s, String ("\\char%d")); } +Atom* +Tex_lookup::atom_p (String s, int n, Box b) const +{ + if (s.length_i ()) + s.prepend ("\\"); + for (int i = 0; i < n; i++) + s += "{%}"; + return new Atom (s, b); +} + +String +Tex_lookup::character_str (int i) const +{ + return Lookup::character_str (i); +} + Atom Tex_lookup::dashed_slur (Array controls, Real thick, Real dash) const { @@ -67,6 +86,69 @@ Tex_lookup::plet (Real dy , Real dx, Direction dir) const return embed (Ps_lookup::plet (dy, dx, dir)); } +Lookup* +Tex_lookup::lookup_p (Lookup const& l) const +{ + return new Tex_lookup (l); +} + +Lookup* +Tex_lookup::lookup_p (Symtables const& s) const +{ + return new Tex_lookup (s); +} + +Paper_outputter* +Tex_lookup::paper_outputter_p (Paper_stream* os_p, Paper_def* paper_l, Header* header_l, String origin_str) const +{ + if (header_global_p) + *os_p << header_global_p->tex_string (); + + *os_p << _ ("\n% outputting Score, defined at: ") << origin_str << '\n'; + + if (header_l) + *os_p << header_l->tex_string(); + *os_p << paper_l->tex_output_settings_str (); + + if (experimental_features_global_b) + *os_p << "\\turnOnExperimentalFeatures%\n"; + + *os_p << "\\turnOnPostScript%\n"; + + return new Tex_outputter (os_p); +} + +Paper_stream * +Tex_lookup::paper_stream_p () const +{ +#if 1 + String outname = base_output_str (); +#else + String outname = "lelie"; +#endif + + Paper_stream* p; + if (outname != "-") + outname += ".tex"; + *mlog << _f ("TeX output to %s...", + outname == "-" ? String ("") : outname ) << endl; + p = new Tex_stream (outname); + target_str_global_array.push (outname); + return p; +} + +String +Tex_lookup::print_dimen (Real r) const +{ + String s = to_str (r, "%.3f"); + if (s.index_i ("NaN") != -1) + { + warning (_ ("NaN")); + s = "0.0"; + } + return Lookup::print_dimen (r) + "pt"; +} + Atom Tex_lookup::ps_beam (Real slope, Real width, Real thick) const { @@ -85,6 +167,18 @@ Tex_lookup::stem (Real y1, Real y2) const return Lookup::stem (y1, y2, "\\kern %\\vrule width % height % depth %"); } +Atom +Tex_lookup::text (String style, String text) const +{ + return Lookup::text (style, text); +} + +String +Tex_lookup::unknown_str () const +{ + return "\\unknown"; +} + Atom Tex_lookup::vbracket (Real &y) const { diff --git a/lily/tex-outputter.cc b/lily/tex-outputter.cc index 30aff3b9d0..89ebf31623 100644 --- a/lily/tex-outputter.cc +++ b/lily/tex-outputter.cc @@ -12,8 +12,6 @@ #include "molecule.hh" #include "atom.hh" #include "array.hh" -#include "dimension.hh" -#include "tex.hh" #include "string-convert.hh" #include "debug.hh" diff --git a/lily/tex-stream.cc b/lily/tex-stream.cc index 90764d289a..d803058002 100644 --- a/lily/tex-stream.cc +++ b/lily/tex-stream.cc @@ -10,7 +10,6 @@ #include #include -#include "tex.hh" #include "main.hh" #include "tex-stream.hh" #include "debug.hh" @@ -21,6 +20,11 @@ Tex_stream::Tex_stream (String filename) header (); } +Tex_stream::~Tex_stream () +{ + *os << "\n\\EndLilyPondOutput"; +} + void Tex_stream::header () { @@ -41,10 +45,6 @@ Tex_stream::header () } } -Tex_stream::~Tex_stream () -{ -} - // print string. don't forget indent. Paper_stream& Tex_stream::operator << (Scalar s) diff --git a/lily/text-def.cc b/lily/text-def.cc index 6c1664017b..3597f30e5e 100644 --- a/lily/text-def.cc +++ b/lily/text-def.cc @@ -11,7 +11,6 @@ #include "paper-def.hh" #include "molecule.hh" #include "text-def.hh" -#include "dimension.hh" #include Direction diff --git a/make/STATE-VECTOR b/make/STATE-VECTOR index f416bba8c2..1b57fde05f 100644 --- a/make/STATE-VECTOR +++ b/make/STATE-VECTOR @@ -92,3 +92,9 @@ 1.0.12 1.0.12.uu1 1.0.13 +1.0.13.jcn1 +1.0.13.jcn2 +1.0.13.jcn3 +1.0.13.jcn4 +1.0.13.jcn5 +1.0.14 diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 2a2468d6f7..db210b4e5c 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -2,9 +2,10 @@ depth = .. -STEPMAKE_TEMPLATES=metafont +STEPMAKE_TEMPLATES=metafont metapost + +EXTRA_DIST_FILES += TODO README feta.mp mfmp.ini -EXTRA_DIST_FILES += TODO README FET_FILES = $(wildcard feta[0-9]*.mf) diff --git a/mf/feta.mp b/mf/feta.mp new file mode 100644 index 0000000000..7f0c80c8b4 --- /dev/null +++ b/mf/feta.mp @@ -0,0 +1,48 @@ +% feta.mp + +batchmode; + +mode_def ljfour = + proofing:=0; % no, we're not making proofs + fontmaking:=1; % yes, we are making a font + tracingtitles:=0; % no, don't show titles at all + pixels_per_inch:=600; % that's the meaning of lowres + blacker:=.25; % make pens a bit blacker + fillin:=.0; % compensate for diagonal fillin + o_correction:=1; % but don't overshoot as much + enddef; + +if false: +def mode_param (suffix v) (expr e) = + if unknown mode_guard_.v: + v := e; + mode_guard_.v := 1; + fi +enddef; + +% This macro is invoked by all the modes, after |pixels_per_inch| +% has been defined, thus saving some space and time. +def mode_common_setup_ = + mode_param (proofing, 0); + mode_param (fontmaking, 1); + mode_param (tracingtitles, if pixels_per_inch > 700: 1 else: 0 fi); +enddef; + +% Works for a 600$\,$dpi Accel-a-Writer {\tt mackay@cs.washington.edu}, +% 16 August 95. +mode_def ljfour = %\[ HP LaserJet 4 (600dpi) + mode_param (pixels_per_inch, 600); + mode_param (blacker, .25); + mode_param (fillin, 0); + mode_param (o_correction, 1); + mode_common_setup_; +enddef; + +laserjetfour := ljfour; +fi + +mode=ljfour; +mag=100.0; + +input feta20.mf + diff --git a/mf/mfmp.ini b/mf/mfmp.ini new file mode 100644 index 0000000000..1b0e00c26b --- /dev/null +++ b/mf/mfmp.ini @@ -0,0 +1,4 @@ +\input mfplain +\input modes +\dump + diff --git a/stepmake/NEWS b/stepmake/NEWS index fe5a858598..3b27f3db08 100644 --- a/stepmake/NEWS +++ b/stepmake/NEWS @@ -1,3 +1,6 @@ +pl 56 + - crude metapost stuff + pl 55 - table-to-html stuff moved . diff --git a/stepmake/VERSION b/stepmake/VERSION index 8f110f1f6d..57fd582a8e 100644 --- a/stepmake/VERSION +++ b/stepmake/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=StepMake MAJOR_VERSION=0 MINOR_VERSION=1 -PATCH_LEVEL=55 +PATCH_LEVEL=56 MY_PATCH_LEVEL= # use the above to send patches, always empty for released version: diff --git a/stepmake/stepmake/metapost-rules.make b/stepmake/stepmake/metapost-rules.make new file mode 100644 index 0000000000..302e6d757c --- /dev/null +++ b/stepmake/stepmake/metapost-rules.make @@ -0,0 +1,15 @@ + +$(outdir)/%.pfa: %.mf +# urg +# i've got no idea what this scaling could be for, on both sides... +# it seems that 'low_res', which should be all we ever need according +# to the metapost mfplain guru, really does 200dpi, iso 600dpi (minimun) + -mp "&mfplain \mode=lowres; \mag=100.0; batchmode; input $<" +# -mp "&mfmp \mode=ljfour; \mag=100.0; batchmode; input $<" +# -mp "&mfplain modes \mode=ljfour; \mag=100.0; batchmode; \\input $<" +# -mp "&mfplain \mode=lowres; \mag=10.0; batchmode; input $<" +# -mp "&mfplain \mode=lowres; \mag=1.0; batchmode; input $<" + $(PYTHON) $(depth)/buildscripts/ps-to-pfa.py $< + rm -f $(basename $(@F)).[0-9]* + rm -f $(basename $<).log $(basename $<).tfm + diff --git a/stepmake/stepmake/metapost-targets.make b/stepmake/stepmake/metapost-targets.make new file mode 100644 index 0000000000..1f38b31be8 --- /dev/null +++ b/stepmake/stepmake/metapost-targets.make @@ -0,0 +1,3 @@ + +pfa: $(PFA_FILES) + diff --git a/stepmake/stepmake/metapost-vars.make b/stepmake/stepmake/metapost-vars.make new file mode 100644 index 0000000000..c8c73d2168 --- /dev/null +++ b/stepmake/stepmake/metapost-vars.make @@ -0,0 +1,7 @@ + +# MF_FILES := $(wildcard *.mf) +# FONT_FILES = $(wildcard *[0-9].mf) +# EXTRA_DIST_FILES += $(MF_FILES) +MP_PFA_FILES = $(addprefix $(outdir)/, $(FONT_FILES:.mf=.pfa)) +PFA_FILES += $(MP_PFA_FILES) + diff --git a/tex/GNUmakefile b/tex/GNUmakefile index 16b47023ad..c6f3822ec1 100644 --- a/tex/GNUmakefile +++ b/tex/GNUmakefile @@ -4,7 +4,8 @@ depth = .. TEX_FILES = $(wildcard *.tex) -EXTRA_DIST_FILES = $(TEX_FILES) + +EXTRA_DIST_FILES = $(TEX_FILES) lilyponddefs.ps INSTALLATION_DIR=$(TEXDIR)/lilypond INSTALLATION_FILES=$(TEX_FILES) diff --git a/tex/lilyponddefs.ps b/tex/lilyponddefs.ps new file mode 100644 index 0000000000..b3ba94564e --- /dev/null +++ b/tex/lilyponddefs.ps @@ -0,0 +1,304 @@ +%!PS-Adobe-3.0: lilyponddefs + +% hmm +/setgray { 1 add } bind def + +/xoffset 30 def +/yoffset 700 def +/staffrulethickness 1 def +/staffheight 20 def + +% round cappings +1 setlinecap + +/placebox +{ + /object exch def + gsave + exch translate + 0 0 moveto + object + grestore +} bind def + +/settext +{ + gsave + % urg + /Times-Roman findfont 12 scalefont setfont + show + grestore +} bind def + +/vrule % width height depth +{ + gsave + 3 -1 roll setlinewidth + neg 0 exch moveto + 0 exch lineto stroke + grestore +} bind def + +/draw_stem % kern width height depth +{ + gsave + 4 -1 roll neg 0 translate + vrule + grestore +} bind def + +/widthbar % height width +{ + gsave + setlinewidth + 2 div dup neg 0 exch moveto + 0 exch lineto stroke + 2 div + grestore +} bind def + +/thickbar % height +{ + stafflinethickness 2 mul widthbar +} bind def + +/thinbar % height +{ + stafflinethickness 1.6 mul widthbar +} bind def + +/maatstreep +{ + thinbar +} bind def + +/finishbar +{ + thickbar +} bind def + +/generalmeter +{ +} bind def + +/pianobrace +{ + gsave + /feta-braces20 findfont 12 scalefont setfont% + show + grestore +} bind def + +/repeatbar +{ +} bind def + +/start_line +{ + gsave + xoffset yoffset translate +} bind def + +/stop_line +{ + /object exch def + 0 0 moveto pathbbox exch pop sub exch pop + object + grestore + yoffset add /yoffset exch def + % urg... + yoffset staffheight 8 mul sub /yoffset exch def +} bind def + +/unknown {} bind def + +/turnOnExperimentalFeatures { } bind def + +/rulesym % thick length +{ + gsave + exch setlinewidth + 0 lineto stroke + grestore +} bind def + +/draw_beam +{ + 2 div /beam_thick exch def + /beam_slope exch def + /beam_wd exch def + beam_slope beam_wd mul /beam_ht exch def + 0 beam_thick neg moveto + beam_wd beam_ht rlineto + 0 beam_thick 2 mul rlineto + 0 beam_thick lineto + closepath fill +} bind def +% +/draw_decresc + { + staffrulethickness setlinewidth + /cresc_cont exch def + /cresc_ht exch def + /cresc_wd exch def +% + cresc_wd cresc_cont moveto + 0 cresc_ht lineto + stroke + cresc_wd cresc_cont neg moveto + 0 cresc_ht neg lineto + stroke + } + bind def + /draw_cresc + { + staffrulethickness setlinewidth + /cresc_cont exch def + /cresc_ht exch def + /cresc_wd exch def +% + 0 cresc_cont moveto + cresc_wd cresc_ht lineto + stroke + 0 cresc_cont neg moveto + cresc_wd cresc_ht neg lineto + stroke + } + bind def + /lily_distance { + 1 copy mul exch 1 copy mul add sqrt + } bind def +staffrulethickness 1.2 mul /plet_t exch def +/draw_plet +{ + plet_t setlinewidth + true setstrokeadjust + 1 setlinecap + 1 setlinejoin + /dir exch def + /plet_dy exch def + /plet_dx exch def + staffheight 2 div /plet_gapx exch def + plet_dy plet_dx div plet_gapx mul /plet_gapy exch def + staffheight 4 div dir mul /plet_h exch def +% + 0 0 moveto + 0 plet_h lineto + plet_dx plet_gapx sub 2 div + plet_dy plet_gapy sub 2 div plet_h add lineto + plet_dx plet_gapx add 2 div + plet_dy plet_gapy add 2 div plet_h add moveto + plet_dx plet_dy plet_h add lineto + plet_dx plet_dy lineto + stroke +} bind def +% +/draw_slur +{ + staffrulethickness setlinewidth + moveto + curveto + lineto + curveto + gsave + fill + grestore + stroke +} bind def +% +/draw_dashed_slur +{ + 1 setlinecap + 1 setlinejoin + setdash + setlinewidth + moveto + curveto + stroke +} bind def +% +staffheight 4 div /interline exch def +% +/bracket_traject +{ + /traject_ds exch def + /traject_alpha exch def + traject_ds traject_alpha sin mul add + exch + traject_ds traject_alpha cos mul add + exch +} bind def +% +% too fat for 20pt +% interline 2 div /bracket_b exch def +interline 3 div /bracket_b exch def +interline 2 mul /bracket_w exch def +staffrulethickness /stafflinethickness exch def +stafflinethickness 2 mul /bracket_t exch def +interline 1.5 mul /bracket_v exch def +bracket_v /bracket_u exch def +50 /bracket_alpha exch def +% +/half_bracket +{ +%6 + 0 0 +%5a + bracket_b bracket_v add bracket_h bracket_t sub bracket_u add + bracket_alpha bracket_v -0.15 mul bracket_traject +%5b + 1 bracket_h + 0 bracket_v 0.5 mul bracket_traject +%5c + 0 bracket_h +%4a + bracket_b bracket_h bracket_t sub + 0 bracket_v 0.4 mul bracket_traject +%4b + bracket_b bracket_v add bracket_h bracket_t sub bracket_u add + bracket_alpha bracket_v -0.25 mul bracket_traject +%4c + bracket_b bracket_v add bracket_h bracket_t sub bracket_u add +%3 + bracket_b bracket_h bracket_t sub +%2 + bracket_b 0 +%1 + 0 0 +} bind def +% +/draw_half_bracket { + moveto + lineto + lineto + curveto + curveto + lineto + gsave + fill + grestore +} bind def +% +/draw_bracket +{ + 2 div bracket_b add /bracket_h exch def + bracket_t setlinewidth + true setstrokeadjust + 1 setlinecap + 1 setlinejoin + half_bracket + 20 copy + 1 -1 scale + draw_half_bracket + stroke + 1 -1 scale +% ugh, ugh: + 0.05 0 translate + draw_half_bracket + stroke +} bind def + +stafflinethickness setlinewidth + +% see if we're there... +% 10 setlinewidth 0 0 moveto 400 800 lineto stroke