X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ps%2Flilyponddefs.ps;h=542513c4e2a5bb0501403f636f810543c8af6e50;hb=98ba77f9a972c75e431f29a47df18676c3d65621;hp=9a369e9d51fad65867b93be78863447de8b6771d;hpb=8f58f4428d70961938e9151097886d861b3faeb3;p=lilypond.git diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 9a369e9d51..542513c4e2 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -1,17 +1,31 @@ -%!PS-Adobe-1.0: lilyponddefs +%!PS-Adobe-2.0: lilyponddefs.ps +% TODO: +% * junk all magic, start-line/stop-line just: placebox @ x.y +% +% Functions for direct PostScript output + +% /setgray { 1 add } bind def + +% To let gs load fonts from builddir, do: +% export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm -% hmm -/setgray { 1 add } bind def -% urg -1 /stafflinethickness exch def +/set-ps-scale-to-lily-scale { output-scale output-scale scale } bind def -/xoffset 30 def -/yoffset 700 def -/staffrulethickness 1 def -/staffheight 20 def +/init-paper { + gsave + .1 setlinewidth + clippath pathbbox newpath + /vsize exch def + /hsize exch def pop pop pop + % FIXME + /top-margin 2 def + hsize line-width sub 2 div /left-margin exch def + grestore +} bind def -/placebox + +/place-box { /object exch def gsave @@ -22,190 +36,55 @@ grestore } bind def -/setbold % '(' text ')' -{ - settext -} bind def - -/settext % '(' text ')' -{ - gsave - % urg - /Times-Roman findfont 12 scalefont setfont - show - grestore -} bind def - -/setfinger % '(' text ')' -{ - gsave - % urg - /feta-nummer5 findfont 12 scalefont setfont - show - grestore -} bind def - -/setitalic % '(' text ')' -{ - gsave - % urg - /Times-Italic findfont 12 scalefont setfont - show - grestore -} bind def - -/vrule % width depth height -{ -} bind def - - -% -% FIXME. translate to middle of box. -% - -/draw_box % breapth width depth height -{ - gsave - 4 -1 roll - dup - neg 0 translate - 4 -1 roll - add - - setlinewidth - - 0 exch moveto - neg 0 exch lineto stroke - - grestore -} bind def - -/extender % width -{ - gsave - 0 0 moveto - stafflinethickness 0.8 mul setlinewidth - 0 lineto stroke - 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 % height -{ - thinbar -} bind def - -/fatdoublebar -{ - thickbar -} bind def - -/finishbar -{ - thickbar -} bind def - -/generalmeter % num den -{ - pop pop -} bind def - -/pianobrace % '(' char ')' -{ - gsave - /feta-braces20 findfont 12 scalefont setfont% - show - grestore -} bind def - -/doublebar -{ - thinbar -} bind def - -/repeatbar -{ - thickbar -} bind def - -/repeatbarstartrepeat -{ - thickbar -} bind def +%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html -/startbar -{ - thickbar -} bind def +%/FONTLENGTH 256 bind def -/startrepeat +% reencode-font +/reencode-dict 5 dict def +/reencode-font { - thickbar + reencode-dict + begin + /name exch def + /encoding exch def + /base-font exch def + % note: Needs ps level 2 + /font base-font maxlength dict def + base-font { + exch dup dup /FID ne exch /Encoding ne and + { exch font 3 1 roll put } + { pop pop } ifelse + } forall + font /FontName name put + font /Encoding encoding put + name font definefont pop + end } bind def -/stoprepeat +/start-system % x y { - thickbar -} bind def - -/start_line -{ - gsave - xoffset yoffset translate + gsave + 0 + vsize translate } bind def -/stop_line +/stop-system { - /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 + /the-line exch def + the-line stroke grestore } bind def -/unknown { (U) setbold } bind def -/empty { (E) setbold } bind def - -/turnOnExperimentalFeatures { } bind def - -/rulesym % thick length +/end-lilypond-output { - gsave - exch setlinewidth - 0 lineto stroke - grestore +% showpage } bind def -(lily.ps) findlibfile -{ - exch pop //systemdict /run get exec -} -{ - /undefinedfilename signalerror -} ifelse +staff-line-thickness setlinewidth + -stafflinethickness setlinewidth +staff-height init-paper + +pstack -% see if we're there... -% 10 setlinewidth 0 0 moveto 400 800 lineto stroke +% end lilyponddefs.ps