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 Debasish Jana <de...@anshinsoft.com> on 2006/06/13 14:24:54 UTC

TTF and OTF fonts in FOP 0.92

Hi:

While rendering fonts (TTF) from XSl-fo to PDF, the fonts are not shown as
smooth as it should be. The font I am using is a TTF font named "Univers LT
57 Condensed". 

The corresponding entry in the FOP configuration file is as follows:

<font metrics-url="./fonts/lte50146.xml" kerning="yes" 
    embed-url="./fonts/lte50146.ttf">
  <font-triplet name="Univers LT 57 Condensed" style="normal" 
      weight="normal" />
</font>

After seeing it in Acrobat Reader, by making smooth text option off, the
texts look much better. 

It seems somehow the smoothening of the characters in the specified font is
not happening properly.

What could be the reason? Are we missing something in setting up the
configurations?

Another question, is FOP 0.92 using SVG to render fonts in PDF?

Also, how do I incorporate OTF?

Thanking you in advance,

Regards,

Debasish Jana



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


RE: TTF and OTF fonts in FOP 0.92

Posted by Debasish Jana <de...@anshinsoft.com>.
Hi:

Many thanks for your prompt reply. We have another observation. If we embed
a TTF font while rendering PDF through FOP, and if don't embed the TTF font,
there is a difference noticed. If the PDF reader takes up font from
installed fonts (in case desired font is not embedded), the font looks
better (and different) than the case when the font is embedded.

Our question is whether during rendering embedding is causing this
difference. What could be a workaround in case we want embedding of the
desired font looking like exactly same when picked up from installed fonts
(unembedded case).

Thanking you in advance,

Regards,

Debasish Jana


-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de] 
Sent: Wednesday, June 14, 2006 3:36 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: TTF and OTF fonts in FOP 0.92

Debasish Jana wrote:
> While rendering fonts (TTF) from XSl-fo to PDF, the fonts are not shown as
> smooth as it should be.
...
> After seeing it in Acrobat Reader, by making smooth text option off, the
> texts look much better. 

Is this "smooth text" option an option in Acrobat Reader? If so,
that's not a problem with FOP but rather with the combination of the
font, your display and/or the graphics driver, and perhaps Acrobat
Reader itself.


> It seems somehow the smoothening of the characters in the specified font
is
> not happening properly.

Well, I used to associate "smoothing" for fonts with "anti-aliasing".
This is known to give bad results under for some fonts on mainstream
computer displays and certain other circumstances. A font with
"Condensed" in its name is a candidate for such a situation, for
reasons given further down.

The print-out should be ok, because printers generally have a much
higher resolution than computer displays.

> What could be the reason? Are we missing something in setting up the
> configurations?

I don't think there is anything FOP can do in this situation. If you
want good results on a computer display, use a font which has a stroke 
width of at least one display pixel for mainstream displays (a 19"
at 1280x1024 has ~84dpi) for common font sizes (12pt). The letters
should mainly use exactly horizontal and vertical strokes. Thin,
slightly slanted lines fare horrible if anti-aliasing is enabled.

> Another question, is FOP 0.92 using SVG to render fonts in PDF?

That's a strange question. Why do you ask this? And no, FOP doesn't
render fonts in regular FO content at all; rather, the glyph definitions
are embedded (for user fonts) into the PDF. Rendering is done by the PDF
viewer, which usually delegates the job to the graphics system on the
host machine.

> Also, how do I incorporate OTF?

OTF is an enhancement of the TTF format. You can try to handle it
exactly like a TTF, i.e. generating a metrics file using TTFFile
etc. If you get an error (likely), the answer is "no chance, pal".
Note that not getting an error while generating a metrics file
doesn't necessarily mean all is well.
Some font editors are said to be able to downgrade OTF fonts to TTF
automatically with reasonably good results, you might want to ask
on an appropriate forum.

J.Pietschmann



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


Re: TTF and OTF fonts in FOP 0.92

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Debasish Jana wrote:
> While rendering fonts (TTF) from XSl-fo to PDF, the fonts are not shown as
> smooth as it should be.
...
> After seeing it in Acrobat Reader, by making smooth text option off, the
> texts look much better. 

Is this "smooth text" option an option in Acrobat Reader? If so,
that's not a problem with FOP but rather with the combination of the
font, your display and/or the graphics driver, and perhaps Acrobat
Reader itself.


> It seems somehow the smoothening of the characters in the specified font is
> not happening properly.

Well, I used to associate "smoothing" for fonts with "anti-aliasing".
This is known to give bad results under for some fonts on mainstream
computer displays and certain other circumstances. A font with
"Condensed" in its name is a candidate for such a situation, for
reasons given further down.

The print-out should be ok, because printers generally have a much
higher resolution than computer displays.

> What could be the reason? Are we missing something in setting up the
> configurations?

I don't think there is anything FOP can do in this situation. If you
want good results on a computer display, use a font which has a stroke 
width of at least one display pixel for mainstream displays (a 19"
at 1280x1024 has ~84dpi) for common font sizes (12pt). The letters
should mainly use exactly horizontal and vertical strokes. Thin,
slightly slanted lines fare horrible if anti-aliasing is enabled.

> Another question, is FOP 0.92 using SVG to render fonts in PDF?

That's a strange question. Why do you ask this? And no, FOP doesn't
render fonts in regular FO content at all; rather, the glyph definitions
are embedded (for user fonts) into the PDF. Rendering is done by the PDF
viewer, which usually delegates the job to the graphics system on the
host machine.

> Also, how do I incorporate OTF?

OTF is an enhancement of the TTF format. You can try to handle it
exactly like a TTF, i.e. generating a metrics file using TTFFile
etc. If you get an error (likely), the answer is "no chance, pal".
Note that not getting an error while generating a metrics file
doesn't necessarily mean all is well.
Some font editors are said to be able to downgrade OTF fonts to TTF
automatically with reasonably good results, you might want to ask
on an appropriate forum.

J.Pietschmann

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