World: r3wp
[View] discuss view related issues
older newer | first last |
Henrik 13-Oct-2008 [8166] | 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 [8207x2] | that's what I do at present ... I have a block of layouts |
and then i generate a single page of postscript from all the layouts | |
Henrik 14-Oct-2008 [8209] | a single page from multiple layouts? |
Graham 14-Oct-2008 [8210x4] | yes |
no | |
one postscript file but multiple pages | |
inefficient to produce a single postscript file for each layout | |
Henrik 14-Oct-2008 [8214x2] | yes, true |
I can upload it it you want to play with it. | |
older newer | first last |