In freetype/src/bdf/bdflib.c I see:
/* Check that the encoding is in the range [0,65536]
because */
/* otherwise p->have (a bitmap with static size)
overflows. */
if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 8 )
{
error = BDF_Err_Invalid_File_Format;
goto Exit;
}
Which seems to prevent a BDF containing chars with ENCODING values >
65536 from being opened. I have some BDF data which includes such
characters, and would like to enable FreeType to use them.
Seeing as how the comment above indicates a relationship with p-
>have, it seems unwise to simply increase the cutoff for the test
(i.e. change "* 8" to something larger). So I'm wondering, if one
were desirous of modifying bdflib.c (and whatever other dependencies
necessary), what is the best approach?
My perhaps naïve idea is to change the above to:
if ( (size_t)p->glyph_enc >= sizeof ( p->have ) * 136 )
And as well modify 'have' of the _bdf_parse_t structure as:
unsigned long have[34816]; /* was: have[2048] */
But I don't know what the larger implications of doing this are, or
if there's a more clever and/or sensible way to accomplish the goal
of having FreeType successfully read a BDF containing chars with
ENCODING > 65536.
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype