How to display special (unicode) characters

  • Thread starter =?iso-8859-1?q?J=FCrgen_Gerstacker?=
  • Start date
?

=?iso-8859-1?q?J=FCrgen_Gerstacker?=

Hello,
I work on a program to display European (Unicode) characters.

Graphics2D g2 = (Graphics2D) g;
g2.setFont(new Font("monospaced",0,16));
g2.drawString();

'Normal' Greek characters work fine, like

b303 b503 c903 c103 b303 (Unicode, low byte first)
gamma epsilon omega rho gamma

Special Greek characters, like
411f (Unicode, low byte first),
'GREEK LETTER OMICRON WITH DASIA' (U+1F41)

are NOT displayed with this monospaced font.

How can those characters be displayed?

Thank you for your answers!!

Juergen
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jürgen Gerstacker schreef:
Hello,
I work on a program to display European (Unicode) characters.

Graphics2D g2 = (Graphics2D) g;
g2.setFont(new Font("monospaced",0,16));
g2.drawString();

'Normal' Greek characters work fine, like

b303 b503 c903 c103 b303 (Unicode, low byte first)
gamma epsilon omega rho gamma

Special Greek characters, like
411f (Unicode, low byte first),
'GREEK LETTER OMICRON WITH DASIA' (U+1F41)

are NOT displayed with this monospaced font.

How can those characters be displayed?

By choosing an appropriate font, i.e. one that contains glyphs for those
symbols. That is not a Java matter, but rather, you have to have such a
font installed and then have to look into how to make Java use that font
(I have no idea, to be honest).

HTH, H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSXzue+7xMGD3itQRAqQKAJ4gZrkd1qyq0XRVeUH9MqezZ17x8wCfd9nV
udvlvo5A/7/b82QvooNbFDE=
=rX59
-----END PGP SIGNATURE-----
 
?

=?iso-8859-1?q?J=FCrgen_Gerstacker?=

By choosing an appropriate font, i.e. one that contains glyphs for those
symbols. That is not a Java matter, but rather, you have to have such a

Yes, I know

This page

http://www.idevelopment.info/data/P...codings/PROGRAMMING_character_encodings.shtml

states, that
"The following character encodings are supported by JDK 1.1.7a and JDK
1.2"
And
\u1F00 \u1FFF Greek Extended
is part of this list.
As I have installed JDK 6 on my system, I should be able to render
Greek Extended character.
But how??
Juergen
 
J

Joshua Cranmer

Jürgen Gerstacker said:
Yes, I know

This page

http://www.idevelopment.info/data/P...codings/PROGRAMMING_character_encodings.shtml

states, that
"The following character encodings are supported by JDK 1.1.7a and JDK
1.2"
And
\u1F00 \u1FFF Greek Extended
is part of this list.
As I have installed JDK 6 on my system, I should be able to render
Greek Extended character.
But how??
Juergen

Your question has been answered twice correctly, and the fact that you
still do not understand what is wrong means that you do not understand
what's going on.

When Java (or any application) is displaying text, it basically goes to
the font definition and looks up the pixels to draw each character. It
is the responsibility of the user to have appropriate fonts to be able
to draw said character, not the application in question.

For example, many GUI implementations have the ability to parse
character 10, LF. But if you were to look at any font, you would not see
a glyph defined for the LF character. In this case, the application is
setting new lines when it sees LF characters -- it supports the newline
character but most fonts cannot display them because of this special
processing. Similarly, most characters from 0-31 are not defined in font
definitions.

The fact that JDK 1.1.7a, etc., can support the character encoding means
that it is capable of recognizing the characters and properly handling
them; it does not mean that it is guaranteed to have fonts installed to
use them. I can just as well parse Tamil font, but since I don't have a
Tamil font installed, I can't actually display it.

In short, get a monospaced font that has definitions for Greek Extended
characters and look up the font system for JDK 6.

NOTE: I understand that my explanation is oversimplified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top