[layout/buffer-message] Print feature name in lookup buffer messages

This commit is contained in:
Behdad Esfahbod 2022-11-26 13:14:23 -07:00
parent a5d35fd80a
commit 56e3868b52
3 changed files with 11 additions and 6 deletions

View File

@ -1913,7 +1913,7 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
auto &lookup = lookups[table_index][i];
unsigned int lookup_index = lookup.index;
if (!buffer->message (font, "start lookup %d", lookup_index)) continue;
if (!buffer->message (font, "start lookup %d feature %c%c%c%c", lookup_index, HB_UNTAG (lookup.feature_tag))) continue;
/* c.digest is a digest of all the current glyphs in the buffer
* (plus some past glyphs).
@ -1933,9 +1933,9 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
proxy.accels[lookup_index]);
}
else
(void) buffer->message (font, "skipped lookup %d because no glyph matches", lookup_index);
(void) buffer->message (font, "skipped lookup %d feature %c%c%c%c because no glyph matches", lookup_index, HB_UNTAG (lookup.feature_tag));
(void) buffer->message (font, "end lookup %d", lookup_index);
(void) buffer->message (font, "end lookup %d feature %c%c%c%c", lookup_index, HB_UNTAG (lookup.feature_tag));
}
if (stage->pause_func)

View File

@ -133,7 +133,8 @@ hb_ot_map_builder_t::add_lookups (hb_ot_map_t &m,
bool auto_zwnj,
bool auto_zwj,
bool random,
bool per_syllable)
bool per_syllable,
hb_tag_t feature_tag)
{
unsigned int lookup_indices[32];
unsigned int offset, len;
@ -162,6 +163,7 @@ hb_ot_map_builder_t::add_lookups (hb_ot_map_t &m,
lookup->auto_zwj = auto_zwj;
lookup->random = random;
lookup->per_syllable = per_syllable;
lookup->feature_tag = feature_tag;
}
offset += len;
@ -339,7 +341,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m,
feature.auto_zwnj,
feature.auto_zwj,
feature.random,
feature.per_syllable);
feature.per_syllable,
feature.tag);
}
/* Sort lookups and merge duplicates */

View File

@ -69,6 +69,7 @@ struct hb_ot_map_t
unsigned short random : 1;
unsigned short per_syllable : 1;
hb_mask_t mask;
hb_tag_t feature_tag;
HB_INTERNAL static int cmp (const void *pa, const void *pb)
{
@ -241,7 +242,8 @@ struct hb_ot_map_builder_t
bool auto_zwnj = true,
bool auto_zwj = true,
bool random = false,
bool per_syllable = false);
bool per_syllable = false,
hb_tag_t feature_tag = HB_TAG_NONE);
struct feature_info_t {
hb_tag_t tag;