[gs-devel] Font issue

shermin ismaik sherminismail at gmail.com
Thu Feb 12 02:45:58 PST 2009


Hi Ken,

The work flow you said is correct except one saying that the
application generates postscript file.My user simply enters his data
in a file and asked to print.So I think I have to write one
application for generating the Postscript file from the print job .So
if my appilication creates a Postscript file from the print job,I can
identify the font using the show operators as you said right???

Then how will i bring  the applications output in ghostscript and CUPS
flow.Sorry for asking this as I have little knowledge in GS.

Thanks a lot for your help

regards,
Shermin


On Thu, Feb 12, 2009 at 2:18 PM, Ken Sharp <ken.sharp at artifex.com> wrote:
> Hi Shermin,
>
> At 13:45 12/02/2009 +0400, shermin ismaik wrote:
>
>
>> Thanks for your prompt reply.
>> What I meant as text file is a simple .text file or .doc file that
>> user is giving the print data in it.
>
> I guess I'm puzzled then, I can't see where Ghostscript fits into this. GS
> presumably isn't handling the text file at all. Also a text file can't have
> any font information in it (doc files are different of course) so how can
> you retrieve font information from it ?
>
> As far as GS is concerned we handle PostScript, PDF, XPS, SVG and PCL as
> input, and can either render these to raster formats or convert to
> PostScript or PDF at a high level. While there are ways to feed ASCII text
> into Ghostscript, this relies on PostScript programming, so its still
> PostScript as far as GS is concerned.
>
> Let me describe what I see as your work flow, and you can tell me where I'm
> going wrong.
>
> 1) User creates a file in some application.
> 2) User prints the file to a printer, either a regular printer or a magnetic
> device.
>
> This leads to the following:
>
> Application (produces PostScript file) -> CUPS -> GS (produces raster file)
> -> printer
>
> Now, if the printer is the magnetic device, you want to 'capture' some of
> the text, that which is written in a specific font. You don't want to render
> the data in this font, but you do want to keep it and send it to another
> application.
>
> Eg:
>
> app->CUPS->GS->raster->printer
>  |
>  +->text in specific font-> ?
>
> It seems you are trying to get the text in the specified font from the
> original file. If so we cannot help you. As you can see GS does not handle
> the original file, just the PostScript produced by the application and
> forwarded by CUPS.
>
> It is possible to use GS to process the PostScript file, gather the text in
> a specified font, and optionally prevent it printing. However this may not
> be text in the way that you would expect, and it may be very difficult to
> reassemble the individual characters into the original text.
>
> It will also require you to do some PostScript programming. In this case I
> would redefine the show operators (and there are many more of those) so that
> they examine the current font, and if it is the specified font do not render
> the text at all but store it elsewhere.
>
> Eg:
>
> /oldshow /show load def
>
> /show {
>  currentfont /FontName get
>  %
>  % insert string comparison against 'magnetic' font name here
>  %
>  {
>    % Store the string argument to a file or something
>  } {
>    oldshow  % render the text, its not in the 'magnetic' font
>  } ifelse
> } bind def
>
> This would have to be done for all the family of show operators.
>
> Alternatively you could write a Ghostscript device which can do the job in
> C, but this is perhaps even harder.
>
> Or perhaps I'm completely misunderstanding what you want to do...
>
>
>                        Ken
>
>


More information about the gs-devel mailing list