Re: about FcFini

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

 



hey,

>> if i have understood correctly the code, it is possible to call several
>> time FcInit, but FcFini can be called only once. That's a problem when
>> several libraries use fontconfig (like poppler + qt)
>
> Hi,
>
> My understanding is that:
>
>  * Calling FcInit() is optional.  All fontconfig entry points check and 
> initialize the library if needed.
>
>  * FcFini() is designed to only be called by debugging code from 
> applications, not for normal use by other libraries.
>
>> Would it be possible to use a ref count for the initialisation /
>> finalization of fontconfig ?
>
> It would be feasible if FcInit() was mandatory.  But when it's optional, I'm 
> not sure how to define the semantics.  What will the implicit initialization 
> do?  Increase the ref count or not?

do something like that:

static int _fontconfig_init_count = 0;

int FcIni()
{
   if (!_fontconfig_init_count)
   {
     /* do what is needed during the first call of initialization */
   }

   return ++_fontconfig_init_count;
}

int FcFini()
{
   --_fontconfig_init_count;

   if (!_fontconfig_init_count)
   {
     /* do what is needed during finalization */
   }

   return _fontconfig_init_count;
}


regards

Vincent Torri
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux