Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329203 - StyledText doesn't render snowman correctly with most fonts
Summary: StyledText doesn't render snowman correctly with most fonts
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-01 12:24 EDT by Markus Keller CLA
Modified: 2021-12-12 10:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-11-01 12:24:54 EDT
HEAD, Windows 7 64-bit, using 32-bit JDK/SWT

Run the snippet below. I'd expect the two widgets to look similar, but the StyledText has problems with rendering the snowman (\u2603) correctly in all places.

With most fonts I tried, the snowman after "abc" is rendered as a question mark in a box. Only looks OK with the "Tahoma" font. With "Segoe UI", all occurrences are rendered as snowmen, but with different shapes.

This problem only happens with certain characters. Other examples are \u266d and \u2602.

I first thought bug 170466 has returned, but the example from there still looks fine.


package snippets;

import org.eclipse.swt.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Snowman {
    private static final String STR= "key1\u2603=abc\u2603, \u2603=,";

    public static void main(String[] args) {
        Display display= new Display();
        Shell shell= new Shell(display);
        shell.setLayout(new GridLayout());

        Font font= new Font(display, "Consolas", 20, SWT.NORMAL);
        
        Text text= new Text(shell, SWT.SINGLE);
        text.setText(STR);
        text.setFont(font);

        StyledText styledText= new StyledText(shell, SWT.SINGLE);
        styledText.setText(STR);
        styledText.setFont(font);
        
        styledText.setLeftMargin(-text.computeTrim(0, 0, 0, 0).x);

        shell.pack();
        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        display.dispose();
        System.out.println();
    }
}
Comment 1 Eclipse Webmaster CLA 2019-09-06 15:35:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 2 Eclipse Genie CLA 2021-12-12 10:40:58 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.