Page 1 of 1

Detect fonts and spot colors

Posted: 2009-05-06T13:15:42-07:00
by geroldboehler
Hello again

is it possible to detect if a EPS file is using:

- fonts
- spot colors

and if yes, what would be the easiest (and fastest) way to check that?

Thanks and regards

gerold

Re: Detect fonts and spot colors

Posted: 2009-05-06T18:45:27-07:00
by anthony
Hhhhmmmm.... pardon?

Note IM does not care about fonts or colors or images in EPS; It gets a rasterized image of the EPS from ghostscript, as such does not have any information about EPS content!

See A word about Vector Image formats
http://www.imagemagick.org/Usage/formats/#vector

I think you may need to look at some of teh ghostscript and other Postscript utilities for internal details of EPS.

Re: Detect fonts and spot colors

Posted: 2009-05-06T22:25:57-07:00
by geroldboehler
Thanks anthony,

i know that ghostscript is used to rip images - i just thought maybe i could use something like

Code: Select all

identify -verbose file.eps
and then check if it lists spot colors or embedded fonts or something... i'm just not sure what to check.

for me it's important that i can:

- detect if the eps is cmyk or rgb - i can do that by looking at the colorspace
- detect if the eps has text in it that would require a font to render properly
- detect if it uses spot colors

the first one i got already - so if one of you guys knows how i can detect the other two, please let me know!

thanks and regards

gerold

Re: Detect fonts and spot colors

Posted: 2009-05-07T18:57:51-07:00
by anthony
There are utilities for ghostscript that will list some information about a postscript file.

For example extract any TEXT in the PS. will let you know that their is text in the PS!

As for fonts, usually PS documents include the fonts they are using as part of the file, except for cases where only VERY standard fonts are used.

In any case this is not a problem for ImageMagick, and as such this is the wrong forum for such information

Re: Detect fonts and spot colors

Posted: 2009-05-09T04:02:10-07:00
by geroldboehler
If anyone is interested, i am using ps2ascii that comes with ghostscript to check for text in the eps.

Looking at embedded fonts is not a good solution i think, since if there's embedded fonts but no text that uses it it would be detected wrong. (If it's at all possible to embed fonts without using text, dunno)

Gerold

Re: Detect fonts and spot colors

Posted: 2009-05-10T18:26:32-07:00
by anthony
geroldboehler wrote:If it's at all possible to embed fonts without using text, dunno
Oh anything is posible.

What most people don't realise is that Postscript is NOT a Image Format in the normal sense!

What it is, is a computer language (like C, Perl, Ruby, Shell, DOS) that generates a drawing on multiple pages!

as a computer program anything is posible! I have seen people write programs in postscript that doesn't actually print anything, just return the resulting calculations. On the other hand I have also seen a postscript program that generates hundreds of different pages, that never ends (until you reset the printer that is).

Postscript is a computer language, as this is why ImageMagick did not even attempt to implement and understand it too deeply, but pass it off to a seperate software package that specializes in running that program... GhostScript

Sure postscript is usually organised into pages, which are also usually marked out using special structure comments, so that simpler programs can extract say a single specific page, but postscript does not have to follow that convention.

Which brings us back to the point. yes a 'normal' postscript file can contain fonts that were never used. Usually such useless information is optimised out of the file to make it smaller, but that does not mean it does not happen. And it more common that you may think!

So check with ps2ascii to see if ghostscript can see text being 'drawn'. However also note that just because it is drawn does not mean it is 'visible' though it is highly unlikely that it is drawn than 'erased' again, unless it is for some weird method of protection.


PS: What I would really like to see is some easy of extracting embedded raster image raw data (before they are drawn at some specific 'density') from a postscript file.

Re: Detect fonts and spot colors - and bitmap graphics

Posted: 2009-05-13T16:07:33-07:00
by geroldboehler
Hi anthony,

thanks for your answer. I am doing it like ps2ascii (shellscript that comes with gs) now and check for text included in the file.
now i wonder if it's possible to detect if the file includes spot colors (even better: if it includes and really uses spot colors).

also i wonder if it's possible to detect if a file includes a "bitmap object".

any ideas about that?

thanks and regards

gerold