You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Rob Stote <RS...@whitehilltech.com> on 2003/06/04 23:17:37 UTC

True Type Font in ps renderer

Hello:

	I am trying to render a document that utilizes "ocraext.ttf" for one
line on the document for bill paying. I was able to add the font into FOP,
do the configuration and get it to work...sort of. When I render in PDF I
can see the line in the document in the correct font, when I render to PS I
can not even see the line. After much reading and searching I have come to
discover that ttf is not supported in the ps renderer. My question(s) are
this:

1) has anyone created a work around ?

2) is there a way,  post processing,  to "define" the font in the postscript
file. Can I "manually" alter the ps file, before sending it to the printer,
that is can I imbed the definition of the font in the ps file, then alter
the file where I need to and make the line appear in the correct font.  
Currently, I need to stick to PS files because in the PS document I inject =
"statusdict begin 0 setpapertray" to select the paper tray as there is no
way to do this within FOP or the style-sheet. 

3) If I figure out away to print the PDF directly I will render to PDF, but
I have to set a tray command on the document, and I don't know how to do
this for a PDF doc. In addition to this I use some of the contents of the PS
doc to gather metrics (ie number of pages, sent to printer etc...)
Is there a way to "inject" this command into a PDF doc. And is there a way
to get the page-count of a PDF doc?

Sorry for the long windedness... and the potential confusion

Rob

Re: True Type Font in ps renderer

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 04.06.2003 23:17:37 Rob Stote wrote:
> 	I am trying to render a document that utilizes "ocraext.ttf" for one
> line on the document for bill paying. I was able to add the font into FOP,
> do the configuration and get it to work...sort of. When I render in PDF I
> can see the line in the document in the correct font, when I render to PS I
> can not even see the line. After much reading and searching I have come to
> discover that ttf is not supported in the ps renderer.

That's correct.

> My question(s) are this:
> 
> 1) has anyone created a work around ?

Not to my knowledge. I've made a time estimation on this for someone
recently, but they didn't want to pursue.

If the work-around below doesn't work for you, you have several options:
- This is OpenSource, you can do it yourself.
- This is OpenSource, you can wait until someone has free time and thinks
  this is fun to implement.
- You can find/hire someone to do it for you.

> 2) is there a way,  post processing,  to "define" the font in the postscript
> file. Can I "manually" alter the ps file, before sending it to the printer,
> that is can I imbed the definition of the font in the ps file, then alter
> the file where I need to and make the line appear in the correct font.  
> Currently, I need to stick to PS files because in the PS document I inject =
> "statusdict begin 0 setpapertray" to select the paper tray as there is no
> way to do this within FOP or the style-sheet. 

What you want to do is not so simple. You could just as well implement
TrueType support in the PostScript renderer.

The obvious work-around is to use the PDF renderer and use GhostScript
to do a PDF to PS conversion. Works fine, but will result in a
performance penalty (around 40-50% additional time per document). 

> 3) If I figure out away to print the PDF directly I will render to PDF, but
> I have to set a tray command on the document, and I don't know how to do
> this for a PDF doc. In addition to this I use some of the contents of the PS
> doc to gather metrics (ie number of pages, sent to printer etc...)
> Is there a way to "inject" this command into a PDF doc. And is there a way
> to get the page-count of a PDF doc?

There's no standard way to embed information like paper tray into a PDF
document. An embedded or associated jobticket might provide a solution
but that always depends on your printer. After all, your printer needs
to have a PDF RIP in the first place.

The page count of a PDF doc can easily be determined by using a
third-party PDF post-processing tool like iText.
http://xml.apache.org/fop/resources.html#products-pdf

Also, FOP gives information about the number of pages rendered as
described here: http://xml.apache.org/fop/embedding.html#render-info

> Sorry for the long windedness... and the potential confusion

No confusion, I know exactly what you're talking about. I have gone
through it all. :-)

Having written all that I went over it again and reread your first
paragraph and I got an idea: Install that OCRA font on your machine and
use SVG to write that single line of text. Make sure you have
strokeSVGText set to true. I haven't tested this here but maybe, maybe
it could work. Background: Batik will convert the text to shapes which
get painted in the PostScript file. No font support needed. Maybe. Good
luck.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org