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

World: r3wp

[Postscript] Emitting Postscript from REBOL

Rebolek
7-Nov-2006
[1150]
you can't use current View for that task - you don't know font's 
baseline, so it's not possible to position different sizes of fonts 
on same line.
Cyphre
7-Nov-2006
[1151]
Yes, you are right, there are two different font engines which is 
not much efficient. Moreover the DRAW text rendering was meant to 
be just for really simple labeling(the main text engine in R2 is 
still the original FACE text rendering) and it would need some improvements 
for more complex usage. All this should be unified and improved in 
R3. There will be only one text engine with rich-text dialect.
Graham
7-Nov-2006
[1152]
Cyphre .. how feasible would a PS renderer be in R3?
Pekr
7-Nov-2006
[1153]
Graham - isn't PS rendering "just" a question of particular dialect, 
translating into View faces rendering? (sorry, I am not fluent with 
PS, so dunno what would be needed, just asking)
Graham
7-Nov-2006
[1154]
the AGG translation etc works differently from PS.
Pekr
7-Nov-2006
[1155]
hmm, my opinion was based upon SVG dialect, which we were able to 
render, using translation into AGG ...
Cyphre
7-Nov-2006
[1156x2]
Regarding the coordinate system: I''ll ty to thing how to incorporate 
both, the PS like and SVG like orientation. But do we really need 
this at low-level? IIRC I have posted some example how to change 
the coordinates using simple reparsing the coord values?
Graham, I still don't know where is the problem to write any transformation 
function in Rebol to create any kind of coordinate system even in 
R2. Maybe I'm missing something?
Rebolek
7-Nov-2006
[1158]
I think one low-level coordination system is enough IF that system 
supports decimal pair!
Cyphre
7-Nov-2006
[1159]
Yep, decimal pair!s would be hopefully added in R3 ;)
Rebolek
7-Nov-2006
[1160]
great:) something, at least :)
Pekr
7-Nov-2006
[1161x2]
what about parameter for face, specifying where your 0x0 is? I do 
remember, when Carl was at Viscorp, and they were working on ABL\E 
with Jim Goodnow, Carl stated, that new AmigaOS should be able to 
have windows with different resolution on one screen :-)
I also do remember that View carried some 'span argument, but it 
was never of much usage ...
Rebolek
7-Nov-2006
[1163]
I remember some beta View documents about virtual coordinate space 
:)
Graham
7-Nov-2006
[1164]
Cyphre, it's not just the coordinate system, it's rotation, scaling 
and transformations.
Cyphre
7-Nov-2006
[1165]
what is different in PS tranformations vs DRAW?
Graham
7-Nov-2006
[1166x4]
I did a demo somewhere which showed the problem.
can't recall the specifics though.
the other thing that PS has is a way to save the graphic state .. 
do stuff... and then restore the state
rotate - in PS is anticlockwise, in Rebol is clockwise
Henrik
7-Nov-2006
[1170]
I would suggest that if DRAW is kept, that it would be possible to 
switch transformation and rotation modes to make it adaptable to 
more graphics systems.
Pekr
7-Nov-2006
[1171x3]
maybe it is time for gurus to speak in some closed group and redesign 
face aproach? Do you remember Carl wanting to introduce kind of min-face?
imo draw, as introduced to View, is a hack .... it lives in effect 
pipeline, is that correct?
maybe face, as a gob, should be more general, with some pluggable 
mechanisms ....
Cyphre
7-Nov-2006
[1174x2]
Henrik, yes we can add some 'options' for clockwise/anticlockwise 
etc. but keep in mind every such decission at runtime steals performance 
so sometime is better to generate the DRAW dialect with properly 
converted values.
(It is really so hard to invert the rotation values at Rebol level 
when you need it?)
Rebolek
7-Nov-2006
[1176]
negate angle ;looks easy
Cyphre
7-Nov-2006
[1177x2]
r: rot: 0 view layout [origin 0 box 400x400 white effect [draw [pen 
black translate 200x200 rotate

 rot translate -200x-200 box 100x150 300x250]] rate 0 feel [engage: 
 func [f a e][if a = 'time [r: r +
 1 rot: 360 // 360 - r show f]]]]
(just paste to console)
Geomol
7-Nov-2006
[1179]
I like the look of DRAW! :-) (Of course it's due to AGG.) I still 
miss a version of REBOL for Mac with full DRAW, as the Windows version 
has it.
Pekr
7-Nov-2006
[1180x2]
does'n't it have full draw, except fonts?
btw - what happened to your Reluxe Paint? No other ambitions with 
that project?
Geomol
7-Nov-2006
[1182]
Pekr, yes I still have Canvas RPaint on hold until I can release 
a final version 1.0 for Windows, OS X and Linux at the same time. 
Some DRAW things are missing, which Windows version has.
Pekr
7-Nov-2006
[1183]
do you need cross-platform compatibility for intitial release? Hmm, 
maybe so, as a marketing advantage ...
Geomol
7-Nov-2006
[1184]
When I was just about to release it, I desided to wait for better 
support of DRAW on the other platforms (and in some way for rebcode 
too). Looking back, I should maybe have release it almost a year 
ago. It's just, that Windows always get the good stuff. I use OS 
X now, and REBOL is cross-platform, so a thing like RPaint should 
be the same on all platforms. I'm also concerned about marketing, 
as you say. Releasing for three platforms at the same time is preferable 
for me.
Pekr
7-Nov-2006
[1185x2]
understandable ....
... but then it might also mean to wait for year or more, because 
I don't believe 2.6 kernel SDK gets fixed to the state, where OS-X 
and Linux versions get some Windows present features. I think that 
RT will concentrate upon portability of R3, and hence you will probably 
have to wait for View based upon R3 - of course, that is just my 
guess ....
Geomol
7-Nov-2006
[1187x3]
We don't know for sure. That Carl is using OS X daily now might be 
a good thing for my situation. We can hope, wait and see.
I showed this REBOL postscript thing to some work colleagues, and 
they asked about support for tray selection on the printer (you typically 
have different paper in each tray). Does anyone know, if it's possible 
to choose tray from postscript?
Another thing is paper type selection. With this you tell what paper 
type, you need, and the printer know, what type of paper is in each 
tray (it's possible to specify that on the printer). Paper type selection 
has some benefit over tray selection.
Henrik
7-Nov-2006
[1190]
I didn't figure it out so I had to use the tray selector in the windows 
printer driver to do this.
Geomol
7-Nov-2006
[1191x2]
REBOL PostScript dialect v. 0.3.1 released: http://home.tiscali.dk/john.niclasen/postscript/postscript.r

Documentation here: http://home.tiscali.dk/john.niclasen/postscript/postscript.html

Added possibility to specify some sizes as both pair! or two number!. 
Added alternative spelling of setcolour.
Do this in a REBOL prompt to run the test:

do http://home.tiscali.dk/john.niclasen/postscript/postscript.r

write %test.ps postscript load http://home.tiscali.dk/john.niclasen/postscript/test.txt

Now the file %test.ps holds the postscript output.
Graham
7-Nov-2006
[1193]
use the PSC to set trays
Geomol
7-Nov-2006
[1194]
It seems, the PostScript operator 'setpagedevice' can be used to 
set MediaType to e.g. 'Plain', 'Letterhead' or 'Preprinted' etc.. 
It's something like that, I'm after. That's better than specifying 
tray, but that can be done also. I'll investigate further and put 
it in the dialect.
Geomol
8-Nov-2006
[1195x3]
REBOL PostScript Dialect v. 0.4.0 released: http://home.tiscali.dk/john.niclasen/postscript/postscript.r

Documentation here: http://home.tiscali.dk/john.niclasen/postscript/postscript.html

Added MediaType, ManualFeed and MediaPosition to control paper selection 
(tray). Also made Courier font ISOLatin1 encoded. And better PS comments 
in the output according to PostScript Language Document Structuring 
Conventions Specification.
It's now possible to produce PostScripts documents, where the first 
page is taken from e.g. tray 2 holding Letterhead paper and the rest 
from e.g. tray 3 holding Plain paper.
I suggest, people use MediaType to select paper, and only use MediaPosition, 
if MediaType doesn't work on the printer.
Pekr
8-Nov-2006
[1198x2]
What is the difference between the postscript dialect and PDF one? 
It is just that you can write directly to printer?
are those dialects a bit compatible, or completly different syntaxes?