Skip to content

Commit

Permalink
text_renderer: use fontname in text_style_t
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Cartegnie <[email protected]>
  • Loading branch information
nkoriyama authored and fcartegnie committed Aug 14, 2014
1 parent e87ff0f commit b48567c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/text_renderer/quartztext.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,10 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
{
filter_sys_t *p_sys = p_filter->p_sys;
char *psz_string;
char *psz_fontname;
int i_font_size;
int i_spacing = 0;
int i_font_alpha;
uint32_t i_font_color;
bool b_bold, b_uline, b_italic, b_halfwidth;
vlc_value_t val;
Expand All @@ -338,6 +340,8 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
return VLC_EGENERIC;

if (p_region_in->p_style) {
psz_fontname = p_region_in->p_style->psz_fontname ?
p_region_in->p_style->psz_fontname : p_sys->psz_font_name;
i_font_color = VLC_CLIP(p_region_in->p_style->i_font_color, 0, 0xFFFFFF);
i_font_size = VLC_CLIP(p_region_in->p_style->i_font_size, 0, 255);
if (p_region_in->p_style->i_style_flags) {
Expand All @@ -352,6 +356,7 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
}
i_spacing = VLC_CLIP(p_region_in->p_style->i_spacing, 0, 255);
} else {
psz_fontname = p_sys->psz_font_name;
i_font_color = p_sys->i_font_color;
i_font_size = p_sys->i_font_size;
}
Expand Down Expand Up @@ -379,7 +384,7 @@ static int RenderText(filter_t *p_filter, subpicture_region_t *p_region_out,
CFRelease(p_cfString);
len = CFAttributedStringGetLength(p_attrString);

setFontAttibutes(p_sys->psz_font_name, i_font_size, i_font_color, b_bold, b_italic, b_uline, b_halfwidth,
setFontAttibutes(psz_fontname, i_font_size, i_font_color, b_bold, b_italic, b_uline, b_halfwidth,
i_spacing,
CFRangeMake(0, len), p_attrString);

Expand Down

0 comments on commit b48567c

Please sign in to comment.