freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] Re: [FYI] Re: Getting pathname from FT_Face (patch for future


From: mpsuzuki
Subject: [ft-devel] Re: [FYI] Re: Getting pathname from FT_Face (patch for future discussion)
Date: Mon, 15 Mar 2010 21:36:57 +0900

Werner,

Now I'm reworking my patch to provide a single generic
interface like this:

  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    FT_Object_Get_Property()                                           */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Get a named property from FreeType2 object.                        */
  /*                                                                       */
  /* <Input>                                                               */
  /*    library       :: A handle to the FreeType library instance this    */
  /*                     object belongs to.                                */
  /*                                                                       */
  /*    object        :: A generic pointer to the object.                  */
  /*                                                                       */
  /*    object_type   :: A string to inform data type of the object.       */
  /*                     Currently "FT_Stream" & "FT_Face" are supported.  */
  /*                                                                       */
  /*    property_name :: A string to request the named property.           */
  /*                     Currently "pathname" & "buffer.allocator" are     */
  /*                     supported.                                        */
  /*                                                                       */
  /* <Output>                                                              */
  /*    property      :: A generic pointer to the property.                */
  /*                                                                       */
  /*    property_type :: A string to inform data type of the property.     */
  /*                     Currently "FT_Bytes" is returned always.          */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FT_Error.                                                          */
  /*                                                                       */
  /* <Since>                                                               */
  /*    2.3.13                                                             */
  /*                                                                       */
  FT_EXPORT( FT_Error )      
  FT_Object_Get_Property( FT_Library    library,
                          FT_Pointer    object,
                          const char*   object_type,
                          const char*   property_name,
                          FT_Pointer*   property,
                          const char**  property_type );

On Mon, 15 Mar 2010 13:12:56 +0100 (CET)
Werner LEMBERG <address@hidden> wrote:
>> Here is the result by Linux/i386 gcc-4.4.2.
>> My patch increases the code size about 1% - 2%.
>
>This is more than I have expected.

Umm. The inspection of FT_Stream object in my patch is done
by the comparisons of private function pointers to read &
close the stream, for both of reversal pathname lookup and
memory allocator identification. This is simple work. But
the comparison is encapsuled to each modules, and base module
invokes the comparators by the service in each stream drivers.

To reduce the code size, I have another idea. If FT2 has a
table of selected private function pointers & their symbolic
names, and a function looking up the symbolic names by the
pointers (something like a reversal dlsym()), the inspecition
process would be realized in smaller code size. How do you think?

>> I think enable-by-default won't blow out most systems using
>> FreeType2 under default config.
>
>OK.  However, it would be nice if it is surrounded by
>FT_CONFIG_... macros anyway so that it can be disabled if necessary.

Of course, I will do so.




reply via email to

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