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-reverse.c
Go to the documentation of this file.
1 #include "gsub-reverse.h"
2 
3 typedef struct {
4  int fromid;
6  int toid;
11  return a->fromid - b->fromid;
12 }
13 
15  const otfcc_Options *options) {
16  subtable_gsub_reverse *subtable = &(_subtable->gsub_reverse);
17  for (tableid_t j = 0; j < subtable->matchCount; j++) {
19  }
21  if (subtable->inputIndex >= subtable->matchCount) { subtable->inputIndex = subtable->matchCount - 1; }
23  otl_Coverage *from = subtable->match[subtable->inputIndex];
24  for (glyphid_t k = 0; k < from->numGlyphs && k < subtable->to->numGlyphs; k++) {
26  int fromid = from->glyphs[k].index;
27  HASH_FIND_INT(h, &fromid, s);
28  if (s) {
29  logWarning("[Consolidate] Double-mapping a glyph in a reverse substitution /%s.\n", from->glyphs[k].name);
30  } else {
31  NEW(s);
32  s->fromid = from->glyphs[k].index;
33  s->toid = subtable->to->glyphs[k].index;
34  s->fromname = from->glyphs[k].name;
35  s->toname = subtable->to->glyphs[k].name;
36  HASH_ADD_INT(h, fromid, s);
37  }
38  }
40  if (HASH_COUNT(h) != from->numGlyphs || HASH_COUNT(h) != subtable->to->numGlyphs) {
41  logWarning("[Consolidate] In this reverse subsitution lookup, some mappings are ignored.\n");
42  }
43  from->numGlyphs = HASH_COUNT(h);
44  subtable->to->numGlyphs = HASH_COUNT(h);
45  {
46  gsub_single_map_hash *s, *tmp;
47  glyphid_t j = 0;
48  HASH_ITER(hh, h, s, tmp) {
49  from->glyphs[j] = Handle.fromConsolidated(s->fromid, s->fromname);
50  subtable->to->glyphs[j] = Handle.fromConsolidated(s->toid, s->toname);
51  j++;
52  HASH_DEL(h, s);
53  FREE(s);
54  }
55  }
56  return false;
57 }
static int by_from_id(gsub_single_map_hash *a, gsub_single_map_hash *b)
Definition: gsub-reverse.c:10
bool consolidate_gsub_reverse(otfcc_Font *font, table_OTL *table, otl_Subtable *_subtable, const otfcc_Options *options)
Definition: gsub-reverse.c:14
#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
int k
Definition: otp-parser.c:70
uint16_t tableid_t
Definition: primitives.h:17
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
char * sds
Definition: sds.h:41
Definition: pbmfont.h:11
UT_hash_handle hh
Definition: gsub-reverse.c:8
OWNING sds name
Definition: handle.h:21
glyphid_t index
Definition: handle.h:20
otfcc_GlyphHandle * glyphs
Definition: coverage.h:8
glyphid_t numGlyphs
Definition: coverage.h:6
OWNING otl_Coverage ** match
Definition: otl.h:108
tableid_t inputIndex
Definition: otl.h:107
tableid_t matchCount
Definition: otl.h:106
OWNING otl_Coverage * to
Definition: otl.h:109
Definition: otl.h:253
Definition: table.h:30
int j
Definition: t4ht.c:1589
subtable_gsub_reverse gsub_reverse
Definition: otl.h:191
#define HASH_DEL(head, delptr)
Definition: uthash.h:498
#define HASH_ITER(hh, head, el, tmp)
Definition: uthash.h:1131
#define HASH_COUNT(head)
Definition: uthash.h:1137
#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