r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Postscript] Emitting Postscript from REBOL

Geomol
7-Apr-2006
[160]
Any ideas?
Graham
7-Apr-2006
[161]
must be a case problem.
Cyphre
7-Apr-2006
[162]
works here ok, must be a connection problem
Geomol
7-Apr-2006
[163]
yes, try now
Rebolek
7-Apr-2006
[164]
now it works
Geomol
7-Apr-2006
[165]
Now it works. It seems, it take a little time, before tiscali makes 
content reachable.
Graham
7-Apr-2006
[166]
Ok, looks okay.  But each element needs to be placed on the page.
Geomol
7-Apr-2006
[167]
?
Graham
7-Apr-2006
[168x3]
you need to tell the postscript engine where to place the text.
eg. 72 72 moveto
which is one inch from the left bottom edge
Geomol
7-Apr-2006
[171]
It's a start.
What happen, if you leave out that part?
Graham
7-Apr-2006
[172x3]
nothing happens I suspect.
there's also a postscript preamble or header.
%!PS-Adobe-3.0
%%Creator: Synapse-EMR 3.01
%%LanguageLevel: 2
Geomol
7-Apr-2006
[175x3]
Oh, misunderstood.
Try:
s: postscript [font ["Times-Roman" 20] [at 72x72 "Hello World!"]]
You can position with AT pair!
Now the dialect has to be defined precisely with all the functionality, 
we want.
Graham
7-Apr-2006
[178x2]
gsave
 .75 setgray
 /Helvetica-Bold findfont 72 scalefont setfont
 72 100 moveto
 (Hello World!)	 show
 grestore
I would save the state and then restore it.
Geomol
7-Apr-2006
[180]
I need to learn more about PostScript.
Graham
7-Apr-2006
[181x2]
Do you have to specify the pen colour or not ?
this ..  .75 setgray uses a gray colour for the text.
Geomol
7-Apr-2006
[183]
The dialect can't cope with that yet.
Graham
7-Apr-2006
[184]
This is a good start though.
Geomol
7-Apr-2006
[185]
So far, you can specify font, set position and print text.
Graham
7-Apr-2006
[186x2]
so, you need also the %! at the beginning, and a showpage at the 
end.
things like 'box can be defined as a function in postscript.
Geomol
7-Apr-2006
[188]
Desitions have to be made about the dialect structure. Should the 
outer block consist of font-specifications and pages, or isn't that 
structure the best for PS? A better understanding of PS is needed 
to answer.
Graham
7-Apr-2006
[189x2]
so, you would probably need some predefined functions that are also 
emitted.
Is the main aim to do text, or translate draw images?
Geomol
7-Apr-2006
[191]
I would aim for an implementation of PS functionality as a REBOL 
dialect. Nothing to do with draw yet.
Graham
7-Apr-2006
[192x3]
we have Gabriele's pdf dialect to use a model.
his dialect must cover the same problems .. as pdf is a subset of 
postscript.
at 72x72 font Helvetica-Bold 6.0 "Hello World!"
Geomol
7-Apr-2006
[195]
I'll look at all the PS operators to get a view of the whole thing. 
Then define a structure for the dialect (probably top-concept of 
a page), and then implement the operators most needed.
Graham
7-Apr-2006
[196]
this looks easier to write.
Geomol
7-Apr-2006
[197]
Would it be normal in PS to define the font before anything else, 
and then describe pages with paths? Is that the structure?
Graham
7-Apr-2006
[198x2]
I wonder if we can't just use Gabriele's dialect and build a different 
emitter.
I'm not sure .. I've only read about postscript in the last day.
Geomol
7-Apr-2006
[200x6]
It'll take time for me to read others dialect rules. It'll probably 
be faster for me to make the dialect, so I know, what's going on 
everywhere.
New version. The postscript block consists of font definitions and 
pages. A page consists of paths and transformations. Try:
do http://home.tiscali.dk/john.niclasen/postscript/postscript.r

print postscript [font [Times-Roman 20] page [path [at 72x72 rotate 
45 "Hello World!"]]]
The "page" and "path" words are optional, so this'll give same result:

print postscript [font [Times-Roman 20] [[at 72x72 rotate 45 "Hello 
World!"]]]
A postscript block can have several pages, and every page can have 
several paths.
I found this document describing PostScript structure:

http://partners.adobe.com/public/developer/en/ps/5001.DSC_Spec.pdf
PostScript has a lot of operators (commands). For this REBOL dialect 
to be usefull, we should keep the number of features at a minimum. 
It's always hard to learn something new, and if the number of commands 
is too big, less will use it. I would like feedback on, what features 
should be supported in the dialect for a first version. This dialect 
can then be used in REBOL programs, that would like to do PostScript 
output. And I could make a PostScript output from my NicomDoc format. 
And then we could also have a DRAW -> PS converter.
Pekr
7-Apr-2006
[206]
I don't want to interrupt your concrete talk here, but I think I 
was a bit misunderstood. By "or forget it" I did not mean forget 
bringing PS to rebol, but "it" was pointing to ghostviewer. I am 
the last, who would not want to do everything in Rebol. So Henrik 
actually contradicts himself a bit stating that he wants to limit 
number of external apps = bring PS to rebol, but then how to do a 
preview?
Geomol
7-Apr-2006
[207]
PS -> VIEW maybe?
Pekr
7-Apr-2006
[208]
In fact - my question could be just simplified - how do we do print 
preview without GhostView or other PS viewer tools? If that is "somehow" 
possible, then it is only good. That is why I referred to the need 
of AGG based preview, to actually save third app usage - a PS viewer.
Geomol
7-Apr-2006
[209]
sorry, PS -> DRAW