OK. As Edvin mentioned, Pivot uses the AA hints provided by the platform by 
default. Is it possible that Ubuntu/GNOME recently changed these defaults and 
the JDK has not been updated yet?

On Jul 25, 2011, at 8:55 AM, Pierre Jansen wrote:

> 
> On Mon, Jul 25, 2011 at 2:42 PM, Greg Brown <[email protected]> wrote:
> Sorry if this was mentioned earlier in the thread, but what platform are you 
> using?
>  
> I'm running Ubuntu 10.04 (GNOME) with the Sun JRE (1.6.0_22) / 32 bit. 
> 
> On Jul 25, 2011, at 8:22 AM, Pierre Jansen wrote:
> 
>> 
>> On Sun, Jul 24, 2011 at 11:38 PM, SYSE | Edvin <[email protected]> wrote:
>> I think your text is actually antialiased already,
>> 
>> Thanks for looking into this. I'm not sure that this is the case though. As 
>> a crude workaround, I sub-classed Label and overrode paint(Graphics2d), 
>> allowing me to manually add the RenderingHints. I tried both 
>> VALUE_TEXT_ANTIALIAS_LCD_ON and VALUE_TEXT_ANTIALIAS_LCD_HRGB. Both returned 
>> different results to the default (VALUE_TEXT_ANTIALIAS_LCD_HRGB seemed to be 
>> the best).
>>  
>> but I found that you can override what kind of hint is used by adding this 
>> code somewhere in your app before the rendering takes part, for example in 
>> the Application#startup() method:
>> 
>>        Field aaHintValueField = 
>> FontRenderContext.class.getDeclaredField("aaHintValue");
>>        aaHintValueField.setAccessible(true);
>>        aaHintValueField.set(Platform.getFontRenderContext(), 
>> RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
>> 
>> Thanks, I'll give this a go - looks to be a far cleaner option than my 
>> current workaround.
>> 
> 
> 

Reply via email to