* src/smooth/ftsmooth.c (ft_smooth_render_bgra): Restore contours.

This commit is contained in:
Alexei Podtelezhnikov 2018-12-18 22:40:04 -05:00
parent 953b3682b6
commit 1728230b6d
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2018-12-18 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/smooth/ftsmooth.c (ft_smooth_render_bgra): Restore contours.
2018-12-11 Alexei Podtelezhnikov <apodtele@gmail.com> 2018-12-11 Alexei Podtelezhnikov <apodtele@gmail.com>
Color glyph framework and rendering (3/3). Color glyph framework and rendering (3/3).

View File

@ -432,7 +432,7 @@
FT_Outline outline = slot->outline; /* hard copy */ FT_Outline outline = slot->outline; /* hard copy */
FT_Bitmap target; FT_Bitmap target;
FT_Vector target_offset, offset; FT_Vector target_offset, offset;
short i, c_done, p_done; short i, j, c_done, p_done;
/* check glyph image format */ /* check glyph image format */
@ -471,7 +471,8 @@
slot->outline.n_points = outline.contours[i] - p_done + 1; slot->outline.n_points = outline.contours[i] - p_done + 1;
slot->outline.contours[i - c_done] = outline.contours[i] - p_done; slot->outline.contours[i - c_done] = outline.contours[i] - p_done;
if ( i == outline.n_contours - 1 || /* layer ends when color changes */
if ( i == outline.n_contours - 1 ||
slot->color[i + 1].red != slot->color[c_done].red || slot->color[i + 1].red != slot->color[c_done].red ||
slot->color[i + 1].green != slot->color[c_done].green || slot->color[i + 1].green != slot->color[c_done].green ||
slot->color[i + 1].blue != slot->color[c_done].blue || slot->color[i + 1].blue != slot->color[c_done].blue ||
@ -498,6 +499,10 @@
if ( error ) if ( error )
break; break;
/* restore contours */
for ( j = 0; j < slot->outline.n_contours; j++ )
slot->outline.contours[j] += p_done;
c_done += slot->outline.n_contours; c_done += slot->outline.n_contours;
p_done += slot->outline.n_points; p_done += slot->outline.n_points;