July 17, 2007 Leave a comment
Today I hacked up the Escher peers some more, this time I implemented the actual pixelization routine for the antialiasing rasterizer. Before I only converted the coverage information to a grayscale between black and white, which of course looked stupid on colored background. Now it is doing the correct compositing of the foreground and background pixels. This is not exactly nice to implement on X, because (plain) X itself doesn’t support transparent colors or such thing. This means that for every non-fully-opaque or non-fully-translucent pixel I have to fetch the current surface pixel and do the math myself. The outcome can be seen below. Interesting to note is that the linear RGB scale doesn’t seem to do the job perfectly when interpolating linearily. The cyan foreground on red background seem so produce a slightly too dark transition. But for 99.99% of the usual use cases this approach is more than good enough.
Another feature I added to the Escher peers is configurable font mappings through a properties file. This could be improved by adding support for fontconfig stuff. I have to think how to best implement it. IIRC, fontconfig works via a bunch of XML configuration files. Maybe I’ll add a small Java-only fontconfig parser and library and get my font info from there (as an alternative to the fonts.properties approach).