You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/07/13 07:55:17 UTC

[jira] Updated: (HARMONY-4386) [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer

     [ https://issues.apache.org/jira/browse/HARMONY-4386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Petrenko updated HARMONY-4386:
-------------------------------------

    Summary: [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer  (was: [classlib][awt]Exception when trying to use java.awt.font.LineBreakMeasurer)

> [classlib][awt] Exception when trying to use java.awt.font.LineBreakMeasurer
> ----------------------------------------------------------------------------
>
>                 Key: HARMONY-4386
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4386
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitriy Matveev
>            Assignee: Alexey Petrenko
>         Attachments: Harmony-4386.patch
>
>
> Exception when trying to use java.awt.font.LineBreakMeasurer with AttributedCharacterIterator and ShapeGraphicAttribute.
> Example below:
> import java.awt.Frame;
> import java.awt.Graphics;
> import java.awt.Graphics2D;
> import java.awt.Shape;
> import java.awt.event.WindowAdapter;
> import java.awt.event.WindowEvent;
> import java.awt.font.FontRenderContext;
> import java.awt.font.GraphicAttribute;
> import java.awt.font.LineBreakMeasurer;
> import java.awt.font.ShapeGraphicAttribute;
> import java.awt.font.TextAttribute;
> import java.awt.Rectangle;
> import java.text.AttributedString;
> import java.text.AttributedCharacterIterator;
> public class TextTest {
>     public static void main(String[] args) {
>         Frame f = new Frame("Test"){
>             public void paint(Graphics g){
>                 Graphics2D g2 = (Graphics2D)g;
>                 AttributedString as = new AttributedString("Abc");
>                 Shape s = new Rectangle();
>                 ShapeGraphicAttribute sga = new ShapeGraphicAttribute(s, GraphicAttribute.TOP_ALIGNMENT, false);
>                 as.addAttribute(TextAttribute.CHAR_REPLACEMENT, sga, 0, 1);
>                 AttributedCharacterIterator aci = as.getIterator();
>                 FontRenderContext frc = g2.getFontRenderContext();
>                 LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
>             }
>         };
>         
>         f.setBounds(0, 0, 800, 600);
>         f.setVisible(true);
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent ev) {               
>                 System.exit(0);
>             }
>         });        
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.