[gs-devel] text anti-aliasing threshold
Igor V. Melichev
igor.melichev at artifex.com
Wed Apr 9 08:40:02 PDT 2003
Regarding to Bug 686775 "Large text is not anti-aliased" :
The decision for applying the anti-aliasing is being made on
thresholds specified in gxchar.c ln 1365-1373 :
int sx =
(extent.x == 0 ? 0 :
any_abs(extent.x) < int2fixed(25) ? 2 :
any_abs(extent.x) < int2fixed(60) ? 1 :
int sy =
(extent.y == 0 ? 0 :
any_abs(extent.y) < int2fixed(25) ? 2 :
any_abs(extent.y) < int2fixed(60) ? 1 :
So if the X-extent of a character is smaller than 25 pixels,
2 alpha bits are reserved for X. If it is smaller than 60 pixels,
1 alpha bit is reserved for X. Otherwise no smoothing is applied by X.
Also same for Y, independently on X.
GS first creates an oversampled 1bpp raster,
then converts is to alpha with sx+sy bits per pixel,
by scaling it down.
Probably the thresholds are imperfect.
They can't be infinite due to RAM consumption.
4 alpha bits imply a 4 times bigger RAM consumed in
character cache. Adobe default cache size is 204800 bytes,
which correspond to about 2000 characters of 30x30 pixels size.
With 4 alpha bits it drops to 500 characters.
I'd like to hear suggestions how to set the thresholds better.
More information about the gs-devel