Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #5 (closed defect: fixed)

Opened 16 years ago

Last modified 16 years ago

StyledText and Unicode

Reported by: keinfarbton Assigned to: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

Description

From the forum, by Mahe:
Hello,
I'm using a DWT 3.4 on Windows with DMD 1.028.
I have a problem with the "StyledText?" - when I input a Unicode character like "²" or "ä", the program crashes with the message:

tango.core.Exception.ArrayBoundsException@dwt.graphics.TextLayout(1937): Array index out of bounds

A sample program:

module Test;

import dwt.DWT;
import dwt.custom.StyledText;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.widgets.Text;

import dwt.layout.FillLayout;

void main ()
{
    Display display = new Display;
    Shell shell = new Shell(display);

    shell.setLayout(new FillLayout());
    StyledText textField =  new StyledText( shell , DWT.BORDER | DWT.V_SCROLL );
    //Text textField = new Text( shell , DWT.BORDER | DWT.V_SCROLL );

    shell.setText = "Hello DWT World";

    shell.open;

    while (!shell.isDisposed)
        if (!display.readAndDispatch)
            display.sleep;

    display.dispose;
}

Is there a simple possibility to fix that (Like using wchar instead of char)?

Change History

08/22/08 13:30:18 changed by keinfarbton

  • status changed from new to closed.
  • resolution set to fixed.

Fix now