postscript - module

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

postscript - module

Post by didi »

The links to the samples in the table are not working :

http://www.newlisp.org/index.cgi?Postscript

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

To do some artwork i'm looking for a possibility to convert postscript which was generated with newLISP to an image-format like gif or png.

One way is ghostview and ghostscript, but there should be a simpler way .

The idea is to have a minimal portable system which you can put on you USB-Stick ( together with newLISP, which is no problem )

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

all links to images and example files are now restored:

http://www.newlisp.org/index.cgi?Postscript

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

didi wrote:To do some artwork i'm looking for a possibility to convert postscript which was generated with newLISP to an image-format like gif or png.
It's easy to get PNG or something out of the HTML/Canvas module, as long as you have a capable browser.

Or, if you can do your graphics work entirely on a newLISP-GS canvas, there's a gs:export function which can create a PNG file of the current canvas.

I've used all 3 methods (examples on the blog); choose which one depending on the type of graphics you want to create, perhaps.

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

Thanks for your tip, is it possible to have a portable newlisp-gs version, so that you need not to install java ?
The program should really be portable, so that i can run it with an usb-stick on different windows-pc-systems . As always i'm looking for the smallest possible solution .

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

Just found PNGwriter on sourceforge.net , seem to be small and easy to use.
Thinking about an interface to newLISP .

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

Ok - pngwriter is easy at the first sight , but requires zlib, libpng, freetype ... not my dream-solution.

xytroxon
Posts: 296
Joined: Tue Nov 06, 2007 3:59 pm
Contact:

Post by xytroxon »

didi wrote:Ok - pngwriter is easy at the first sight , but requires zlib, libpng, freetype ... not my dream-solution.
There is also the popular GD library:
http://www.libgd.org/

With bindings for:
http://www.libgd.org/Binders

* 1 C#
* 2 Clip
* 3 Common Lisp
* 4 D
* 5 Fly (Any Language)
* 6 Javascript
* 7 Lua
* 8 OCaml
* 9 Octave
* 10 Pascal
* 11 Perl
* 12 PHP
* 13 Python
* 14 REXX
* 15 Ruby
* 16 Scheme
* 17 Tcl

Although this is a very old binding, Fly is a quick way to start on Windows. At least for evaluation purposes. You write a Fly script from newLISP "on the fly" and then (exec ... it.
ftp://ftp.unimelb.edu.au/pub/www/tools/ ... .WinNT.zip

The PHP GD binding is included in the PHP distro, and I think it is the most used version... While writing and executing PHP scripts from newLISP maybe a pain, there is good documentation for PHP GD and many third party scripts to search out and study...

And there are Common Lisp and Scheme distros that maybe coerced into a newLISP version... Being that newLISP aspires to excel at CGI, this would be a great addition to standard newLISP modules... (hint, hint ;)

-- xytroxon
"Many computers can print only capital letters, so we shall not use lowercase letters."
-- Let's Talk Lisp (c) 1976

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

What is needed for newLISP are C bindings, for C++ bindings one would have to write extra code.

What what about:

http://www.imagemagick.org/script/

it has C bindings, one can import to newLISP and as an easier alternative also has command-line tools for all mayor platforms usable with newLISP 'exec'.

Command line tools and libraries are available for all mayor platforms and there is even a book how to use it:

http://www.imagemagick.org/script/binary-releases.php

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

Thanks Xytroxon , fly is with its 140kB really simple to use and generate gif-graphics and its portable - should be no problem to start it out of newLISP.
With GD maybe the same could be written generating png-graphics .

Thanks Lutz for the hint to imagemagick, it was the first program which immediately worked on my windows-pc . In some minutes i was able to generate graphics with text by using the convert program.
The convert program is only 180kB in size, but it needs different dlls which are some MB's . Maybe somehow it is possible to take only the things which are really needed .

It would be super to get a combination of newLISP and maybe a kind of fly under 1MB, and which is portable on an usb-stick .

Locked