w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gsub-multi.c
Go to the documentation of this file.
1 #include "gsub-multi.h"
2 
3 typedef struct {
4  int fromid;
10  return a->fromid - b->fromid;
11 }
12 
14  const otfcc_Options *options) {
15  subtable_gsub_multi *subtable = &(_subtable->gsub_multi);
17 
18  for (glyphid_t k = 0; k < subtable->length; k++) {
19  if (!GlyphOrder.consolidateHandle(font->glyph_order, &subtable->items[k].from)) {
20  logWarning("[Consolidate] Ignored missing glyph /%s.\n", subtable->items[k].from.name);
21  continue;
22  }
24  Coverage.shrink(subtable->items[k].to, false);
25  if (!subtable->items[k].to->numGlyphs) {
26  logWarning("[Consolidate] Ignoring empty one-to-many / alternative substitution for "
27  "glyph /%s.\n",
28  subtable->items[k].from.name);
29  continue;
30  }
31 
33  int fromid = subtable->items[k].from.index;
34  HASH_FIND_INT(h, &fromid, s);
35  if (!s) {
36  NEW(s);
37  s->fromid = subtable->items[k].from.index;
38  s->fromname = sdsdup(subtable->items[k].from.name);
39  s->to = subtable->items[k].to;
40  subtable->items[k].to = NULL; // Transfer ownership
41  HASH_ADD_INT(h, fromid, s);
42  }
43  }
45  iSubtable_gsub_multi.clear(subtable);
46  {
47  gsub_multi_hash *s, *tmp;
48  HASH_ITER(hh, h, s, tmp) {
50  subtable, ((otl_GsubMultiEntry){
51  .from = Handle.fromConsolidated(s->fromid, s->fromname), .to = s->to,
52  }));
53  sdsfree(s->fromname);
54  HASH_DEL(h, s);
55  FREE(s);
56  }
57  }
58  return (subtable->length == 0);
59 }
60 
62  const otfcc_Options *options) {
63  return consolidate_gsub_multi(font, table, _subtable, options);
64 }
#define GlyphOrder
Definition: aglfn.c:2
bool consolidate_gsub_alternative(otfcc_Font *font, table_OTL *table, otl_Subtable *_subtable, const otfcc_Options *options)
Definition: gsub-multi.c:61
bool consolidate_gsub_multi(otfcc_Font *font, table_OTL *table, otl_Subtable *_subtable, const otfcc_Options *options)
Definition: gsub-multi.c:13
static int by_from_id_multi(gsub_multi_hash *a, gsub_multi_hash *b)
Definition: gsub-multi.c:9
#define b
Definition: jpegint.h:372
int h
Definition: dviconv.c:9
long hh
Definition: dvi2xx.h:579
#define s
Definition: afcover.h:80
#define a(n)
Definition: gpos-common.c:148
const unsigned char FREE
Definition: image.cpp:34
#define NULL
Definition: ftobjs.h:61
#define NEW
Definition: gdkanji.c:77
#define logWarning(...)
Definition: aliases.h:14
#define Handle
Definition: aliases.h:45
#define Coverage
Definition: aliases.h:58
iSubtable_gsub_multi
Definition: otl.d:20761
int k
Definition: otp-parser.c:70
uint16_t glyphid_t
Definition: primitives.h:14
void fontop_consolidateCoverage(otfcc_Font *font, otl_Coverage *coverage, const otfcc_Options *options)
Definition: common.c:3
void sdsfree(sds s)
sds sdsdup(const sds s)
char * sds
Definition: sds.h:41
Definition: pbmfont.h:11
otl_Coverage * to
Definition: gsub-multi.c:6
UT_hash_handle hh
Definition: gsub-multi.c:7
OWNING sds name
Definition: handle.h:21
glyphid_t index
Definition: handle.h:20
glyphid_t numGlyphs
Definition: coverage.h:6
OWNING otfcc_GlyphHandle from
Definition: otl.h:55
OWNING otl_Coverage * to
Definition: otl.h:56
otl_GsubMultiEntry * items
Definition: otl.d:20760
Definition: otl.h:253
Definition: table.h:30
subtable_gsub_multi gsub_multi
Definition: otl.h:188
#define HASH_DEL(head, delptr)
Definition: uthash.h:498
#define HASH_ITER(hh, head, el, tmp)
Definition: uthash.h:1131
#define HASH_SORT(head, cmpfcn)
Definition: uthash.h:960
#define HASH_FIND_INT(head, findint, out)
Definition: uthash.h:486
#define HASH_ADD_INT(head, intfield, add)
Definition: uthash.h:488