[vlc-commits] freetype: support kerning

Naohiro KORIYAMA git at videolan.org
Thu Aug 14 10:45:12 CEST 2014


vlc | branch: master | Naohiro KORIYAMA <nkoriyama at gmail.com> | Sun Jun 24 02:56:58 2012 +0900| [e87ff0f39dae4b325f3f60b23ee1756137f73c99] | committer: Francois Cartegnie

freetype: support kerning

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e87ff0f39dae4b325f3f60b23ee1756137f73c99
---

 modules/text_renderer/freetype.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index 50056e7..e562afc 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1370,7 +1370,13 @@ static int ProcessLines( filter_t *p_filter,
                 /* Get kerning vector */
                 FT_Vector kerning = { .x = 0, .y = 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 );
+                }
+                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 */
                 FT_Vector pen_new = {
@@ -1695,6 +1701,7 @@ static int RenderCommon( filter_t *p_filter, subpicture_region_t *p_region_out,
     {
         text_style_t *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_sys->style.psz_fontname,
                                    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,
                                                                           STYLE_UNDERLINE |
                                                                           STYLE_STRIKEOUT |
                                                                           STYLE_HALFWIDTH) );
+            p_style->i_spacing = p_region_in->p_style->i_spacing;
+        }
         else
         {
             uint32_t i_font_color = var_InheritInteger( p_filter, "freetype-color" );



More information about the vlc-commits mailing list