- vlc_mutex_init( p_filter, &p_sys->fontconfig_lock );
- p_sys->b_fontconfig_ok = VLC_FALSE;
-
- p_sys->p_fontconfig = FcInitLoadConfig();
-
- if( p_sys->p_fontconfig )
- {
- /* Normally this doesn't take very long, but an initial build of
- * the fontconfig database or the addition of a lot of new fonts
- * can cause it to take several minutes for a large number of fonts.
- * Even a small number can take several seconds - much longer than
- * we can afford to block, so we build the list in the background
- * and if it succeeds we allow fontconfig to be used.
- */
- if( vlc_thread_create( p_filter, "fontlist builder", FontBuilder,
- VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) )
- {
- /* Don't destroy the fontconfig object - we won't be able to do
- * italics or bold or change the font face, but we will still
- * be able to do underline and change the font size.
- */
- msg_Warn( p_filter, "fontconfig database builder thread can't "
- "be launched. Font styling support will be limited." );
- };
- }
- else
- {
- msg_Warn( p_filter, "Couldn't initialise Fontconfig. "
- "Font styling won't be available." );
- }
+ p_sys->b_fontconfig_ok = false;
+ p_sys->p_fontconfig = NULL;
+ p_sys->p_fontbuilder = FontBuilderAttach( p_filter, &p_sys->p_fontconfig_lock );