ClearType: Does Java AWT use its own font or use the OS's font in displaying text field?

G

gino

Hi folks,

I need to display some ClearType text in a static text field of a GUI window
using Java AWT. I heard that Java 2D itself currently does not support
ClearType sub-pixel technology. I am wondering if AWT can render font using
OS's global font setting, for instance, on Windows XP, the ClearType font
can be enabled globally, on Linux, it also has sub-pixel rendering
technology can can be enabled OS wide.

I am wondering if the Java AWT uses OS's font by default?
Furthermore, what shall I do if I want to capture the RGB pixel values of
the displayed text and save to harddisk?

Thanks a lot,

-Gino
 
M

Mike Smith

You get ClearType by default if you stick to using Label(). It is a major
hack but see this page for how to do it. If you click the Run Demo button
the bottom paragraph was created entire with Label(). The source is
available on the web page - again, a major hack!

http://www.smithvalley.com/test/aademo.htm

Let me reinterate what theStepan said. Go to the Sun page and put in your
vote so we do not need to do these kinds of hacks just to get decent text
rendering.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4726365.

Mike
 
L

Liz

Mike Smith said:
You get ClearType by default if you stick to using Label().

How can that be? When I set up my laptop for cleartype there were several
screens that were displayed for me to choose from. And how is it done if
you have, for example, linux?
 
M

Mike Smith

----- Original Message -----
From: "Liz said:
How can that be? When I set up my laptop for cleartype there were several
screens that were displayed for me to choose from. And how is it done if
you have, for example, linux?

Label() on Windows always calls through to whatever the native
rendering is set to, this would be ClearType if you have it enabled in
the Display control panel. This is true for the old Microsoft VM and
the VM's by Sun and IBM since the beginning of time.

I am not familiar with what the various Linux VM's do. In fact, I'm
not sure how ClearType works on Linux at all since it is patented by
Microsoft, but I know there are ways to make it work.

Mike
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top