You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Dorothea Wiarda <wi...@vic.com> on 2000/11/13 09:59:13 UTC

Re: AWTRenderer: larger base font in AWTFontMetrics

Mikko Honkala wrote:
> 
> Hi!
> 
> I tested turning off anti-aliasing:
> 
> In AWTRenderer.renderInlineArea() :
> FontRenderContext newContext = new FontRenderContext(null, false, false);
> 
You also have to uncomment all the graphic settings, like in the 
attached  AWTRenderer.java file. Otherwise, you change the
FontRenderContext  for the TextLayout  but not for the actual drawing.
All this makes the problem somewhat better but not better. 

> It did not solve this 'overlapping bold words' problem.
> 
> But when used together with a larger font in AWTFontMetrics as the base
> font:
> 
> public static final int FONT_SIZE=50;
> 
> The bold words were no longer overlapping!
> 

The fontmetric in java does not scale. So it is hard to find a suitable
FONT_SIZE value. Hence my question what are the drawbacks of changing
org.apache.fop.layout.FontMetricso and org.apache.fop.layout.FontStatus.
Then the one could use the actual desired font-size. It seems to be also
system-dependent,since the bold-words did not overlap on my machine
(Linux Redhat) but I did not try it on Windows yet. Will to so later
today or tomorrow.

Also regarding yur use of getStringBounds - it seemed (and I will check
that again on Linux and Windows) that for 
new FontRenderContext(nul, false, false), getStringBounds and 
FontMetrics.charWidth are equal. And in any other case 
FontMetrics.charWidth is larger than getStringBounds.

Doro



________________________________________________________
Dorothea Wiarda

E-Mail:    wiarda@dwiarda.com
Web-Home:  http://www.dwiarda.com
           http://www.techno-info.com