freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] ftvalid


From: Masatake YAMATO
Subject: Re: [ft-devel] ftvalid
Date: Fri, 23 Jun 2006 13:58:03 +0900 (JST)

This small issue is not so small as I expected.

> I think, although policy A is theoretically right, I prefer
> policy B. Because, it is easy for LD_PRELOAD trick to rewrite
> disabled FT_Get_WinFNT_Header() to working one, but it is
> difficult to rewrite FT_Get_Module() with disabled WinFNT.
> Yet I've not made such demos, it's just conceive.
I prefer the policy B, too. However, here is some discussion.

I guess your LD_PRELOAD will not be effective on applications.  Maybe
the application will call FT_Get_Module by itself before calling
FT_TrueTypeGX_Validate as ftvalid does; and if FT_Get_Module returns
NULL, the applicaiton does exit(2) or runs but never calls
FT_TrueTypeGX_Validate. About validator I guess the application 
may want to check a module existence before calling the module 
function. 

Assume an application wants to call FT_Get_Module to check
a module existence. The applicatoin must know the name of module:
In my last patch, "gxvalid" is the name an application must know.

    --- ftgxval.c       16  6月 2006 04:42:51 +0900      1.4
    +++ ftgxval.c       22  6月 2006 13:23:26 +0900      
    @@ -61,8 +61,10 @@
                                      validation_flags,
                                      tables,
                                      table_length );
    -    else
    +    else if ( FT_Get_Module( FT_FACE_LIBRARY( face ), "gxvalid" ) == NULL )
           error = FT_Err_Unimplemented_Feature;
    +    else
    +      error = FT_Err_Invalid_Argument;

       Exit:
         return error;

I think it is better to use FT_VALIDATE_TRUETYPEGX_MODULE_NAME instead
of "gxvalid" in the application and define
FT_VALIDATE_TRUETYPEGX_MODULE_NAME in freetype2's header. Currently,
the module name is defined in build-system related file, not in
*.[ch].

Masatake




reply via email to

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