freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] RE: lack of a Unicode character map should not prevent the typef


From: Graham Asher
Subject: [Devel] RE: lack of a Unicode character map should not prevent the typeface from being loaded
Date: Sat, 14 Dec 2002 17:27:30 -0000

I said earlier today:

<<<<<<
In doing some more work to the GhostScript-to-FreeType bridge I have
discovered a small bug, probably a recent regression. The function open_face
in ftobjs.c should not fail if no Unicode character map is found. The fix is
simple:

Replace lines 833-842, which are

    /* select Unicode charmap by default */
    error2 = find_unicode_charmap( face );
    /* if no Unicode charmap can be found, return FT_Err_Invalid_Argument */

    /* no error should happen, but we want to play safe. */
    if ( error2 && error2 != FT_Err_Invalid_Argument )
    {
      error = error2;
      goto Fail;
    }

with this new version:

    /* select Unicode charmap by default */
    error2 = find_unicode_charmap( face );
    /* if no Unicode charmap can be found, FT_Err_Invalid_CharMap_Handle is
returned. */

    /* no error should happen, but we want to play safe. */
    if ( error2 && error2 != FT_Err_Invalid_CharMap_Handle )
    {
      error = error2;
      goto Fail;
    }
>>>>>>

I now realise that I was hasty in my fix. The inconsistency is in
find_unicode_charmap, which returns FT_Err_Invalid_Argument in one case and
FT_Err_Invalid_CharMap_Handle in another. Let's check for both error codes:

    /* select Unicode charmap by default */
    error2 = find_unicode_charmap( face );
    /* If no Unicode charmap can be found, FT_Err_Invalid_CharMap_Handle or
FT_Err_Invalid_Argument is returned. */

    /* No other error should happen, but we want to play safe. */
    if ( error2 && error2 != FT_Err_Invalid_CharMap_Handle && error2 !=
FT_Err_Invalid_Argument )
    {
      error = error2;
      goto Fail;
    }

Graham





reply via email to

[Prev in Thread] Current Thread [Next in Thread]