From 56e3868b52ef6e85d6495d28bae57dcc5746d1db Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 26 Nov 2022 13:14:23 -0700 Subject: [PATCH] [layout/buffer-message] Print feature name in lookup buffer messages --- src/hb-ot-layout.cc | 6 +++--- src/hb-ot-map.cc | 7 +++++-- src/hb-ot-map.hh | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 2bdb5e1c7..1ee23f0ce 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -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) diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 3c6688f5c..028f31c8d 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -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 */ diff --git a/src/hb-ot-map.hh b/src/hb-ot-map.hh index 53cf16fd4..5122c4e56 100644 --- a/src/hb-ot-map.hh +++ b/src/hb-ot-map.hh @@ -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;