Skip to content

Commit

Permalink
text_renderer: freetype: fix skipped ruby ending lines
Browse files Browse the repository at this point in the history
  • Loading branch information
fcartegnie committed Feb 19, 2018
1 parent 074f326 commit 4258b77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/text_renderer/freetype/text_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,8 @@ static int LayoutParagraph( filter_t *p_filter, paragraph_t *p_paragraph,
const ruby_block_t *p_rubyseq = p_paragraph->pp_ruby[i];
int i_advance = 0;
int i_advanceruby = p_rubyseq->p_laid->i_width;
while( i < p_paragraph->i_size && p_rubyseq == p_paragraph->pp_ruby[i] )
while( i + 1 < p_paragraph->i_size &&
p_rubyseq == p_paragraph->pp_ruby[i + 1] )
i_advance += p_paragraph->p_glyph_bitmaps[ i++ ].i_x_advance;
/* Just forward as non breakable */
i_width += (i_advance < i_advanceruby) ? i_advanceruby : i_advance;
Expand Down

0 comments on commit 4258b77

Please sign in to comment.