tdewolff / canvas

Cairo in Go: vector to raster, SVG, PDF, EPS, WASM, OpenGL, Gio, etc.
MIT License
1.46k stars 98 forks source link

Feature request: PostScript Parser #285

Open cornejong opened 3 months ago

cornejong commented 3 months ago

Would be great if there was also support for parsing PostScript.

tdewolff commented 3 months ago

I agree that would be a good addition. There is already quite some code related to (compressed) PostScript inside OTF fonts in https://github.com/tdewolff/font/blob/master/sfnt_cff.go#L259, the only difference would be reading a text encoded stream and expanding the operator set. The complete operator set is fairly big though. This would open the door to converting EPSs and PDFs to Canvas (rendering EPS and PDF files), and further integration with the TeX tool set.

What is your use-case out of curiosity?

Additionally, I wish to improve the SVG to Canvas functionality, it's quite ad-hoc at this point. Unfortunately I don't have much free time to add new features soon, though I prioritize fixing bugs...

cornejong commented 3 months ago

Currently working on a project for a client where we need to generate raster preview images for a bunch of different, customer supplied, input file formats (eps, svg, ai, psd, pdf, etc..) and trying to keep it all in pure go. So not really touching the majority of the functionality. Althouh i seem to find new usecases for it everyday since i discoverd it.

I'm kinda new to the whole "working with graphics". But it caught my interest.

Yeah totaly agree on prioritizing bug fixes over new features. I might see if i can find/make some time to dive into this. Could be a fun project to divert some time to. Although my spare time seems to shrink by the minute, but i'll see.