[HarfBuzz] hb_ot_layout_lookup_collect_glyphs

Pedro Navarro pnavarro at netflix.com
Tue Oct 3 23:51:27 UTC 2017


Hi all,

I'm trying to use the hb_ot_layout_feature_lookups call in order to find
out which glyphs are being substituted if the font has the 'vert' feature.

After getting the indices for the language, script and feature I'm
successful in getting the table but it looks like the glyph indices are
being sorted in the hb_set_t the hb_ot_layout_feature_get_lookups returns.
I do get the right glyph indices in the input and output sets but they
don't match each other because, as they are sorted, the original position
they were in is lost. Am I doing anything wrong?

A simplified version of the code is:

hb_ot_layout_table_find_script(face, HB_OT_TAG_GSUB,
HB_TAG('k','a','n','a'), &scriptIndex);
hb_ot_layout_language_find_feature(face, HB_OT_TAG_GSUB,  scriptIndex, 0,
HB_TAG('v','e,'r','t'), &featureIndex);

hb_ot_layout_feature_get_lookups(face, HB_OT_TAG_GSUB, featureIndex,...);

hb_set_t* input = hb_set_create();
hb_set_t* output = hb_set_create();

hb_ot_layout_lookup_collect_glyphs(face, HB_OT_TAG_GSUB, 0, 0, input, 0,
output);

unsigned int pop = hb_set_get_population(input);
unsigned int p = 0;
hb_codepoint_t source = -1;
hb_codepoint_t target = -1;

while (p != population) {
   hb_set_next(input, &source);
   hb_set_next(output, &target);
   printf("%d=%d\n", source, target);
   ++p;
}

Thanks!
Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20171003/6c46860a/attachment-0001.html>


More information about the HarfBuzz mailing list