Yes.  Generally one font file contains one font set with one weight.
You would need to supply a custom font set to get a different weight.
Any program which allows you to print in a different weight would do the
same, to either require you to have a font set in that weight or to
guess at it.
Guessing can be bad.  For instance I create images from FOP with the
PNGRenderer.  It gets larger images if I increase targetresolution.  If
I generate a smaller image then try to make it bigger with the
Graphics2D transforming method you can see it gets fuzzy.
Optional fuzzy logic could be useful, currently not implemented.

________________________________

From: Marquart, Joshua D [mailto:[email protected]] 
Sent: Wednesday, March 09, 2011 11:50 AM
To: Glenn Adams; [email protected]
Subject: RE: Font Weight



"FOP does not synthesize fonts with different weights. You need to
supply the fonts with the weights you specify in FO content."

 

I understand Fop doesn't synthesize the weights.  I understand that it
has two specific built-in weights (700 and 400) that are being used to
replace other weights per the following:

 

When I set-up using a Java2DRenderer and specify the following FO
content snippets:

 

<fo:table-cell font-size="10pt" font-family="Helvetica"><fo:block
line-height="13pt">

<fo:block white-space-collapse="true">

<fo:inline font-weight="900">900 Weight </fo:inline>

...

<fo:inline font-weight="800">800 Weight </fo:inline>

...

<fo:inline font-weight="700">700 Weight </fo:inline>

...

<fo:inline font-weight="600">600 Weight </fo:inline>

...

<fo:inline font-weight="500">500 Weight </fo:inline>

...

<fo:inline font-weight="400">400 Weight </fo:inline>

...

<fo:inline font-weight="300">300 Weight </fo:inline>

</fo:block></fo:block></fo:table-cell>

...

 

the logger gives me the following information:

 

WARNING: Font "Helvetica,normal,900" not found. Substituting with
"Helvetica,normal,700".

WARNING: Font "Helvetica,normal,800" not found. Substituting with
"Helvetica,normal,700".

WARNING: Font "Helvetica,normal,600" not found. Substituting with
"Helvetica,normal,700".

WARNING: Font "Helvetica,normal,500" not found. Substituting with
"Helvetica,normal,400".

WARNING: Font "Helvetica,normal,300" not found. Substituting with
"Helvetica,normal,400".

 

So I would need to supply very specific replacement fonts for
Helvetica,normal,900 ( and 800-300, not counting 400)?

(Same as above when replacing Helvetica with Arial).

 

I DO understand the following:

 

1- that per the current specs, item 7.9.9 for font-weight has a "TODO
<relative> font weights" message.

2 - that per the current build, the font classes generated from
Helvetica.xml and HelveticaBold.xml are used for 400 and 700
respectively

3 - that per the fuzzy replacement, 700 is used for 900-600 and 400 is
used for 500-100(probably).

 

So my questions still stand

1 - is there a simpler way to use / access / apply a darker 500 or 600
weight Helvetica and if so, what's the best process to handle it given
the codebase?

2 - should I instead render a "Helvetica500.xml" and generate the
appropriate font class; obviously since that's not yet been done with
the existing fop codebase, it is probably a lot more work than needed.

3 - Any other option I should pursue?

 

If there is a process started to handle item 7.9.9, I would be happy to
pitch in and help, I am just not certain where to start.

 

Thanks,

 

Josh

 

 

From: Glenn Adams [mailto:[email protected]] 
Sent: Tuesday, March 08, 2011 6:40 PM
To: [email protected]
Cc: Marquart, Joshua D
Subject: Re: Font Weight

 

FOP does not synthesize fonts with different weights. You need to supply
the fonts with the weights you specify in FO content.

 

Regards,

Glenn

On Tue, Mar 8, 2011 at 4:31 PM, Marquart, Joshua D
<[email protected]> wrote:

I have a question about Font Weight.

 

We're using Helvetica and using FOP to take the FO file and generate it
as both (1) a PostScript file and (2) a TIFF file.  

 

Additionally, we are able to use third-party software to take the
PostScript file and convert it directly to a second TIFF file (for
comparison reasons).

 

Of course, the fonts on the TIFF from FOP are a little pixilated and the
"normal" font could stand to be rendered a bit darker.

 

I am using Helvetica and tried to set the font-weight to 500 or 600, but
it gets replaced with weight 400, which is apparently the "normal"
Helvetica font registered in the system.

Font-weight Bold and values of 800 and 900 use the "bold" Helvetica
which is weight 700.

 

Is there an easy way to use / access a darker 500 or 600 weight
Helvetica, or possibly render the or am I really sunk here?

 

I've already extended the Java2DRenderer,  for my own purposes.  

 

The following Graphics2D rendering hints don't seem to do much when
included:

 

graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);

graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);

graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

graphics.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);

graphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,
RenderingHints.VALUE_STROKE_PURE);

 

Suggestions would be very helpful.

 

Much thanks,

 

Josh

in error, please notify First Data immediately by replying to this
message and deleting it from your computer. 

 

________________________________

The information in this message may be proprietary and/or confidential,
and protected from disclosure. If the reader of this message is not the
intended recipient, or an employee or agent responsible for delivering
this message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify First Data immediately by replying to this message and deleting
it from your computer. 

Reply via email to