Guest User

Untitled

a guest
May 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
  2. index 6ac4534..07a350f 100644
  3. --- a/modules/misc/freetype.c
  4. +++ b/modules/misc/freetype.c
  5. @@ -351,45 +351,27 @@ static int Create( vlc_object_t *p_this )
  6. if( asprintf( &psz_fontsize, "%d", p_sys->i_default_font_size ) == -1 )
  7. goto error;
  8.  
  9. + msg_Dbg( p_filter, "Building font databases.");
  10. + mtime_t t1, t2;
  11. + t1 = mdate();
  12. +
  13. #ifdef WIN32
  14. dialog_progress_bar_t *p_dialog = NULL;
  15. -
  16. - if( !FcConfigUptoDate( NULL ) )
  17. - {
  18. - p_dialog = dialog_ProgressCreate( p_filter,
  19. + FcConfig *fcConfig = FcInitLoadConfig();
  20. +
  21. + p_dialog = dialog_ProgressCreate( p_filter,
  22. _("Building font cache"),
  23. _("Please wait while your font cache is rebuilt.\n"
  24. "This should take less than a few minutes."), NULL );
  25. - }
  26. - char *path = xmalloc( PATH_MAX + 1 );
  27. - /* Fontconfig doesnt seem to know where windows fonts are with
  28. - * current contribs. So just tell default windows font directory
  29. - * is the place to search fonts
  30. - */
  31. - GetWindowsDirectory( path, PATH_MAX + 1 );
  32. - strcat( path, "\\fonts" );
  33. - if( p_dialog )
  34. - dialog_ProgressSet( p_dialog, NULL, 0.4 );
  35. -
  36. - FcConfigAppFontAddDir( NULL , path );
  37. - free(path);
  38. -
  39.  
  40. if( p_dialog )
  41. dialog_ProgressSet( p_dialog, NULL, 0.5 );
  42. -#endif
  43. - mtime_t t1, t2;
  44. -
  45. - msg_Dbg( p_filter, "Building font database.");
  46. - t1 = mdate();
  47. - FcConfigBuildFonts( NULL );
  48. +#endif
  49. + FcConfigBuildFonts( fcConfig );
  50. t2 = mdate();
  51. -
  52. - msg_Dbg( p_filter, "Finished building font database." );
  53. msg_Dbg( p_filter, "Took %ld microseconds", (long)((t2 - t1)) );
  54.  
  55. fontpattern = FcPatternCreate();
  56. -
  57. if( !fontpattern )
  58. {
  59. msg_Err( p_filter, "Creating fontpattern failed");
Advertisement
Add Comment
Please, Sign In to add comment