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

World: r3wp

[Postscript] Emitting Postscript from REBOL

Henrik
14-Oct-2008
[1816]
and I've already added scaling
Geomol
14-Oct-2008
[1817x5]
I had a problem some time ago showing PS files, I produced. I think, 
it was some cache.
The dialect code, you produce, looks ok. I'm really not a shark with 
PS, so it doesn't mean, it's 100%, even if it looks ok to me. :)
Best way is to test, test, test, I'm afraid.
I can't get image! datatype to work in the postscript dialect (your 
suggestion). If I have it as a word, that is being "get", it works.
It's because, an image! datatype is the sequence
make image! [ ....

and that is being parsed.
Henrik
14-Oct-2008
[1822x4]
I don't get The 'img variable is set to an image! type, just like 
it is when using load-image from a file or url (which I couldn't 
get to work either).
Sorry, should be:


I don't get it. The 'img variable is set to an image! type, just 
like it is when using load-image from a file! or url! (which I couldn't 
get to work either).
I'm very confused right now. Images now work, but are placed in the 
wrong corner, despite being given the same coordinates as text and 
boxes.
solved the positioning problem
Graham
4-Dec-2008
[1826x2]
Henrik, did you create a dialect that takes a VID layout and produces 
a printout in PS?
Yes... I know it's 1am for you!
Henrik
4-Dec-2008
[1828]
yes, I did
Graham
4-Dec-2008
[1829]
How well does it work?
Henrik
4-Dec-2008
[1830]
actually not a dialect, it just converts a View object tree to postscript. 
it's used in the same way as to-image is on a layout.
Graham
4-Dec-2008
[1831x2]
Kewl
Have you published it?
Henrik
4-Dec-2008
[1833x2]
http://rebol.hmkdesign.dk/files/vid-postscript2.png
http://rebol.hmkdesign.dk/files/to-postscript.r
Graham
4-Dec-2008
[1835]
close ....
Henrik
4-Dec-2008
[1836]
if you're doing B/W stuff and not worrying too much about text wrapping, 
then it should work.
Graham
4-Dec-2008
[1837]
since it works on a view object ... it should work on Rebgui as well
Henrik
4-Dec-2008
[1838]
no bitmap support and no wrapped text support.
Graham
4-Dec-2008
[1839]
why not?
Henrik
4-Dec-2008
[1840]
(which is why it says wednesday twice in one of the fields in the 
postscript output.
Graham
4-Dec-2008
[1841]
the ps dialect supports rebol image format
Henrik
4-Dec-2008
[1842]
because that is handled at the View level. text wrapping information 
is not available in the layout tree.
Graham
4-Dec-2008
[1843]
Hope Vid+ doesn't have that limitation
Henrik
4-Dec-2008
[1844]
The approach would be similar, but I don't know if that information 
can be extracted. Perhaps it can if Cyphre is pushed hard enough. 
:-)
Graham
4-Dec-2008
[1845x2]
Pehaps we need some hooks into the layout engine that allows us to 
extract this type of data
eg. we can submit an area to the layout engine and get a graphic 
back at a specified resolution
Henrik
4-Dec-2008
[1847]
rich text has some bugs, which cyphre is able to fix once he gets 
time, so I hope this will be possible to hook into. i.e. it's not 
a closed part that we can't touch.
Graham
4-Dec-2008
[1848x2]
so, we can do the text formmating using VID+ and take it out as a 
graphic
probably better if we can get the xy of each character in the text 
string
Henrik
4-Dec-2008
[1850x2]
that is possible
I'll get to know it more when we get to build a real rich text editor
Graham
5-Dec-2008
[1852]
Doesn't seem to work with layouts from rebgui

>> lo2: display "Test" [ text "hello" ]
>> unview/all
>> type? lo2
== object!
>> to-postscript lo2
** Script Error: Cannot use path on none! value
** Where: ps-face
** Near: if f/font/name [append font-name 'Helvetica]
if find
Henrik
5-Dec-2008
[1853x2]
perhaps the layout tree is different for rebgui
all to-postscript.r does is go through the layout tree and renders 
each object as a postscript color box with a text box on top of it. 
face values are just mapped into postscript.
Graham
5-Dec-2008
[1855x3]
the first place it barfs in this simple layout is here

        if f/font/name [append font-name 'Helvetica]
Which seems to say, if you have specified a font, ignore it and just 
use helvetica!
for Rebgui ... f/font is none
Henrik
5-Dec-2008
[1858]
I think that was supposed to be some kind of font mapping which wasn't 
finished.
Graham
5-Dec-2008
[1859x5]
Probably the best thing is to ensure the user uses the PostScript 
TTFs in their layouts
and then you can map
Let me check to see what mapping I use ...
; map postscript fonts to windows fonts
	fonts: [
Bookman-Demi
 "URW Bookman L Demi Bold"
Bookman-DemiItalic
 "URW Bookman L Demi Bold Italic"
Bookman-Light
 "URW Bookman L Light"
Bookman-LightItalic
 "URW Bookman L Light Italic"
Courier
 "Nimbus Mono L"
Courier-Oblique
 "Nimbus Mono L Regular Oblique"
Courier-Bold
 "Nimbus Mono L Bold"
Courier-BoldOblique
 "Nimbus Mono L Bold Oblique"
AvantGarde-Book
 "URW Gothic L Book"
AvantGarde-BookOblique
 "URW Gothic L Book Oblique"
AvantGarde-Demi
 "URW Gothic L Demi"
AvantGarde-DemiOblique
 "URW Gothic L Demi Oblique"
Helvetica
 "Nimbus Sans L"
Helvetica-Oblique
 "Nimbus Sans L Regular Italic"
Helvetica-Bold
 "Nimbus Sans L Bold"
Helvetica-BoldOblique
 "Nimbus Sans L Bold Italic"
Helvetica-Narrow
 "Nimbus Sans L Condensed"
Helvetica-Narrow-Oblique
 "Nimbus Sans L Condensed Italic"
Helvetica-Narrow-Bold
 "Nimbus Sans L Condensed Bold"
Helvetica-Narrow-BoldOblique
 "Nimbus Sans L Condensed Bold Italic"
Palatino-Roman
 "URW Palladio L Roman"
Palatino-Italic
 "URW Palladio L Italic"
Palatino-Bold
 "URW Palladio L Bold"
Palatino-BoldItalic
 "URW Palladio L Bold Italic"
NewCenturySchlbk-Roman
 "Century Schoolbook L Roman"
NewCenturySchlbk-Italic
 "Century Schoolbook L Italic"
NewCenturySchlbk-Bold
 "Century Schoolbook L Bold"
NewCenturySchlbk-BoldItalic
 "Century Schoolbook L Bold Italic"
Times-Roman
 "Nimbus Roman No9 L"
Times-Italic
 "Nimbus Roman No9 L Regular Italic"
Times-Bold
 "Nimbus Roman No9 L Medium"
Times-BoldItalic
 "Nimbus Roman No9 L Medium Italic"
Times-BoldOblique
 "Nimbus Roman No9 L Medium Italic"
Symbol
 "Standard Symbols L"
ZapfChancery-MediumItalic
 "URW Chancery L Medium Italic"
ZapfDingbats
 "Dingbats"
free 3 of 9 regular
 "FREE3OF9.TTF"
]
the last one is a bar code font I use
Geomol
8-Feb-2009
[1864x2]
I just realized, my postscript pages are gone with my old homepage. 
Moving things over to ...
Postscript dialect: http://www.fys.ku.dk/~niclasen/postscript/postscript.r

Documentation: http://www.fys.ku.dk/~niclasen/postscript/postscript.html

Test (see also documentation): http://www.fys.ku.dk/~niclasen/postscript/test.txt