Debian Codegraph @

texk/web2c/mfluadir/otfcc/lib/consolidate/otl/gsub-ligature.c

raw
1 #include "gsub-ligature.h"
2
3 bool consolidate_gsub_ligature(otfcc_Font *font, table_OTL *table, otl_Subtable *_subtable,
4 const otfcc_Options *options) {
5 subtable_gsub_ligature *subtable = &(_subtable->gsub_ligature);
6 subtable_gsub_ligature nt;
7 iSubtable_gsub_ligature.init(&nt);
8 for (glyphid_t k = 0; k < subtable->length; k++) {
9 if (!GlyphOrder.consolidateHandle(font->glyph_order, &subtable->items[k].to)) {
10 logWarning("[Consolidate] Ignored missing glyph /%s.\n", subtable->items[k].to.name);
11 continue;
12 }
13 fontop_consolidateCoverage(font, subtable->items[k].from, options);
14 Coverage.shrink(subtable->items[k].from, false);
15 if (!subtable->items[k].from->numGlyphs) {
16 logWarning("[Consolidate] Ignoring empty ligature substitution to "
17 "glyph /%s.\n",
18 subtable->items[k].to.name);
19 continue;
20 }
21 iSubtable_gsub_ligature.push(
22 &nt, ((otl_GsubLigatureEntry){
23 .from = subtable->items[k].from, .to = Handle.dup(subtable->items[k].to),
24 }));
25 subtable->items[k].from = NULL;
26 }
27 iSubtable_gsub_ligature.replace(subtable, nt);
28 return (subtable->length == 0);
29 }