[OpenJDK 2D-Dev] Font question

Phil Race Phil.Race at Sun.COM
Thu Apr 17 19:36:45 UTC 2008


Roman,

Roman Kennke wrote:
> Anti-aliasing is on by default for the X11 pipeline, right? I wonder,
> because I find this code in X11SurfaceData.validatePipe():

No. Its not on anywhere by default.
The Java2D default is OFF. And turning AA on by default for
X11 kills remote X11, but that's another challenge project ..

> 
>                 switch (sg2d.textAntialiasHint) {
> 
>                 case SunHints.INTVAL_TEXT_ANTIALIAS_DEFAULT:
>                     /* equating to OFF which it is for us */
>                 case SunHints.INTVAL_TEXT_ANTIALIAS_OFF:
> 
> 
> This seems to indicate the opposite. Is there another switch to
> determine the default text AA setting?

Nope. The place to change this would be in SunGraphics2D.
Offhand I can't think if there's any place else that would need
to be updated but I wouldn't be surprised.  Eg if some code
wanted "OFF" rather than going to the trouble of setting it
explicitly it might rely on that default.
Anyway, that's not a recommendation to do it, just an observation.

> 
>>> Do you have a quick hint, how I can enable AA rasterization? As I said,
>>> I don't get any gray values in my rasterizer, only 0 and 255, even when
>>> the rendering hint is set to AA for text.
>> I'm not clear what you mean by 'your rasterizer'.
> 
> Sorry, wrong terminology. I mean 'text renderer'. My TextRenderer is a
> subclass of GlyphListPipe, and I seem to get no gray values there, even
> if I use this for AA text. Maybe I did something wrong.

As I think you suggested in an earlier email, if you are seeing all
values either 0 or 255, something went wrong already. Maybe the problem
is that you expected the default to be ON, but its OFF.
The only way in OpenJDK, as delivered, to get the text antialiased is
to set the hint on the Graphics2D.

-phil.



More information about the 2d-dev mailing list