postscript - module

Started by didi, May 17, 2009, 10:35:53 AM

Previous topic - Next topic

didi

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



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

didi

#1
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

#2
all links to images and example files are now restored:



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

cormullion

#3
Quote from: "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.


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

#4
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

#5
Just found PNGwriter on sourceforge.net , seem to be small and easy to use.

Thinking about an interface to newLISP .

didi

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

xytroxon

#7
Quote from: "didi"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/">//http://www.libgd.org/



With bindings for:

http://www.libgd.org/Binders">//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/unix/fly/fly-1.6.0.WinNT.zip">//ftp://ftp.unimelb.edu.au/pub/www/tools/unix/fly/fly-1.6.0.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

#8
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/">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">http://www.imagemagick.org/script/binary-releases.php

didi

#9
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 .