int T1_AASetLevel( int level)
level
should be either T1_AA_LOW
(T1_AA_HIGH
(T1_errno
is
set appropriately. This function is to be called after initialization. The
default value after initialization is T1_AA_LOW
. The current value can
also be queried by issuing a call to
int T1_AAGetLevel( void)
There is one more value that may be specified for level
, namely
T1_AA_NONE
. T1_AA_NONE
is identical to 1 which means that no
subsampling at all is done. But the resulting glyph, having only fore- and
background colors is returned as a bytemap instead of as a bitmap. This is
intended for situtations where an antialiased glyph should be concatenated
with a (possibly large) non-antialiased glyph using the function
T1_ConcatGlyphs()
. In that case, the depths of the two glyphs have to
be identical. There is probably not much more sense in setting level
to
T1_AA_NONE
.
As described before, the result of the T1_AASet..()
functions is
strictly spoken no longer a
bitmap since more than one bit is used to
represent one pixel. The function
int T1_AASetBitsPerPixel( int bpp)
bpp
are 8, 16, 24 and 32. However, if 24 is
specified, internally 32 will be used since the pixel are then addressed as
objects of type long
. Antialiased glyphs may grow quite large,
especially when
using bpp
= 32. The value of bpp
is written into the member
bpp
of the glyph
-structure (see
int T1_AAGetBitsPerPixel( void)
In order to make the handling of antialiased glyphs as flexible as possible, the values to be written into the pixels for different gray values may (and must) be explicitly specified. For low level antialiasing this is done by calling the function
int T1_AASetGrayValues( unsigned long white, unsigned long gray75, unsigned long gray50, unsigned long gray25, unsigned long black)
bpp
values only the lower bits are used. For high level
antialiasing this kind of graylevel specification is not economical since 17
arguments
would have to be specified. Instead, another function is used which expects a
pointer an array of unsigned long
's:
int T1_AAHSetGrayValues( unsigned long *grayvals)
grayvals
points to must contain 17 entries. Element 0 is
expected to specify the background color's pixel value and element 16
represents the foreground color. Calling one of these two functions involves
also a new setup of the lookup tables. It should thus only be done if some
color value really has changed.
In case the antialiasing level is set to T1_AA_NONE
as described
above, the function
int T1_AANSetGrayValues( unsigned long bg, unsigned long fg)
Each of the three graylevel sets described above can also be queried by the user. This is done using one of the functions
int T1_AAGetGrayValues( long *pgrayvals)
int T1_AAHGetGrayValues( long *pgrayvals)
int T1_AANGetGrayValues( long *pgrayvals)
pgrayvals
is the start address of an array of long
-values
to which the respective grayvalues are written. This memory must thus be
supplied by the user. These functions will write 5
(T1_AAGetGrayValues
), 17 (T1_AAHGetGrayValues
) and 2
(T1_AANGetGrayValues
) respectively to the location given by
pgrayvals
. These functions are to be called after initialization. If
something goes wrong -1 is returned and T1_errno
will be set
accordingly. Otherwise 0 is returned.