Anti-aliased fonts sample desktop
Last updated at 1:32 pm UTC on 14 January 2006
Look below the picture for more information on the sub-pixel rendering illustration in this picture.
This desktop picture was taken during the development of the first beta of the FreeType plugin for Squeak. In the upper right corner you can see the system font menu, which lists Squeak's installed fonts in their own style. The line "Regular" remains from an earlier, buggy version, which is why it looks weird.
Sub-pixel rendering illustration
In the lower right corner I have made three magnified versions of a sample of the rendered type which illustrate how sub-pixel rendering works. (See this web site for a good explanation of how SPR works.)
Note that sub-pixel rendering only works as intended on color LCD screens because how the R, G, and B elements are positioned on the physical screen.
- The uppermost one is just a regular MagnifierMorph. Here you see that the "grayscale" pixels that do the anti-aliasing are in fact colored.
- The lower left one magnifies the same area, but the R, G, and B elements of each pixel have been split into three adjacent pixels with the respective red, green, and blue colors. This is why the background white appears as red, green and blue stripes. (White is composed by maximum intensities of R, G, and B).
- The lower right image is a magnified version of the one on the left, so that the indiviual R, G, and B values of the pixels are easier to see.
For instance, the yellow arrow points at one pixel where the R, G, and B pixels are successively less black, giving the effect of fading to the right. (Note that adjacent R, G and B values make up one regular pixel.) For this reason, the pixel as a whole becomes blue, as seen in the upper magnified image. This is because the B component is least black, ie. has the highest intensity of R, G, and B in this pixel. In the pixels above it, the blue component is darkest, which makes the overall pixel color brownish (red+green).
NB: The method for producing this kind of "reversed" sub-pixel rendering into magnified red, green and blue pixels is included in the provided code, as the method Form>>subPixelInverse.
- Use the "grab from screen" command in the New Morph menu on the area you want to magnify.
- Inspect (or explore) the morph you get, and send #inverse to the imageForm instvar. For example, use World primaryHand attachMorph: (SketchMorph new form: imageForm)
- Use a MagnifierMorph on the result to see the details better.
Note 1) use small bitmaps like in the picture above, since the code in this method is slow. 2) it doesn't work correctly on some bitmaps which yield an all-black result. It has something to do with alpha channel values. #subPixelInverse2 is a variant method which sometimes works when the ordinary one doesn't.
Main High-quality font support page