[Haskell-cafe] Functional MetaPost in 5 Steps

Stefan Endrullis stefan at endrullis.de
Thu Dec 18 07:45:58 EST 2008


I have the same problem with FuncMP.

I've also replaced the "generate" function by a custom "toMPFile" as you
suggested, but mpost still generates only an empty white sheet. I've used
the simple example posted in the first message of this thread. The generated
.mp file is also relatively simple (see attachment 
http://www.nabble.com/file/p21070707/Test.mp Test.mp )

The only problem is the line "input FuncMP", which produces additional code
in the ps file and causes the white page. If you remove this line everything
is fine again and you can see the text "blah".

Here's the additional code FuncMP produces in the .ps file:
-----------------------------------------------------------------
/xdvi$run where {pop errordict begin /undefined {} bind def end} if
/fmp1 /fmp1 def /fmp8 /fmp8 def /fmp24 /fmp24 def
/bitline1 {gsave pop dup scale dup length 8 mul 1 true currentpoint
translate
   [66.66666 0 0 66.66666 0 0] 4 index imagemask pop grestore} bind def
/bitline8 {gsave pop dup scale dup length 1 8 currentpoint translate
    [2.8 0 0 2.8 0 0] 4 index image pop grestore} bind def
/bitline24 {gsave pop dup scale dup length 3 idiv 1 8 currentpoint translate
    [2.777777 0 0 2.777777 0 0] 4 index false 3 colorimage pop grestore}
bind def
/XDVIfshow  {findfont exch scalefont setfont show} bind def
/DVIPSfshow {exch gsave 72 TeXDict /Resolution get div -72 TeXDict
     /VResolution get div scale 1 DVImag div dup scale get cvx exec
     show grestore} bind def
/fshowText
   {/xdvi$run where {pop XDVIfshow} {DVIPSfshow} ifelse} def
/fshow { exch dup 
	  /fmp1 eq {bitline1}
		   {dup /fmp8 eq {bitline8}
				 {dup /fmp24 eq {bitline24}
						{fshowText}
	  ifelse}       ifelse}       ifelse} def
-----------------------------------------------------------------

You can also fix the .ps file by removing the "/fshow ..." part from the
file and the text "blah" will appear in your ghostscript viewer.

Well, this is my first test with FuncMP and that's why I'm asking this silly
question now: Is the "fshow" function really necessary or can I remove it
from every generated .ps file without problems? :)

Or you know another solution?
Does your generated .ps files also contain this code? If no, what version of
FuncMP do you use?
-- 
View this message in context: http://www.nabble.com/Functional-MetaPost-in-5-Steps-tp20144360p21070707.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list