I'd like to be able to know when Freetype will use a strike size for an FT_Face after the size has been specified. This will let me select monochrome rendering for any glyphs which don't happen to have bitmaps in the strike.
Right now, I've coded up a fairly ugly hack which attempts to guess when
Freetype will be using a strike:
/*
* Force non-AA drawing when using a bitmap strike that
* won't be resampled due to non-scaling transform
*/
if (!unscaled->have_shape &&
(scaled_font->ft_options.load_flags & FT_LOAD_NO_BITMAP) == 0 &&
scaled_font->ft_options.base.antialias != CAIRO_ANTIALIAS_NONE &&
(face->face_flags & FT_FACE_FLAG_FIXED_SIZES))
{
int i;
FT_Size_Metrics *size_metrics = &face->size->metrics;
for (i = 0; i < face->num_fixed_sizes; i++)
{
FT_Bitmap_Size *bitmap_size = &face->available_sizes[i];
if (bitmap_size->x_ppem == size_metrics->x_ppem * 64 &&
bitmap_size->y_ppem == size_metrics->y_ppem * 64)
{
scaled_font->ft_options.base.antialias = CAIRO_ANTIALIAS_NONE;
break;
}
}
}
I'd much rather just get the strike_index somehow and check for !=
0xffff. Would that be a reasonable API to add?
FT_UInt
FT_Get_Strike_Index (FT_Face face);
return -1 for not using any strike, otherwise the index into the
available_sizes array.
--
[EMAIL PROTECTED]
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Freetype-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freetype-devel
