freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] controlling FreeType modules


From: Werner LEMBERG
Subject: Re: [ft-devel] controlling FreeType modules
Date: Wed, 22 Aug 2012 10:47:15 +0200 (CEST)

>> FreeType.  If there is ever a need to pass a new string to the
>> library (for which I currently don't have a use case), the data
>> will be copied.
>
> Wait .... how does that work?
>
> That suggests that freetype will copy any structure passed in into
> malloced memory or something; otherwise, one couldn't pass in any
> dynamically calculated values.

Yes.

> But since (AFAICT) the property mechanism is generic, the type of
> the data structure wouldn't be known except to the eventual caller
> of FT_Property_Get.  Given this, how can FT_Property_Set know the
> size of the data structure passed in, to malloc/copy it?

The property mechanism has a generic interface to accept any data
structures so that it stays extensible, but the data structures
themselves aren't generic; they are always controlled by FreeType.
For example, to pass a string of arbitrary length, a possible
structure might be

  struct  foo
  {
    int    len;
    char*  str;
  }


    Werner



reply via email to

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