* Fix win32 text renderer.
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 7 Feb 2006 16:07:58 +0000 (16:07 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 7 Feb 2006 16:07:58 +0000 (16:07 +0000)
modules/misc/win32text.c

index a51dc03..983c603 100644 (file)
@@ -314,13 +314,18 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
 #endif
     if( !psz_string || !*psz_string ) return VLC_EGENERIC;
 
-    i_font_color = __MAX( __MIN( p_region_in->i_text_color, 0xFFFFFF ), 0 );
-    if( i_font_color == 0xFFFFFF ) i_font_color = p_sys->i_font_color;
-
-    i_font_alpha = __MAX( __MIN( p_region_in->i_text_alpha, 255 ), 0 );
-    if( !i_font_alpha ) i_font_alpha = 255 - p_sys->i_font_opacity;
-
-    i_font_size  = __MAX( __MIN( p_region_in->i_text_size, 255 ), 0 );
+    if( p_region_in->p_style )
+    {
+        i_font_color = __MAX( __MIN( p_region_in->p_style->i_font_color, 0xFFFFFF ), 0 );
+        i_font_alpha = __MAX( __MIN( p_region_in->p_style->i_font_alpha, 255 ), 0 );
+        i_font_size  = __MAX( __MIN( p_region_in->p_style->i_font_size, 255 ), 0 );
+    }
+    else
+    {
+        i_font_color = p_sys->i_font_color;
+        i_font_alpha = 255 - p_sys->i_font_opacity;
+        i_font_size = p_sys->i_default_fontsize;
+    }
 
     SetFont( p_filter, i_font_size );