[base] Complete ft_glyphslot_clear.

* src/base/ftobjs.c (ft_glyphslot_clear): This function is intended
to reset all the values of a glyph slot.  However, it was not
resetting the values of the advances and `glyph_index`.  Reset the
advances and `glyph_index` to zero.
This commit is contained in:
Ben Wagner 2021-04-01 09:44:00 -04:00 committed by Werner Lemberg
parent 52f2a008f1
commit f9350be1e4
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2021-04-02 Ben Wagner <bungeman@chromium.org>
[base] Complete `ft_glyphslot_clear`.
* src/base/ftobjs.c (ft_glyphslot_clear): This function is intended
to reset all the values of a glyph slot. However, it was not
resetting the values of the advances and `glyph_index`. Reset the
advances and `glyph_index` to zero.
2021-04-02 Ben Wagner <bungeman@chromium.org>
[truetype] Prevent glyph program state from persisting.

View File

@ -539,6 +539,8 @@
ft_glyphslot_free_bitmap( slot );
/* clear all public fields in the glyph slot */
slot->glyph_index = 0;
FT_ZERO( &slot->metrics );
FT_ZERO( &slot->outline );
@ -559,6 +561,8 @@
slot->linearHoriAdvance = 0;
slot->linearVertAdvance = 0;
slot->advance.x = 0;
slot->advance.y = 0;
slot->lsb_delta = 0;
slot->rsb_delta = 0;
}