Postscript


#1

Hey,

Would just like to say thanks to jules before I start this post! :smiley: Before I discovered Juce I’d never ventured into the realms of C++ and never even touched C much. Juce is a pure work of art in my humble opinion.

Anyway I’m using juce for some work I’m doing for my masters. I’m making a simple vector graphics tool and would like at some stage to print some output, perhaps not to a printer but at least to a file that’s easy to print. Anyway the postscript class seemed a good port of call but I encountered some hitches and I’m not too sure if it’s because I’m being a noob, whether its a limitation to do with postscript file format or if it’s limitations with juce.

Basically if I try to draw an image to a LowLevelGraphicsPostScriptRenderer strange things happen.

This Works:

FileOutputStream postFileStream (postFile); LowLevelGraphicsPostScriptRenderer postLevel (postFileStream, postscriptname, awidth, aheight); Graphics g (&postLevel); g.drawRect(5, 5, 100, 100, 3);
But this doesn’t:

FileOutputStream postFileStream (postFile); LowLevelGraphicsPostScriptRenderer postLevel (postFileStream, postscriptname, awidth, aheight); Graphics g (&postLevel); Image mytestimage (Image::ARGB, 500, 500, true); Graphics c (mytestimage); c.drawRect(5, 5, 100, 100, 3); g.drawImageAt(&mytestimage, 0, 0, false);
Any suggestions? Should I just give up on postscript?

Thanks


#2

Hi, glad you’re enjoying it!

The postscript stuff was something I started but never really finished fully - I intended to add some code for actually printing it too, but got sidetracked before I got there. So basically, that’s probably one of the few classes that’s not very well tested…


#3

Hey,

Thats fair enough! I’ll just omit postscript support :wink: certainly not a big issue as I can already export to JPEG or PNG. Thanks again and happy new year in advance :stuck_out_tongue:

Oh just perhaps a suggestion (and it really is just a suggestion on a whim) I really like your createSolidAreaMask function in the Image class, it’s pretty sluggish (to be expected) but just wondering if another function would be a good idea that simply returns one rectangle that crops around the image by aplha. A kinda faster but less accurate createSolidAreaMask. lol guess I feel like I’m trying to add something back here after taking so much hehe :?

Cheers!


#4