I have found the problem and worked out its repair.
The modified code is attached below.

The problem stems from a bug in java's handling of drawing of
AttributedStrings when a font attribute is specified.   Bug parade
#4650042 describes a similar problem unique to jdk 1.4, but
makes also suggests that there are other more general problems
w/ fonts and AttributedStrings.

In our case, calling
drawString (string....) instead of
drawString (AttributedString...) solves the problem.

The fix simply draws the text using the string version of
drawString and then to draw the underline (if defined)
separately.

I have tested it on jre 1.3.0, jre 1.3.0_02 and jre/jdk 1.4.0 -
all on WinNT4/sp5

attached is the changed code -- it only affects one method
in AWTRenderer.

Will someone commit it ?


At 09:12 AM 5/10/02, you wrote:
>
>Hi all!
>
>Now I've downloaded the sdk version 1.3.1_03 from sun but the result is the
>same like before.
>I've attached a screenshot to this mail.
>My workflow:
>I go to the Driver, set the Logger and my Renderer(extended from
>AWTRenderer), and call render(XMLReader,InputSource) on the Driver,
>After that I go to my Renderer and render each page in a loop and add the
>result within a JLabel to a JPanel, which is showing for the User.
>
>code piece:
>
>driver.render( parser, inputHandler.getInputSource() );
>
>for (int i = 0; i < renderer.getNumberOfPages(); i++)
>{
>         renderer.render(i);
>
>         JLabel label = new JLabel( new ImageIcon(
>renderer.getLastRenderedPage() ) );
>
>         panel.add( label, new GridBagConstraints(0, i, 1, 1, 0.0, 0.0
>                 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new 
> Insets(6, 6, 6,
>6), 0, 0));
>}
>
>the result is below
>
>Can anyone help me or tell me my mistake?
>
>ThanX Torsten
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, email: [EMAIL PROTECTED]


         ' Best,
         -Ralph LaChance

Attachment: AWTRenderer.renderWordArea.zip
Description: Zip archive

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to