[MPlayer-dev-eng] [PATCH] small freetype and menu patch

Andreas Hess jaska at gmx.net
Wed Jan 29 23:44:55 CET 2003


Hi,

this small patch does two tihings:

1. Prefer freetype over the old font.desc format. If freetype initialization
   fails, it falls back to the old format.

2. Fixes a problem where the menu won't work, if you just use freetype fonts
   and have no font.desc.


Andreas
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.667
diff -u -r1.667 mplayer.c
--- mplayer.c	28 Jan 2003 00:59:15 -0000	1.667
+++ mplayer.c	29 Jan 2003 22:44:28 -0000
@@ -922,6 +922,9 @@
 
 #ifdef USE_OSD
 // check font
+#ifdef HAVE_FREETYPE
+  if(init_freetype() != 0) // freetype initialization successfull if init_freetype() returns 0
+#endif
   if(font_name){
        vo_font=read_font_desc(font_name,font_factor,verbose>1);
        if(!vo_font) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadFont,font_name);
@@ -931,10 +934,6 @@
        if(!vo_font)
        vo_font=read_font_desc(DATADIR"/font/font.desc",font_factor,verbose>1);
   }
-#ifdef HAVE_FREETYPE
-  if (!vo_font)
-	init_freetype();
-#endif
 #endif
   vo_init_osd();
 
Index: libmenu/menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmenu/menu.c,v
retrieving revision 1.7
diff -u -r1.7 menu.c
--- libmenu/menu.c	26 Jan 2003 16:02:58 -0000	1.7
+++ libmenu/menu.c	29 Jan 2003 22:44:31 -0000
@@ -117,8 +117,10 @@
   char* buffer = NULL;
   int bl = BUF_STEP, br = 0;
   int f, fd;
+#ifndef HAVE_FREETYPE
   if(vo_font == NULL)
     return 0;
+#endif
   fd = open(cfg_file, O_RDONLY);
   if(fd < 0) {
     printf("Can't open menu config file: %s\n",cfg_file);


More information about the MPlayer-dev-eng mailing list