Skip to content

Commit

Permalink
Pass kerning setting through into harfbuzz shaping
Browse files Browse the repository at this point in the history
  • Loading branch information
Starbuck5 authored and slouken committed Feb 29, 2024
1 parent 7766ae9 commit b8ba042
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,14 @@ static int TTF_Size_Internal(TTF_Font *font,

/* Layout the text */
hb_buffer_add_utf8(hb_buffer, text, -1, 0, -1);
hb_shape(font->hb_font, hb_buffer, NULL, 0);

hb_feature_t userfeatures[1];
userfeatures[0].tag = HB_TAG('k','e','r','n');
userfeatures[0].value = font->use_kerning;
userfeatures[0].start = HB_FEATURE_GLOBAL_START;
userfeatures[0].end = HB_FEATURE_GLOBAL_END;

hb_shape(font->hb_font, hb_buffer, userfeatures, 1);

/* Get the result */
hb_glyph_info = hb_buffer_get_glyph_infos(hb_buffer, &glyph_count);
Expand Down

0 comments on commit b8ba042

Please sign in to comment.