mdog has asked for the wisdom of the Perl Monks concerning the following question:

OK Brethern --

Let me riddle you this: How do you read in a PS (or EPS) file, change the fonts to something you specify, and then write it back out again so that the image and fonts display correctly? I've been working with ImageMagick and can't see a way. And haven't found anything on the Net, yet.

If you could post a code sample, that would be awesome!

TIA,
mdog

Replies are listed 'Best First'.
Re: PostScript and Modifying Fonts
by tachyon (Chancellor) on Apr 30, 2002 at 00:57 UTC

    Check CPAN under Postscript::. Perhaps Postscript::Simple may be what you want?

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Check CPAN under Postscript::. Perhaps Postscript::Simple may be what you want?

      All of the Postscript:: modules I can find are for generating new postscript files. I can't find a single one that indicates it can open an existing postscript file for editing.

      (Note: perhaps Postscript::Document can do that, but it doesn't seem to have a POD, and I didn't bother reading all of the source)

      a google search for "perl postscript fix" lead to a lot of little one off scripts for "fixing" postscript files, which may lend inspiration.

        That being the case how about converting to a similar format like PDF using something like PStill and then using some of the PDF:: modules to open and manipulate the file?

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: PostScript and Modifying Fonts
by mdog (Pilgrim) on Apr 30, 2002 at 00:54 UTC
    One thing: I know that you can open up a PS file and that the fonts are listed there for you to change...but I was hoping there was some program or module (which I haven't been able to find, yet) would do it so I don't have to worry about my kludgy reg ex screwing up the file.

    Thanks again,
    Matt