fontfeature patch

This commit is contained in:
ant 2025-01-04 21:59:53 +01:00
parent b77fb11b76
commit 4397a1814f
4 changed files with 34 additions and 9 deletions

13
hb.c
View file

@ -35,13 +35,6 @@ typedef struct {
static RuneBuffer hbrunebuffer = { 0, NULL };
static hb_buffer_t *hbbuffer;
/*
* Poplulate the array with a list of font features, wrapped in FEATURE macro,
* e. g.
* FEATURE('c', 'a', 'l', 't'), FEATURE('d', 'l', 'i', 'g')
*/
hb_feature_t features[] = { };
void
hbcreatebuffer(void)
{
@ -125,7 +118,11 @@ hbtransform(HbTransformData *data, XftFont *xfont, const Glyph *glyphs, int star
hb_buffer_add_codepoints(buffer, hbrunebuffer.runes, length, 0, length);
/* Shape the segment. */
hb_shape(font, buffer, features, sizeof(features)/sizeof(hb_feature_t));
#if FONTFEATURES_PATCH
hb_shape(font, buffer, data->features, data->features_count);
#else
hb_shape(font, buffer, NULL, 0);
#endif
/* Get new glyph info. */
hb_glyph_info_t *info = hb_buffer_get_glyph_infos(buffer, &glyph_count);