Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to Display UTF-8 Characters in SWT?
| | | | | |
Re: How to Displaying UTF-8 Characters in SWT? [message #510050 is a reply to message #509920] |
Tue, 26 January 2010 11:03 |
RealName Mising name Messages: 7 Registered: July 2009 |
Junior Member |
|
|
Paul Webster wrote:
> babspam@hotmail.de wrote:
>> The goal was to display classical greek letters, wich utf-8 code
>> position is 1F00 to 1FFF (sorry, 8118 was wrong, it's decimal). This
>> letters are part of the UTF-8 encoding. I don't want special fonts if
>> possible.
>
> As Ed mentions, UTF specifies characters ... think ascii 65 == 'A' but
> says nothing about how 'A' should be displayed (Courier, Times Roman,
> etc) in your terminal or UI. Your font will. You need to make sure
> that your app defaults to a common font that can display characters in
> that range.
>
> PW
>
Try:
for (FontData fontData : display.getFontList(null, false)) {
System.out.println(fontData.getName());
}
for (FontData fontData : display.getFontList(null, true)) {
System.out.println(fontData.getName());
}
this should give you the list of fonts alredy installed in your system.
then you'll have to try which one displays correctly like this:
Font font = new Font( display, fontData.getName(), 20, SWT.NORMAL );
|
|
| | |
Goto Forum:
Current Time: Thu Dec 26 14:10:11 GMT 2024
Powered by FUDForum. Page generated in 0.05035 seconds
|