[OpenJDK 2D-Dev] Problems with lcd-antialiased glyphs

Clemens Eisserer linuxhippy at gmail.com
Thu Jun 12 11:53:11 UTC 2008

Hi Phil,

> Verify your ARGB values that are uploaded are what you expect
> and in the correct order required.
> If they are then maybe its something in the xrender usage.
Thanks a lot for looking into this, you were right of course and the
values were in wrong order.
It seems to be BGRA, however the Xrender-docs mention the data has to
be in the format of a ZPIXMAP, so I guess I am doing it wrong anyway,
and I should be using an XImage for uploading instead of
self-allocated buffers.
I guess I am just doing manual byte-swapping here ;)

It now looks quite ok: http://picasaweb.google.com/linuxhippy/Subpixel
, but there is a difference, maybe because of the gamma adjustments.

> The LUTs are used as pre and post conversions on the components
> of the destination. They apply an inverse gamma adjustment on
> the component that is read from the device, and a gamma adjustment
> on the results before they are written back.
> If Xrender does something like this at all, then it should have
> some way for you to specify the gamma value. If it doesn't then
> you'll either have to accept what it does, or if the results aren't
> ideal, then Xrender can't be used at all for this case.
> The effect of this is to increase or decrease the contrast, and
> JDK needs this to be compatible with Windows behaviours.
> So if you don't or can't apply it then the text rendered will be different
> in contrast between the xrender and the other pipelines, but has
> no bearing on the bigger problems you are seeing.
Well maybe there are some tricks to get it done right, but the
XRender-Api does not (at least not explicitly) mention anything like
contrast or gamma, I'll ask on the xorg-list maybe there are other

I may have misunderstood the blog here
(http://anholt.livejournal.com/32058.html), but if they optimize
subpixel-text with just two composition operations, is there even any
room for gamma adjustment?

Thanks a lot, Clemens

More information about the 2d-dev mailing list