Antialiasing

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Antialiasing

Postby abgorn » Sun Jun 28, 2009 1:59 pm

I've been trying to get the RSyntaxTextArea to use antialiasing but I can't get it. I've tried textArea.setTextAntiAliasHint(java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
and all the other variables in the class that have something to do with it but it still won't work even if I cast it into a string.

Can anyone help?
abgorn
 
Posts: 4
Joined: Sun Jun 28, 2009 1:51 pm

Re: Antialiasing

Postby robert » Sun Jun 28, 2009 10:55 pm

The parameter for setTextAntiAliasHint is the name of the RenderingHints value, as a String, not the value itself. From the Javadoc:

public void setTextAntiAliasHint(java.lang.String aaHintFieldName)

Sets the rendering hint to use when antialiasing text in this editor.

Parameters:
aaHintFieldName - The name of a field in java.awt.RenderingHints. If an unknown or unsupported field name is specified (such as a 1.6+ hint being specified when this is a 1.4/1.5 JVM), null is used instead. A value of null means "no antialiasing."


So for example, you should be able to do:

Code: Select all
setTextAntiAliasHint("VALUE_TEXT_ANTIALIAS_ON");


I can't remember why, but there is some peculiar reason you pass it the name of the RenderingHints value, and not the value itself. I'll have to dig into the code to remember why. Perhaps in a future release you'll actually pass a RenderingHints value.
User avatar
robert
 
Posts: 639
Joined: Sat May 10, 2008 5:16 pm

Re: Antialiasing

Postby abgorn » Mon Jun 29, 2009 12:18 am

Thanks, problem solved :D
abgorn
 
Posts: 4
Joined: Sun Jun 28, 2009 1:51 pm

Re: Antialiasing

Postby Guest » Sat Jul 17, 2010 6:42 am

I just wanted to say that I appreciate the suggestions of robert.
Keep up the good work man !!! :)
Guest
 


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron