Commit e87ff0f3 authored by Naohiro KORIYAMA's avatar Naohiro KORIYAMA Committed by Francois Cartegnie

freetype: support kerning

Signed-off-by: default avatarFrancois Cartegnie <fcvlcdev@free.fr>
parent d40dd9f0
...@@ -1370,7 +1370,13 @@ static int ProcessLines( filter_t *p_filter, ...@@ -1370,7 +1370,13 @@ static int ProcessLines( filter_t *p_filter,
/* Get kerning vector */ /* Get kerning vector */
FT_Vector kerning = { .x = 0, .y = 0 }; FT_Vector kerning = { .x = 0, .y = 0 };
if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && i_glyph_index != 0 ) if( FT_HAS_KERNING( p_current_face ) && i_glyph_last != 0 && i_glyph_index != 0 )
{
FT_Get_Kerning( p_current_face, i_glyph_last, i_glyph_index, ft_kerning_default, &kerning ); FT_Get_Kerning( p_current_face, i_glyph_last, i_glyph_index, ft_kerning_default, &kerning );
}
if( p_glyph_style->i_spacing > 0 && i_glyph_last != 0 && i_glyph_index != 0 )
{
kerning.x = (p_glyph_style->i_spacing) << 6;
}
/* Get the glyph bitmap and its bounding box and all the associated properties */ /* Get the glyph bitmap and its bounding box and all the associated properties */
FT_Vector pen_new = { FT_Vector pen_new = {
...@@ -1695,6 +1701,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -1695,6 +1701,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
{ {
text_style_t *p_style; text_style_t *p_style;
if( p_region_in->p_style ) if( p_region_in->p_style )
{
p_style = CreateStyle( p_region_in->p_style->psz_fontname ? p_region_in->p_style->psz_fontname p_style = CreateStyle( p_region_in->p_style->psz_fontname ? p_region_in->p_style->psz_fontname
: p_sys->style.psz_fontname, : p_sys->style.psz_fontname,
p_region_in->p_style->i_font_size > 0 ? p_region_in->p_style->i_font_size p_region_in->p_style->i_font_size > 0 ? p_region_in->p_style->i_font_size
...@@ -1707,6 +1714,8 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -1707,6 +1714,8 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
STYLE_UNDERLINE | STYLE_UNDERLINE |
STYLE_STRIKEOUT | STYLE_STRIKEOUT |
STYLE_HALFWIDTH) ); STYLE_HALFWIDTH) );
p_style->i_spacing = p_region_in->p_style->i_spacing;
}
else else
{ {
uint32_t i_font_color = var_InheritInteger( p_filter, "freetype-color" ); uint32_t i_font_color = var_InheritInteger( p_filter, "freetype-color" );
......
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