[squeak-dev] Re: [Ann] Enhanced StrikeFonts (antiAliasing, subPixel AA)

Juan Vuletich juan at jvuletich.org
Thu Aug 6 02:34:23 UTC 2009


Hi Folks,

A new version of the new StrikeFonts is in the trunk.

Bert Freudenberg wrote:
>
> On 05.08.2009, at 18:17, Juan Vuletich wrote:
>
>> Bert Freudenberg wrote:
>>> Juan,
>>>
>>> the new StrikeFonts look nicely crisp, but the letter spacing seems 
>>> to be off. Compare this new to old rendering:
>>>
>>> (image snipped)
>>>
>>>
>>>
>>> Can this be made more homogenous? The space after the "r" seems to 
>>> be too large, and the sequence "lit" looks very uneven compared to 
>>> the right, older shot.
>>>
>>
>> I created the fonts automatically, from a sample rendered with 
>> FreeType, using area each glyph uses. In this case, the $r has a very 
>> light blue pixel at the topRight. I can modify the script to ignore 
>> pixels that are too light when setting the bounds for the glyph, but 
>> I can not guarantee perfect results unless glyphs are tweaked by hand.
>
> Yes, under magnification I see thew problem ... oh well :)

I fixed it. I added an heuristic to the font build script, to discard 
some very light pixels. It looks quite nicer! It will never be as 
precise as a real TrueType renderer, as StrikeFont can't adjust kerning 
based on the shape of glyphs. But it is better than before.

If you see some glyph that could use further tweaking, please tell.

I also made digits from $0 to $9 to be monospaced. This is nice when 
looking at columns of numbers.

>
>>> Secondly, can the sub-pixel AA be disabled on the fly? It leads to 
>>> visible color fringes when the subpixel layout does not match your AA.
>>>
>>
>> Sure. See Preference #subPixelRenderFonts.
>
>
> Hmm, this does not show up in the Preferences panel ... also, when I 
> disable that, all pixels become full black, so this is unusable.

This is fixed too. BTW, if you're using gray AA and don't care about 
getting subpixelAA anymore, you can do
     StrikeFont allInstances do: [ :f | f setGlyphsDepthAtMost: 4].
This will make the fonts use 4 bpp, i.e. 8 gray levels. (In Squeak, 
Forms of 4bpp have 8 gray levels and 8 saturated colors). This is quite 
enough for gray AA. And it will save a lot of space.

I also fixed the other issues pending. The dual pass is done at BitBlt 
and not only GrafPort, and as no new ivars are added, WarpBlt works ok too.

Finally, the second BitBlt pass should not be needed for black text, but 
it is needed right now due to a bug in BitBlt. I expect the VMs to be 
fixed in a couple of months. Then, I can adjust the image code to avoid 
the second pass if possible.

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list