X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmisc%2Ffreetype.c;h=6ac45345d55e9f0ebabea3ae93849f29fe90efb3;hb=9e3623e0823bd21daa1833822b2e38a307204ff5;hp=eecf37351213772513af0fca3a9d7241ee5bf54e;hpb=a99b43de32abc4aa1d9cf9e046b6ba6753dd2fc1;p=vlc diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c index eecf373512..6ac45345d5 100644 --- a/modules/misc/freetype.c +++ b/modules/misc/freetype.c @@ -114,7 +114,7 @@ static void Destroy( vlc_object_t * ); #define FONTSIZER_TEXT N_("Relative font size") #define FONTSIZER_LONGTEXT N_("This is the relative default size of the " \ "fonts that will be rendered on the video. If absolute font size is set, "\ - "relative size will be overriden." ) + "relative size will be overridden." ) static const int pi_sizes[] = { 20, 18, 16, 12, 6 }; static const char *const ppsz_sizes_text[] = { @@ -352,10 +352,15 @@ static int Create( vlc_object_t *p_this ) goto error; #ifdef WIN32 - dialog_progress_bar_t *p_dialog = dialog_ProgressCreate( p_filter, + dialog_progress_bar_t *p_dialog = NULL; + + if( !FcConfigUptoDate( NULL ) ) + { + p_dialog = dialog_ProgressCreate( p_filter, _("Building font cache"), _("Please wait while your font cache is rebuilt.\n" - "This should take less than few minutes."), NULL ); + "This should take less than a few minutes."), NULL ); + } char *path = xmalloc( PATH_MAX + 1 ); /* Fontconfig doesnt seem to know where windows fonts are with * current contribs. So just tell default windows font directory @@ -436,6 +441,7 @@ static int Create( vlc_object_t *p_this ) { dialog_ProgressSet( p_dialog, NULL, 1.0 ); dialog_ProgressDestroy( p_dialog ); + p_dialog = NULL; } # endif @@ -505,6 +511,12 @@ error: if( fontmatch ) FcPatternDestroy( fontmatch ); if( fontpattern ) FcPatternDestroy( fontpattern ); #endif + +#ifdef WIN32 + if( p_dialog ) + dialog_ProgressDestroy( p_dialog ); +#endif + if( p_sys->p_face ) FT_Done_Face( p_sys->p_face ); if( p_sys->p_library ) FT_Done_FreeType( p_sys->p_library ); free( psz_fontfamily );