World: r3wp
[View] discuss view related issues
older newer | first last |
Henrik 4-Oct-2008 [8158] | Is it in RAMBO? |
Anton 4-Oct-2008 [8159x2] | Probably the same root as this bug report. |
http://www.rebol.net/cgi-bin/rambo.r?id=4269& | |
Henrik 12-Oct-2008 [8161] | I'm toying around with a VID dialect for postscript. I've done that by copying the VID source for LAYOUT, STYLIZE and all related functions in the SYSTEM/VIEW/VID. So far so good, but now I want to implement styles, so I can write some layouts and am wondering what the formal way would be to add the very first style in what is equivalent to SYSTEM/VIEW/VID/VID-STYLES ? |
Anton 13-Oct-2008 [8162x2] | Hmm.. interesting. Do you have a base object (eg. similar to svv/vid-face ?) |
Not familiar with postscript, I am wondering why you couldn't just make a function "to-postscript" that accepts a face argument (similar to to-image), instead of reimplementing all of VID. | |
Henrik 13-Oct-2008 [8164x3] | yes, I have a base face similar to vid-face. I even added it to the style list manually to see if that would work, but it doesn't. |
Anton, good idea. | |
Anton, thanks. Now it's moving forward. Got some primitive face renderings in postscript now. | |
Anton 13-Oct-2008 [8167] | I suppose you would be cloning face/color, face/text, face/edge rendering (whatever you need first) at a simple level, and gradually improving it towards perfection afterwards. |
Henrik 13-Oct-2008 [8168x3] | My biggest problem right now is the coordinate system, vertical positioning of text and text wrapping. The rest is almost in place. |
http://rebol.hmkdesign.dk/files/vid-postscript.png<--- so far so good :-) | |
(I wish I had thought of this sooner!) | |
Anton 13-Oct-2008 [8171] | That looks like fun, Henrik. |
Henrik 13-Oct-2008 [8172] | I've already fixed top/middle/bottom alignment. Text is placed a couple of mm too far to the right. |
Anton 13-Oct-2008 [8173] | I suppose you don't know how to do the equivalent of SIZE-TEXT in postscript yet. |
Henrik 13-Oct-2008 [8174] | Actually I rely fully on VID's coordinate system. SIZE-TEXT in PS is apparently only possible on the width of the text, not the height, which is why just I use VID instead. It seems to work fine, if we can live with integer positioning. |
Anton 13-Oct-2008 [8175] | Mmm. The font rendering looks nicer. |
Henrik 13-Oct-2008 [8176] | text wrapping is a different problem... |
Anton 13-Oct-2008 [8177] | Ah yes, I see. |
Henrik 13-Oct-2008 [8178] | Remembering from amacleod's multi-highlight problem, detecting where wraps are in a text box might be buried in some natives that we can't get to. |
Anton 13-Oct-2008 [8179x2] | I solved that in caret-to-offset-patch.r It behaves very very close to native (except efficiency), so should be usable for this situation. |
http://anton.wildit.net.au/rebol/patch/caret-to-offset-patch.r | |
Henrik 13-Oct-2008 [8181] | thanks, I'll have a look |
Anton 13-Oct-2008 [8182x2] | and the test file to do is test-caret-to-offset-patch.r |
If you want to save yourself literally days of reverse engineering... | |
Henrik 13-Oct-2008 [8184] | so you essentially rebuild caret-to-offset as a mezzanine? |
Anton 13-Oct-2008 [8185] | Yep, and offset-to-caret, too. |
Henrik 13-Oct-2008 [8186] | Too deep for me to solve that tonight. However I've come this far: http://rebol.hmkdesign.dk/files/vid-postscript2.png |
Graham 13-Oct-2008 [8187] | if you track the font size, then you have the vertical size of the text. |
Anton 14-Oct-2008 [8188x2] | Improving... How fast can it render the postscript ? Can you make it dynamic update ? |
Graham, the relationship between font/size and lineheight is not so simple, unfortunately. | |
Graham 14-Oct-2008 [8190] | in postscript ... |
Henrik 14-Oct-2008 [8191x3] | Anton, by far the slowest component is Ghostscript. Creating the postscript file is about as fast as an ordinary layout. |
The advantage is that it's rendered from faces, not VID directly, so I assume this will work with RebGUI as well. | |
Anton, it takes about 2-5 seconds to create the render here | |
Graham 14-Oct-2008 [8194] | Henrik, what exactly are you doing? |
Henrik 14-Oct-2008 [8195] | Graham, I'm creating postscript output from faces. That's all. |
Graham 14-Oct-2008 [8196] | cool |
Henrik 14-Oct-2008 [8197] | it works like TO-IMAGE. |
Graham 14-Oct-2008 [8198] | so, for multiple pages? |
Henrik 14-Oct-2008 [8199] | one page per layout |
Graham 14-Oct-2008 [8200] | so, to produce the postscript from multiple layouts? |
Henrik 14-Oct-2008 [8201] | foreach l layouts [to-postscript l] |
Graham 14-Oct-2008 [8202] | so this produces a single page of postscript? |
Henrik 14-Oct-2008 [8203x4] | each to-postscript call produces one single page. |
that means if you have 4 pages, you create 4 separate layouts and call to-postscript 4 times. | |
but it's quite possible that I could deliver a block of layouts... | |
...to to-postscript to generate multiple pages in one go. | |
Graham 14-Oct-2008 [8207] | that's what I do at present ... I have a block of layouts |
older newer | first last |