[MPlayer-cvslog] r38600 - trunk/gui/interface.c

ib subversion at mplayerhq.hu
Thu Jun 20 13:16:32 EEST 2024


Author: ib
Date: Thu Jun 20 13:16:32 2024
New Revision: 38600

Log:
Fix loading of bitmap fonts from the GUI preferences dialog.

It most likely never worked.

Modified:
   trunk/gui/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Thu Jun 20 13:14:51 2024	(r38599)
+++ trunk/gui/interface.c	Thu Jun 20 13:16:32 2024	(r38600)
@@ -1299,20 +1299,26 @@ void mplayer(int what, float value, void
         force_load_font = 1;
 #else
         if (font_name) {
-            vo_font = read_font_desc(font_name, font_factor, 0);
+            if (sub_font != vo_font) {
+                free(sub_font->fpath);
+                free(sub_font->name);
+                free(sub_font);
+            }
 
-            if (!vo_font)
-                gmp_msg(MSGT_GPLAYER, MSGL_ERR, _(MSGTR_GUI_CantLoadFont), font_name);
-        } else {
-            char *fname = get_path("font/font.desc");
+            if (vo_font) {
+                free(vo_font->fpath);
+                free(vo_font->name);
+                free(vo_font);
+            }
 
-            setdup(&font_name, fname);
-            free(fname);
-            vo_font = read_font_desc(font_name, font_factor, 0);
+            sub_font = vo_font = read_font_desc(font_name, font_factor, 0);
 
             if (!vo_font) {
-                setdup(&font_name, MPLAYER_DATADIR "/font/font.desc");
-                vo_font = read_font_desc(font_name, font_factor, 0);
+                gchar *msg;
+
+                msg = g_strdup_printf(_(MSGTR_GUI_CantLoadFont), font_name);
+                gtkMessageBox(MSGBOX_ERROR, msg);
+                g_free(msg);
             }
         }
 #endif


More information about the MPlayer-cvslog mailing list