World: r3wp
[Postscript] Emitting Postscript from REBOL
older newer | first last |
Graham 13-Apr-2006 [546x4] | %!PS-Adobe-3.0 %%Creator: ps.r ver 0.0.6 %%Pages: (atend) %%EndComments %%Page: Title 1 72 72 moveto /Times-Roman findfont 12 scalefont setfont (page 1) show showpage %%Page: Body 2 144 144 moveto (page 2) show showpage %%Trailer %%Pages: 2 %%EOF |
http://www.compkarori.com/reb/starburst.pdfis a starburst | |
http://www.compkarori.com/reb/clipped.pdfare the words "REBOL Rulz" clipped to the starburst. | |
ie . the starburst is only visible inside the text. | |
Graham 14-Apr-2006 [550x3] | looks like port 9100 is pretty standard for most postscript printers |
if a print server has multiple printers attached, they are likely to be on different ports eg, 9101, 02 ... | |
newpath sets up a new line which can be drawn. Stroke has the same effect as newpath | |
Geomol 14-Apr-2006 [553x2] | Does moveto always indicate a newpath? |
If it does, the basic rule of the dialect might be: at <pos> <content> And then we get rid of blocks. | |
Graham 14-Apr-2006 [555x4] | no, it doesn't. |
my next step is to now convert the ps dialect to draw - so I can have a print preview ( confined to lines, boxes and text ). | |
anyone know what the draw coordinates mean? What is point 20x20 .. measured from the top left, but what is 20 based upon? | |
I've looked at http://www.rebol.com/docs/draw-ref.htmland it doens't mention how the coordinate system is based. | |
Henrik 14-Apr-2006 [559] | it's probably pixel based |
Graham 14-Apr-2006 [560x3] | screens are 72 dots per inch. |
postscript is 72 points per inch. | |
Good match! | |
Henrik 14-Apr-2006 [563] | strange coincidence |
Graham 14-Apr-2006 [564x3] | unlikely to be a coincidence. |
A4 595 x 842 Letter 612 x 792 | |
so to change postscript to draw, for A4, it's 842 - y | |
Geomol 14-Apr-2006 [567] | If you have a 15" monitor showing say 1280x1024 and you have a 21" monitor with same resolution, you don't have 72 dots per inch on both. |
Graham 14-Apr-2006 [568] | how to convert a gray ( range 0 - 1 ) to a tuple! ? |
JaimeVargas 15-Apr-2006 [569] | Graham, Postscript is resolution independant. Certainly capable of more than 72dpi |
Graham 15-Apr-2006 [570x7] | Jaime, Postscript uses points for it's units and these are 72 per inch. |
nothing to stop you using parts of a point. | |
http://www.compkarori.com/reb/psd2draw.r | |
first pass at taking the same postscript dialect and rendering it to draw. | |
I don't know if it's a bug, but Text in Draw does not obey the rotate commands, or the scaling commands. | |
the shaded box is in the wrong place .. not sure why, and I had to shift the bottom text up so I could see it. | |
So, my aim is to preview a page on screen in this dialect and using a different parser on the same dialect, create postscript which I can send to the printer. | |
JaimeVargas 15-Apr-2006 [577x3] | Graham, what I meant is that even to the unit is a *point* the fact is that you can more than 72 pixels in a inch. For example laserprinters have 300 to 1200. And there is some displays that 96dpi, and I have seem e-ink that gives you 150dpi(s). |
So the unit of measure doesn't have anything to do with the actual size of pixel or (dot). | |
(Excuse my overscrupulous comments, now time for sleep. | |
Graham 15-Apr-2006 [580x3] | do http://www.compkarori.com/reb/psd2draw.rversion 0.0.8 |
Allows a preview in 50%, 75% and 100% mode. | |
the print button, unimplemented, would send the post script file to your printer. | |
Henrik 15-Apr-2006 [583x3] | wow |
that's really all I can say at this point | |
graham, out of curiosity, can you scale as you want? could you implement a slider? I'd like to see how fast it is. | |
Graham 15-Apr-2006 [586] | Yes, could implement a slider .. if I can remember how to do sliders! |
Henrik 15-Apr-2006 [587] | SLIDER in the layout and then use /data to extract the position which is between 0 and 1 |
Graham 15-Apr-2006 [588x8] | :) |
There's a free postscript viewer and allows you to print in windows here: http://www.rops.org/ | |
It's http://www.rops.org/download/freescript53.exeand does only Level 1. | |
a measly 324Kb. | |
Uses windows installed fonts instead of postscript fonts to preview and print. | |
http://www.compkarori.com/reb/psd2draw.r | |
has a slider now for Henrik :) | |
it gets all screwed up when really small. | |
older newer | first last |