Commit d8d34fbe authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Freetype: move GetStyleFromStack to helper

parent b13e8ff1
......@@ -1245,26 +1245,6 @@ static inline int RenderAXYZ( filter_t *p_filter,
}
static text_style_t *GetStyleFromFontStack( filter_t *p_filter,
font_stack_t **p_fonts,
int i_style_flags )
{
char *psz_fontname = NULL;
uint32_t i_font_color = var_InheritInteger( p_filter, "freetype-color" );
i_font_color = VLC_CLIP( i_font_color, 0, 0xFFFFFF );
i_font_color = i_font_color & 0x00ffffff;
int i_font_size = p_filter->p_sys->style.i_font_size;
uint32_t i_karaoke_bg_color = i_font_color;
if( PeekFont( p_fonts, &psz_fontname, &i_font_size,
&i_font_color, &i_karaoke_bg_color ) )
return NULL;
return CreateStyle( psz_fontname, i_font_size, i_font_color,
i_karaoke_bg_color,
i_style_flags );
}
static int ProcessNodes( filter_t *p_filter,
uni_char_t *psz_text,
......@@ -1365,6 +1345,7 @@ static int ProcessNodes( filter_t *p_filter,
"\n",
GetStyleFromFontStack( p_filter,
&p_fonts,
&p_sys->style,
i_style_flags ),
i_k_date );
}
......@@ -1396,6 +1377,7 @@ static int ProcessNodes( filter_t *p_filter,
psz_node,
GetStyleFromFontStack( p_filter,
&p_fonts,
&p_sys->style,
i_style_flags ),
i_k_date );
free( psz_node );
......
......@@ -501,4 +501,26 @@ bool FaceStyleEquals( const text_style_t *p_style1,
!strcmp( p_style1->psz_fontname, p_style2->psz_fontname );
}
text_style_t *GetStyleFromFontStack( filter_t *p_filter,
font_stack_t **p_fonts,
text_style_t *style,
int i_style_flags )
{
char *psz_fontname = NULL;
uint32_t i_font_color = var_InheritInteger( p_filter, "freetype-color" );
i_font_color = VLC_CLIP( i_font_color, 0, 0xFFFFFF );
i_font_color = i_font_color & 0x00ffffff;
int i_font_size = style->i_font_size;
uint32_t i_karaoke_bg_color = i_font_color;
if( PeekFont( p_fonts, &psz_fontname, &i_font_size,
&i_font_color, &i_karaoke_bg_color ) )
return NULL;
return CreateStyle( psz_fontname, i_font_size, i_font_color,
i_karaoke_bg_color,
i_style_flags );
}
......@@ -60,6 +60,11 @@ text_style_t *CreateStyle( char *psz_fontname, int i_font_size,
uint32_t i_font_color, uint32_t i_karaoke_bg_color,
int i_style_flags );
text_style_t *GetStyleFromFontStack( filter_t *p_filter,
font_stack_t **p_fonts,
text_style_t *style,
int i_style_flags );
#ifdef __OS2__
typedef uint16_t uni_char_t;
# define FREETYPE_TO_UCS "UCS-2LE"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment