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)  

otfcommon.c
Go to the documentation of this file.
1 /* otfcommon.c -- OpenType Common Table Formats
2  */
3 #ifdef HAVE_CONFIG_H
4 #include <config.h>
5 #endif
6 
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "ttf.h"
10 #include "ttfutil.h"
11 
12 static LangSysPtr
14 {
15  LangSysPtr langSys = XCALLOC1 (LangSys);
16  USHORT lookupOrder;
17 
18  xfseek (fp, offset, SEEK_SET, "otfMakeLangSys");
19 
20  if ((lookupOrder = ttfGetUSHORT (fp)) != 0)
21  ttfError ("Non-zero lookupOrder\n");
22  langSys->reqFeatureIndex = ttfGetUSHORT (fp);
23  langSys->featureCount = ttfGetUSHORT (fp);
24  langSys->featureIndex = ttfMakeUSHORT (langSys->featureCount, fp);
25 
26  return langSys;
27 }
28 
29 static void
31 {
32  int i;
33  USHORT dOffset;
34  USHORT *lOffset;
35 
36  xfseek (fp, offset, SEEK_SET, "otfLoadScriptRecord");
37 
38  dOffset = ttfGetUSHORT (fp);
39 
40  scriptRecord->langSysCount = ttfGetUSHORT (fp);
41  if (scriptRecord->langSysCount) {
42  scriptRecord->langSysRecord = XCALLOC (scriptRecord->langSysCount, LangSysRecord);
43  lOffset = XTALLOC (scriptRecord->langSysCount, USHORT);
44 
45  for (i = 0; i < scriptRecord->langSysCount; i++) {
46  scriptRecord->langSysRecord[i].tag = ttfGetULONG (fp);
47  lOffset[i] = ttfGetUSHORT (fp);
48  }
49 
50  for (i = 0; i < scriptRecord->langSysCount; i++)
51  scriptRecord->langSysRecord[i].langSys = otfMakeLangSys (fp, offset + lOffset[i]);
52 
53  free (lOffset);
54  }
55 
56  if (dOffset)
57  scriptRecord->defaultLangSys = otfMakeLangSys (fp, offset + dOffset);
58 }
59 
62 {
63  int i;
64  USHORT *sOffset;
65  ScriptListPtr scriptList = XCALLOC1 (ScriptList);
66 
67  xfseek (fp, offset, SEEK_SET, "otfMakeScriptList");
68 
69  scriptList->scriptCount = ttfGetUSHORT (fp);
70  scriptList->scriptRecord = XCALLOC (scriptList->scriptCount, ScriptRecord);
71  sOffset = XTALLOC (scriptList->scriptCount, USHORT);
72 
73  for (i = 0; i < scriptList->scriptCount; i++) {
74  scriptList->scriptRecord[i].tag = ttfGetULONG (fp);
75  sOffset[i] = ttfGetUSHORT (fp);
76  }
77 
78  for (i = 0; i < scriptList->scriptCount; i++)
79  otfLoadScriptRecord (fp, &scriptList->scriptRecord[i], offset + sOffset[i]);
80 
81  free (sOffset);
82 
83  return scriptList;
84 }
85 
86 static void
88 {
89  int i;
90 
91  fprintf (fp, " lang - featureCount: %d\n", langSys->featureCount);
92  if (langSys->reqFeatureIndex != 0xffff)
93  fprintf (fp, "\t\t reqFeatureIndex: %d\n", langSys->reqFeatureIndex);
94  if (langSys->featureCount) {
95  fprintf (fp, "\t\t featureIndex: %d", langSys->featureIndex[0]);
96  for (i = 1; i < langSys->featureCount; i++)
97  fprintf (fp, i % 8 ? ", %d" : ",\n\t\t\t\t%d",
98  langSys->featureIndex[i]);
99  fprintf (fp, "\n");
100  }
101 }
102 
103 static void
105 {
106  int i;
107 
108  fprintf (fp, "'%s' script - langSysCount: %d\n",
109  TagToStr (scriptRecord->tag), scriptRecord->langSysCount);
110  if (scriptRecord->defaultLangSys) {
111  fprintf (fp, "\t default");
112  otfPrintLangSys (fp, scriptRecord->defaultLangSys);
113  }
114  for (i = 0; i < scriptRecord->langSysCount; i++) {
115  fprintf (fp, " %2d. '%s'", i,
116  TagToStr (scriptRecord->langSysRecord[i].tag));
117  otfPrintLangSys (fp, scriptRecord->langSysRecord[i].langSys);
118  }
119 }
120 
121 void
123 {
124  int i;
125 
126  fprintf (fp, " scriptCount: %d\n", scriptList->scriptCount);
127 
128  for (i = 0; i < scriptList->scriptCount; i++) {
129  fprintf (fp, " %2d. ", i);
130  otfPrintScriptRecord (fp, &scriptList->scriptRecord[i]);
131  }
132  fprintf (fp, "\n");
133 }
134 
135 static void
137 {
138  free (langSys->featureIndex);
139  free (langSys);
140 }
141 
142 static void
144 {
145  int i;
146 
147  if (scriptRecord->defaultLangSys)
148  otfFreeLangSys (scriptRecord->defaultLangSys);
149  for (i = 0; i < scriptRecord->langSysCount; i++)
150  otfFreeLangSys (scriptRecord->langSysRecord[i].langSys);
151  free (scriptRecord->langSysRecord);
152 }
153 
154 void
156 {
157  int i;
158 
159  for (i = 0; i < scriptList->scriptCount; i++)
160  otfFreeScriptRecord (&scriptList->scriptRecord[i]);
161  free (scriptList->scriptRecord);
162  free (scriptList);
163 }
164 
165 static void
167 {
168  xfseek (fp, offset, SEEK_SET, "otfLoadFeatureRecord");
169 
170  featureRecord->featureParams = ttfGetUSHORT (fp);
171  featureRecord->lookupCount = ttfGetUSHORT (fp);
172  featureRecord->lookupListIndex = ttfMakeUSHORT (featureRecord->lookupCount, fp);
173 }
174 
177 {
178  int i;
179  USHORT *fOffset;
180  FeatureListPtr featureList = XCALLOC1 (FeatureList);
181 
182  xfseek (fp, offset, SEEK_SET, "otfMakeFeatureList");
183 
184  featureList->featureCount = ttfGetUSHORT (fp);
185  if (featureList->featureCount) {
186  featureList->featureRecord = XCALLOC (featureList->featureCount, FeatureRecord);
187  fOffset = XTALLOC (featureList->featureCount, USHORT);
188 
189  for (i = 0; i < featureList->featureCount; i++) {
190  featureList->featureRecord[i].tag = ttfGetULONG (fp);
191  fOffset[i] = ttfGetUSHORT (fp);
192  }
193 
194  for (i = 0; i < featureList->featureCount; i++)
195  otfLoadFeatureRecord (fp, &featureList->featureRecord[i], offset + fOffset[i]);
196 
197  free (fOffset);
198  }
199 
200  return featureList;
201 }
202 
203 static void
205 {
206  int i;
207 
208  fprintf (fp, "'%s' feature - lookupCount: %d\n",
209  TagToStr (featureRecord->tag), featureRecord->lookupCount);
210  fprintf (fp, "\t\tlookupListIndex: %d", featureRecord->lookupListIndex[0]);
211  for (i = 1; i < featureRecord->lookupCount; i++)
212  fprintf (fp, i % 8 ? ", %d" : ",\n\t\t\t\t %d",
213  featureRecord->lookupListIndex[i]);
214  fprintf (fp, "\n");
215  if (featureRecord->featureParams)
216  fprintf (fp, "\t\tfeatureParams Offset: 0x%04x\n", featureRecord->featureParams);
217 }
218 
219 void
221 {
222  int i;
223 
224  fprintf (fp, " featureCount: %d\n", featureList->featureCount);
225 
226  for (i = 0; i < featureList->featureCount; i++) {
227  fprintf (fp, " %2d. ", i);
228  otfPrintFeatureRecord (fp, &featureList->featureRecord[i]);
229  }
230  fprintf (fp, "\n");
231 }
232 
233 void
235 {
236  int i;
237 
238  if (featureList->featureCount) {
239  for (i = 0; i < featureList->featureCount; i++)
240  free (featureList->featureRecord[i].lookupListIndex);
241  free (featureList->featureRecord);
242  }
243  free (featureList);
244 }
245 
246 static void
248 {
249  int i;
250  USHORT lookupType;
251  USHORT *lOffset;
252 
253  xfseek (fp, offset, SEEK_SET, "otfLoadLookupRecord");
254 
255  lookupType = ttfGetUSHORT (fp);
256  lookupRecord->lookupFlag = ttfGetUSHORT (fp);
257  lookupRecord->subTableCount = ttfGetUSHORT (fp);
258  lookupRecord->lookup = XCALLOC (lookupRecord->subTableCount, LookupPtr);
259  lOffset = ttfMakeUSHORT (lookupRecord->subTableCount, fp);
260  if (lookupRecord->lookupFlag & lookupFlag_UseMarkFilteringSet)
261  lookupRecord->markFilteringSet = ttfGetUSHORT (fp);
262  for (i = 0; i < lookupRecord->subTableCount; i++)
263  lookupRecord->lookup[i] = (*makeLookup) (fp, lookupType, offset + lOffset[i]);
264  free (lOffset);
265 }
266 
269 {
270  int i;
271  USHORT *lOffset;
272  LookupListPtr lookupList = XCALLOC1 (LookupList);
273 
274  xfseek (fp, offset, SEEK_SET, "otfMakeLookupList");
275 
276  lookupList->lookupCount = ttfGetUSHORT (fp);
277  if (lookupList->lookupCount) {
278  lookupList->lookupRecord = XCALLOC (lookupList->lookupCount, LookupRecord);
279  lOffset = ttfMakeUSHORT (lookupList->lookupCount, fp);
280 
281  for (i = 0; i < lookupList->lookupCount; i++)
282  otfLoadLookupRecord (fp, &lookupList->lookupRecord[i], offset + lOffset[i], makeLookup);
283 
284  free (lOffset);
285  }
286 
287  return lookupList;
288 }
289 
290 void
292 {
293  int i;
294 
295  fprintf (fp, " lookupCount: %d\n", lookupList->lookupCount);
296 
297  for (i = 0; i < lookupList->lookupCount; i++) {
298  int j;
299 
300  fprintf (fp, " %2d. lookupType: %d, lookupFlag: 0x%04x", i,
301  lookupList->lookupRecord[i].lookup[0].otf->lookupType,
302  lookupList->lookupRecord[i].lookupFlag);
304  fprintf (fp, ", markFilteringSet: %d", lookupList->lookupRecord[i].markFilteringSet);
305  fprintf (fp, "\n\tsubTableCount:\t%d\n", lookupList->lookupRecord[i].subTableCount);
306  for (j = 0; j < lookupList->lookupRecord[i].subTableCount; j++) {
307  fprintf (fp, " %2d. lookupFormat: %d", j,
308  lookupList->lookupRecord[i].lookup[j].otf->lookupFormat);
309  (*printLookup) (fp, lookupList->lookupRecord[i].lookup[j]);
310  }
311  }
312  fprintf (fp, "\n");
313 }
314 
315 void
317 {
318  int i;
319 
320  if (lookupList->lookupCount) {
321  for (i = 0; i < lookupList->lookupCount; i++) {
322  int j;
323 
324  for (j = 0; j < lookupList->lookupRecord[i].subTableCount; j++) {
325  (*freeLookup) (lookupList->lookupRecord[i].lookup[j]);
326  free (lookupList->lookupRecord[i].lookup[j].otf);
327  }
328  free (lookupList->lookupRecord[i].lookup);
329  }
330  free (lookupList->lookupRecord);
331  }
332  free (lookupList);
333 }
334 
337 {
339  int i;
340  USHORT format;
341 
342  xfseek (fp, offset, SEEK_SET, "otfMakeCoverage");
343 
344  format = ttfGetUSHORT (fp);
345  switch (format)
346  {
347  case 1:
348  coverage.coverage1 = XCALLOC1 (Coverage1);
349  coverage.coverage1->glyphCount = ttfGetUSHORT (fp);
350  coverage.coverage1->glyphArray = ttfMakeUSHORT (coverage.coverage1->glyphCount, fp);
351  break;
352  case 2:
353  coverage.coverage2 = XCALLOC1 (Coverage2);
354  coverage.coverage2->rangeCount = ttfGetUSHORT (fp);
355  coverage.coverage2->rangeRecord = XTALLOC (coverage.coverage2->rangeCount, RangeRecord);
356  for (i = 0; i < coverage.coverage2->rangeCount; i++) {
357  coverage.coverage2->rangeRecord[i].start = ttfGetUSHORT (fp);
358  coverage.coverage2->rangeRecord[i].end = ttfGetUSHORT (fp);
359  coverage.coverage2->rangeRecord[i].startCoverageIndex = ttfGetUSHORT (fp);
360  }
361  break;
362  default:
363  ttfError ("Unrecognized coverageFormat\n");
364  }
365 
366  *coverage.format = format;
367  return coverage;
368 }
369 
370 void
372 {
373  int i;
374 
375  fprintf (fp, "Coverage - ");
376  switch (*coverage.format)
377  {
378  case 1:
379  fprintf (fp, "glyphCount: %d\n\t\t glyphArray: %d",
380  coverage.coverage1->glyphCount, coverage.coverage1->glyphArray[0]);
381  for (i = 1; i < coverage.coverage1->glyphCount; i++)
382  fprintf (fp, i % 8 ? ", %d" : ",\n\t\t\t %d",
383  coverage.coverage1->glyphArray[i]);
384  fprintf (fp, "\n");
385  break;
386  case 2:
387  fprintf (fp, "rangeCount: %d\n", coverage.coverage2->rangeCount);
388  for (i = 0; i < coverage.coverage2->rangeCount; i++) {
389  fprintf (fp, "\t %2d. start: %d, end: %d, startCoverageIndex: %d\n", i,
390  coverage.coverage2->rangeRecord[i].start,
391  coverage.coverage2->rangeRecord[i].end,
392  coverage.coverage2->rangeRecord[i].startCoverageIndex);
393  }
394  break;
395  default:
396  ttfError ("Internal error: otfPrintCoverage\n");
397  }
398 }
399 
400 void
402 {
403  switch (*coverage.format)
404  {
405  case 1:
406  free (coverage.coverage1->glyphArray);
407  break;
408  case 2:
409  free (coverage.coverage2->rangeRecord);
410  break;
411  default:
412  ttfError ("Internal error: otfFreeCoverage\n");
413  }
414  free (coverage.format);
415 }
416 
419 {
420  ClassDefPtr classDef;
421  int i;
422  USHORT format;
423 
424  xfseek (fp, offset, SEEK_SET, "otfMakeClassDef");
425 
426  format = ttfGetUSHORT (fp);
427  switch (format)
428  {
429  case 1:
430  classDef.classDef1 = XCALLOC1 (ClassDef1);
431  classDef.classDef1->startGlyph = ttfGetUSHORT (fp);
432  classDef.classDef1->glyphCount = ttfGetUSHORT (fp);
434  break;
435  case 2:
436  classDef.classDef2 = XCALLOC1 (ClassDef2);
439  for (i = 0; i < classDef.classDef2->classRangeCount; i++) {
443  }
444  break;
445  default:
446  ttfError ("Unrecognized classDefFormat\n");
447  }
448 
449  *classDef.format = format;
450  return classDef;
451 }
452 
453 void
455 {
456  int i;
457 
458  switch (*classDef.format)
459  {
460  case 1:
461  fprintf (fp, "startGlyph: %d, glyphCount: %d\n\t\tclassValueArray ",
462  classDef.classDef1->startGlyph, classDef.classDef1->glyphCount);
463  for (i = 0; i < classDef.classDef1->glyphCount; i++)
464  fprintf (fp, i == 0 ? "- %d" : i % 8 ? ", %d" : ",\n\t\t\t\t %d",
465  classDef.classDef1->classValueArray[i]);
466  fprintf (fp, "\n");
467  break;
468  case 2:
469  fprintf (fp, "classRangeCount: %d\n", classDef.classDef2->classRangeCount);
470  for (i = 0; i < classDef.classDef2->classRangeCount; i++)
471  fprintf (fp, "\t\t%2d. start: %d, end: %d, classValue: %d\n", i,
472  classDef.classDef2->classRangeRecord[i].start,
473  classDef.classDef2->classRangeRecord[i].end,
475  break;
476  default:
477  ttfError ("Internal error: otfPrintClassDef\n");
478  }
479 }
480 
481 void
483 {
484  switch (*classDef.format)
485  {
486  case 1:
487  free (classDef.classDef1->classValueArray);
488  break;
489  case 2:
490  free (classDef.classDef2->classRangeRecord);
491  break;
492  default:
493  ttfError ("Internal error: otfFreeClassDef\n");
494  }
495  free (classDef.format);
496 }
497 
498 DevicePtr
500 {
501  size_t num;
502  DevicePtr device;
503  USHORT startSize, endSize, deltaFormat;
504 
505  xfseek (fp, offset, SEEK_SET, "otfMakeDevice");
506 
507  startSize = ttfGetUSHORT (fp);
508  endSize = ttfGetUSHORT (fp);
509  deltaFormat = ttfGetUSHORT (fp);
510  if (deltaFormat < 1 || deltaFormat > 3)
511  ttfError ("Unrecognized deltaFormat\n");
512  num = (endSize - startSize) >> (4 - deltaFormat);
513  device = (DevicePtr) xcalloc (1, sizeof (Device) + num * sizeof (USHORT));
514  device->startSize = startSize;
515  device->endSize = endSize;
516  device->deltaFormat = deltaFormat;
517  ttfReadUSHORT (device->deltaValue, num + 1, fp);
518 
519  return device;
520 }
521 
522 void
524 {
525  int i;
526  size_t num = (device->endSize - device->startSize) >> (4 - device->deltaFormat);
527 
528  fprintf (fp, "startSize = %d, endSize = %d, deltaFormat = %d, deltaValue = 0x",
529  device->startSize, device->endSize, device->deltaFormat);
530  for (i = 0; i < num; i++)
531  fprintf (fp, "%04x", device->deltaValue[i]);
532  fprintf (fp, "%04x\n", device->deltaValue[num]);
533 }
534 
535 static OtfLookupRecordPtr
537 {
538  int i;
539  OtfLookupRecordPtr otf = XCALLOC (otfCount, OtfLookupRecord);
540 
541  for (i = 0; i < otfCount; i++) {
542  otf[i].sequenceIndex = ttfGetUSHORT (fp);
543  otf[i].lookupListIndex = ttfGetUSHORT (fp);
544  }
545  return otf;
546 }
547 
548 static void
549 printOtfLookupRecord (FILE * fp, const char *str, USHORT otfCount, OtfLookupRecordPtr otf)
550 {
551  int i;
552 
553  fprintf (fp, "\t%sotfCount: %d\n", str, otfCount);
554  for (i = 0; i < otfCount; i++)
555  fprintf (fp, "\t%s%2d. sequenceIndex: %d, lookupListIndex: %d\n",
556  str, i, otf[i].sequenceIndex, otf[i].lookupListIndex);
557 }
558 
559 static void loadOtfRule (OtfRulePtr otfRule, FILE *fp, ULONG offset)
560 {
561  xfseek (fp, offset, SEEK_SET, "loadOtfRule");
562 
563  otfRule->glyphCount = ttfGetUSHORT (fp);
564  otfRule->otfCount = ttfGetUSHORT (fp);
565  otfRule->input = ttfMakeUSHORT (otfRule->glyphCount - 1, fp);
566  otfRule->otf = makeOtfLookupRecord (otfRule->otfCount, fp);
567 }
568 
569 static void loadOtfRuleSet (OtfRuleSetPtr otfRuleSet, FILE *fp, ULONG offset)
570 {
571  int i;
572  USHORT *rOffset;
573 
574  xfseek (fp, offset, SEEK_SET, "loadOtfRuleSet");
575 
576  otfRuleSet->otfRuleCount = ttfGetUSHORT (fp);
577  rOffset = ttfMakeUSHORT (otfRuleSet->otfRuleCount, fp);
578  otfRuleSet->otfRule = XCALLOC (otfRuleSet->otfRuleCount, OtfRule);
579  for (i = 0; i < otfRuleSet->otfRuleCount; i++)
580  loadOtfRule (&otfRuleSet->otfRule[i], fp, offset + rOffset[i]);
581  free (rOffset);
582 }
583 
585 {
586  int i;
587  USHORT cOffset;
588  USHORT *rOffset;
589  OtfCtx1Ptr otf = XCALLOC1 (OtfCtx1);
590 
591  cOffset = ttfGetUSHORT (fp);
593  rOffset = ttfMakeUSHORT (otf->otfRuleSetCount, fp);
595  otf->coverage = otfMakeCoverage (fp, offset + cOffset);
596  for (i = 0; i < otf->otfRuleSetCount; i++)
597  loadOtfRuleSet (&otf->otfRuleSet[i], fp, offset + rOffset[i]);
598  free (rOffset);
599 
600  return otf;
601 }
602 
604 {
605  int i;
606 
607  fprintf (fp, " - Context %s Simple\n\t ",
608  otf->lookupType == 7 ? "Positioning" : "Substitution");
609  otfPrintCoverage (fp, otf->coverage);
610  fprintf (fp, "\t otfRuleSetCount: %d\n", otf->otfRuleSetCount);
611  for (i = 0; i < otf->otfRuleSetCount; i++) {
612  int j;
613 
614  fprintf (fp, "\t %2d. otfRuleCount: %d\n", i, otf->otfRuleSet[i].otfRuleCount);
615  for (j = 0; j < otf->otfRuleSet[i].otfRuleCount; j++) {
616  int k;
617 
618  fprintf (fp, "\t %2d. glyphCount: %d ", j,
619  otf->otfRuleSet[i].otfRule[j].glyphCount);
620  for (k = 0; k < otf->otfRuleSet[i].otfRule[j].glyphCount - 1; k++)
621  fprintf (fp, k == 0 ? "- %d" : ", %d", otf->otfRuleSet[i].otfRule[j].input[k]);
622  fprintf (fp, "\n");
623  printOtfLookupRecord (fp, " ",
624  otf->otfRuleSet[i].otfRule[j].otfCount,
625  otf->otfRuleSet[i].otfRule[j].otf);
626  }
627  }
628 }
629 
631 {
632  int i;
633 
634  otfFreeCoverage (otf->coverage);
635  for (i = 0; i < otf->otfRuleSetCount; i++) {
636  int j;
637 
638  for (j = 0; j < otf->otfRuleSet[i].otfRuleCount; j++) {
639  free (otf->otfRuleSet[i].otfRule[j].input);
640  free (otf->otfRuleSet[i].otfRule[j].otf);
641  }
642  free (otf->otfRuleSet[i].otfRule);
643  }
644  free (otf->otfRuleSet);
645 }
646 
647 static void loadOtfClassRule (OtfClassRulePtr otfClassRule, FILE *fp, ULONG offset)
648 {
649  xfseek (fp, offset, SEEK_SET, "loadOtfClassRule");
650 
651  otfClassRule->glyphCount = ttfGetUSHORT (fp);
652  otfClassRule->otfCount = ttfGetUSHORT (fp);
653  otfClassRule->class = ttfMakeUSHORT (otfClassRule->glyphCount - 1, fp);
654  otfClassRule->otf = makeOtfLookupRecord (otfClassRule->otfCount, fp);
655 }
656 
657 static void loadOtfClassSet (OtfClassSetPtr otfClassSet, FILE *fp, ULONG offset)
658 {
659  int i;
660  USHORT *sOffset;
661 
662  xfseek (fp, offset, SEEK_SET, "loadOtfClassSet");
663 
664  otfClassSet->otfClassRuleCnt = ttfGetUSHORT (fp);
665  sOffset = ttfMakeUSHORT (otfClassSet->otfClassRuleCnt, fp);
666  otfClassSet->otfClassRule = XCALLOC (otfClassSet->otfClassRuleCnt, OtfClassRule);
667  for (i = 0; i < otfClassSet->otfClassRuleCnt; i++)
668  loadOtfClassRule (&otfClassSet->otfClassRule[i], fp, offset + sOffset[i]);
669  free (sOffset);
670 }
671 
673 {
674  int i;
675  USHORT cOffset;
676  USHORT clOffset;
677  USHORT *sOffset;
678  OtfCtx2Ptr otf = XCALLOC1 (OtfCtx2);
679 
680  cOffset = ttfGetUSHORT (fp);
681  clOffset = ttfGetUSHORT (fp);
682  otf->otfClassSetCnt = ttfGetUSHORT (fp);
683  sOffset = ttfMakeUSHORT (otf->otfClassSetCnt, fp);
685  otf->coverage = otfMakeCoverage (fp, offset + cOffset);
686  otf->classDef = otfMakeClassDef (fp, offset + clOffset);
687  for (i = 0; i < otf->otfClassSetCnt; i++)
688  if (sOffset[i])
689  loadOtfClassSet (&otf->otfClassSet[i], fp, offset + sOffset[i]);
690  free (sOffset);
691 
692  return otf;
693 }
694 
696 {
697  int i;
698 
699  fprintf (fp, " - Context %s Class-based\n\t ",
700  otf->lookupType == 7 ? "Positioning" : "Substitution");
701  otfPrintCoverage (fp, otf->coverage);
702  fprintf (fp, "\t ClassDef - ");
703  otfPrintClassDef (fp, otf->classDef);
704  fprintf (fp, "\t otfClassSetCnt: %d\n", otf->otfClassSetCnt);
705  for (i = 0; i < otf->otfClassSetCnt; i++) {
706  int j;
707 
708  fprintf (fp, "\t %2d. otfClassRuleCnt: %d\n", i, otf->otfClassSet[i].otfClassRuleCnt);
709  for (j = 0; j < otf->otfClassSet[i].otfClassRuleCnt; j++) {
710  int k;
711 
712  fprintf (fp, "\t %2d. glyphCount: %d ", j,
714  for (k = 0; k < otf->otfClassSet[i].otfClassRule[j].glyphCount - 1; k++)
715  fprintf (fp, k == 0 ? "- %d" : ", %d", otf->otfClassSet[i].otfClassRule[j].class[k]);
716  fprintf (fp, "\n");
717  printOtfLookupRecord (fp, " ",
719  otf->otfClassSet[i].otfClassRule[j].otf);
720  }
721  }
722 }
723 
725 {
726  int i;
727 
728  otfFreeCoverage (otf->coverage);
729  otfFreeClassDef (otf->classDef);
730  for (i = 0; i < otf->otfClassSetCnt; i++) {
731  int j;
732 
733  for (j = 0; j < otf->otfClassSet[i].otfClassRuleCnt; j++) {
735  free (otf->otfClassSet[i].otfClassRule[j].otf);
736  }
737  free (otf->otfClassSet[i].otfClassRule);
738  }
739  free (otf->otfClassSet);
740 }
741 
743 {
744  int i;
745  USHORT *gOffset;
746  OtfCtx3Ptr otf = XCALLOC1 (OtfCtx3);
747 
748  otf->glyphCount = ttfGetUSHORT (fp);
749  otf->otfCount = ttfGetUSHORT (fp);
750  gOffset = ttfMakeUSHORT (otf->glyphCount, fp);
751  otf->otf = makeOtfLookupRecord (otf->otfCount, fp);
752  otf->glyphs = XCALLOC (otf->glyphCount, CoveragePtr);
753  for (i = 0; i < otf->glyphCount; i++)
754  otf->glyphs[i] = otfMakeCoverage (fp, offset + gOffset[i]);
755  free (gOffset);
756 
757  return otf;
758 }
759 
761 {
762  int i;
763 
764  fprintf (fp, " - Context %s Coverage-based\n",
765  otf->lookupType == 7 ? "Positioning" : "Substitution");
766  fprintf (fp, "\t glyphCount: %d\n", otf->glyphCount);
767  for (i = 0; i < otf->glyphCount; i++) {
768  fprintf (fp, "\t %2d. ", i);
769  otfPrintCoverage (fp, otf->glyphs[i]);
770  }
771  printOtfLookupRecord (fp, " ", otf->otfCount, otf->otf);
772 }
773 
775 {
776  int i;
777 
778  for (i = 0; i < otf->glyphCount; i++)
779  otfFreeCoverage (otf->glyphs[i]);
780  free (otf->glyphs);
781  free (otf->otf);
782 }
783 
784 static void
786 {
787  xfseek (fp, offset, SEEK_SET, "loadChainOtfRule");
788 
789  chainOtfRule->backtrackGlyphCount = ttfGetUSHORT (fp);
790  chainOtfRule->backtrack = ttfMakeUSHORT (chainOtfRule->backtrackGlyphCount, fp);
791  chainOtfRule->inputGlyphCount = ttfGetUSHORT (fp);
792  chainOtfRule->input = ttfMakeUSHORT (chainOtfRule->inputGlyphCount - 1, fp);
793  chainOtfRule->lookaheadGlyphCount = ttfGetUSHORT (fp);
794  chainOtfRule->lookahead = ttfMakeUSHORT (chainOtfRule->lookaheadGlyphCount, fp);
795  chainOtfRule->otfCount = ttfGetUSHORT (fp);
796  chainOtfRule->otf = makeOtfLookupRecord (chainOtfRule->otfCount, fp);
797 }
798 
799 static void
801 {
802  int i;
803  USHORT *rOffset;
804 
805  xfseek (fp, offset, SEEK_SET, "loadChainOtfRuleSet");
806 
807  chainOtfRuleSet->chainOtfRuleCount = ttfGetUSHORT (fp);
808  rOffset = ttfMakeUSHORT (chainOtfRuleSet->chainOtfRuleCount, fp);
809  chainOtfRuleSet->chainOtfRule = XCALLOC (chainOtfRuleSet->chainOtfRuleCount, ChainOtfRule);
810  for (i = 0; i < chainOtfRuleSet->chainOtfRuleCount; i++)
811  loadChainOtfRule (&chainOtfRuleSet->chainOtfRule[i], fp, offset + rOffset[i]);
812  free (rOffset);
813 }
814 
816 {
817  int i;
818  USHORT cOffset;
819  USHORT *rOffset;
820  OtfChn1Ptr otf = XCALLOC1 (OtfChn1);
821 
822  cOffset = ttfGetUSHORT (fp);
824  rOffset = ttfMakeUSHORT (otf->chainOtfRuleSetCount, fp);
825  otf->coverage = otfMakeCoverage (fp, offset + cOffset);
827  for (i = 0; i < otf->chainOtfRuleSetCount; i++)
828  loadChainOtfRuleSet (&otf->chainOtfRuleSet[i], fp, offset + rOffset[i]);
829  free (rOffset);
830 
831  return otf;
832 }
833 
835 {
836  int i;
837 
838  fprintf (fp, " - Chained Context %s Simple\n\t ",
839  otf->lookupType == 8 ? "Positioning" : "Substitution");
840  otfPrintCoverage (fp, otf->coverage);
841  fprintf (fp, "\t chainOtfRuleSetCount: %d\n", otf->chainOtfRuleSetCount);
842  for (i = 0; i < otf->chainOtfRuleSetCount; i++) {
843  int j;
844 
845  fprintf (fp, "\t %2d. chainOtfRuleCount: %d\n", i,
847  for (j = 0; j < otf->chainOtfRuleSet[i].chainOtfRuleCount; j++) {
848  int k;
849 
850  fprintf (fp, "\t %2d. backtrackGlyphCount: %d ", j,
852  for (k = 0; k < otf->chainOtfRuleSet[i].chainOtfRule[j].backtrackGlyphCount; k++)
853  fprintf (fp, k == 0 ? "- %d" : ", %d", otf->chainOtfRuleSet[i].chainOtfRule[j].backtrack[k]);
854  fprintf (fp, "\n\t\tinputGlyphCount: %d ",
856  for (k = 0; k < otf->chainOtfRuleSet[i].chainOtfRule[j].inputGlyphCount; k++)
857  fprintf (fp, k == 0 ? "- %d" : ", %d", otf->chainOtfRuleSet[i].chainOtfRule[j].input[k]);
858  fprintf (fp, "\n\t\tlookaheadGlyphCount: %d ",
860  for (k = 0; k < otf->chainOtfRuleSet[i].chainOtfRule[j].lookaheadGlyphCount; k++)
861  fprintf (fp, k == 0 ? "- %d" : ", %d", otf->chainOtfRuleSet[i].chainOtfRule[j].lookahead[k]);
862  fprintf (fp, "\n");
863  printOtfLookupRecord (fp, " ",
866  }
867  }
868 }
869 
871 {
872  int i;
873 
874  otfFreeCoverage (otf->coverage);
875  for (i = 0; i < otf->chainOtfRuleSetCount; i++) {
876  int j;
877 
878  for (j = 0; j < otf->chainOtfRuleSet[i].chainOtfRuleCount; j++) {
883  }
885  }
886  free (otf->chainOtfRuleSet);
887 }
888 
889 static void
891 {
892  xfseek (fp, offset, SEEK_SET, "loadChainOtfClassRule");
893 
894  chainOtfClassRule->backtrackGlyphCount = ttfGetUSHORT (fp);
895  chainOtfClassRule->backtrack = ttfMakeUSHORT (chainOtfClassRule->backtrackGlyphCount, fp);
896  chainOtfClassRule->inputGlyphCount = ttfGetUSHORT (fp);
897  chainOtfClassRule->input = ttfMakeUSHORT (chainOtfClassRule->inputGlyphCount - 1, fp);
898  chainOtfClassRule->lookaheadGlyphCount = ttfGetUSHORT (fp);
899  chainOtfClassRule->lookahead = ttfMakeUSHORT (chainOtfClassRule->lookaheadGlyphCount, fp);
900  chainOtfClassRule->otfCount = ttfGetUSHORT (fp);
901  chainOtfClassRule->otf = makeOtfLookupRecord (chainOtfClassRule->otfCount, fp);
902 }
903 
904 static void
906 {
907  int i;
908  USHORT *rOffset;
909 
910  xfseek (fp, offset, SEEK_SET, "loadChainOtfClassSet");
911 
912  chainOtfClassSet->chainOtfClassRuleCnt = ttfGetUSHORT (fp);
913  rOffset = ttfMakeUSHORT (chainOtfClassSet->chainOtfClassRuleCnt, fp);
914  chainOtfClassSet->chainOtfClassRule = XCALLOC (chainOtfClassSet->chainOtfClassRuleCnt, ChainOtfClassRule);
915  for (i = 0; i < chainOtfClassSet->chainOtfClassRuleCnt; i++)
916  loadChainOtfClassRule (&chainOtfClassSet->chainOtfClassRule[i], fp, offset + rOffset[i]);
917  free (rOffset);
918 }
919 
921 {
922  int i;
923  USHORT cOffset;
924  USHORT bOffset, iOffset, lOffset;
925  USHORT *sOffset;
926  OtfChn2Ptr otf = XCALLOC1 (OtfChn2);
927 
928  cOffset = ttfGetUSHORT (fp);
929  bOffset = ttfGetUSHORT (fp);
930  iOffset = ttfGetUSHORT (fp);
931  lOffset = ttfGetUSHORT (fp);
933  sOffset = ttfMakeUSHORT (otf->chainOtfClassSetCnt, fp);
934  otf->coverage = otfMakeCoverage (fp, offset + cOffset);
935  otf->backtrackClassDef = otfMakeClassDef (fp, offset + bOffset);
936  otf->inputClassDef = otfMakeClassDef (fp, offset + iOffset);
937  otf->lookaheadClassDef = otfMakeClassDef (fp, offset + lOffset);
939  for (i = 0; i < otf->chainOtfClassSetCnt; i++)
940  if (sOffset[i])
941  loadChainOtfClassSet (&otf->chainOtfClassSet[i], fp, offset + sOffset[i]);
942  free (sOffset);
943 
944  return otf;
945 }
946 
948 {
949  int i;
950 
951  fprintf (fp, " - Chained Context %s Class-based\n\t ",
952  otf->lookupType == 8 ? "Positioning" : "Substitution");
953  otfPrintCoverage (fp, otf->coverage);
954  fprintf (fp, "\t backtrackClassDef - ");
956  fprintf (fp, "\t inputClassDef - ");
958  fprintf (fp, "\t lookaheadClassDef - ");
960  fprintf (fp, "\t chainOtfClassSetCnt: %d\n", otf->chainOtfClassSetCnt);
961  for (i = 0; i < otf->chainOtfClassSetCnt; i++) {
962  int j;
963 
964  fprintf (fp, "\t %2d. chainOtfClassRuleCnt: %d\n", i,
966  for (j = 0; j < otf->chainOtfClassSet[i].chainOtfClassRuleCnt; j++) {
967  int k;
968 
969  fprintf (fp, "\t %2d. backtrackGlyphCount: %2d ", j,
972  fprintf (fp, k == 0 ? "- %d" : k % 8 ? ", %d" : ",\n\t\t\t\t\t %d",
974  fprintf (fp, "\n\t\tinputGlyphCount: %2d ",
976  for (k = 0; k < otf->chainOtfClassSet[i].chainOtfClassRule[j].inputGlyphCount; k++)
977  fprintf (fp, k == 0 ? "- %d" : k % 8 ? ", %d" : ",\n\t\t\t\t %d",
979  fprintf (fp, "\n\t\tlookaheadGlyphCount: %2d ",
982  fprintf (fp, k == 0 ? "- %d" : k % 8 ? ", %d" : ",\n\t\t\t\t\t %d",
984  fprintf (fp, "\n");
985  printOtfLookupRecord (fp, " ",
988  }
989  }
990 }
991 
993 {
994  int i;
995 
996  otfFreeCoverage (otf->coverage);
1000  for (i = 0; i < otf->chainOtfClassSetCnt; i++) {
1001  int j;
1002 
1003  for (j = 0; j < otf->chainOtfClassSet[i].chainOtfClassRuleCnt; j++) {
1008  }
1010  }
1011  free (otf->chainOtfClassSet);
1012 }
1013 
1015 {
1016  int i;
1017  USHORT *bOffset, *iOffset, *lOffset;
1018  OtfChn3Ptr otf = XCALLOC1 (OtfChn3);
1019 
1021  bOffset = ttfMakeUSHORT (otf->backtrackGlyphCount, fp);
1022  otf->inputGlyphCount = ttfGetUSHORT (fp);
1023  iOffset = ttfMakeUSHORT (otf->inputGlyphCount, fp);
1025  lOffset = ttfMakeUSHORT (otf->lookaheadGlyphCount, fp);
1026  otf->otfCount = ttfGetUSHORT (fp);
1027  otf->otf = makeOtfLookupRecord (otf->otfCount, fp);
1029  for (i = 0; i < otf->backtrackGlyphCount; i++)
1030  otf->backtrack[i] = otfMakeCoverage (fp, offset + bOffset[i]);
1031  free (bOffset);
1032  otf->input = XCALLOC (otf->inputGlyphCount, CoveragePtr);
1033  for (i = 0; i < otf->inputGlyphCount; i++)
1034  otf->input[i] = otfMakeCoverage (fp, offset + iOffset[i]);
1035  free (iOffset);
1037  for (i = 0; i < otf->lookaheadGlyphCount; i++)
1038  otf->lookahead[i] = otfMakeCoverage (fp, offset + lOffset[i]);
1039  free (lOffset);
1040 
1041  return otf;
1042 }
1043 
1045 {
1046  int i;
1047 
1048  fprintf (fp, " - Chained Context %s Coverage-based\n",
1049  otf->lookupType == 8 ? "Positioning" : "Substitution");
1050  fprintf (fp, "\t backtrackGlyphCount: %d\n", otf->backtrackGlyphCount);
1051  for (i = 0; i < otf->backtrackGlyphCount; i++) {
1052  fprintf (fp, "\t %2d. backtrack", i);
1053  otfPrintCoverage (fp, otf->backtrack[i]);
1054  }
1055  fprintf (fp, "\t inputGlyphCount: %d\n", otf->inputGlyphCount);
1056  for (i = 0; i < otf->inputGlyphCount; i++) {
1057  fprintf (fp, "\t %2d. input", i);
1058  otfPrintCoverage (fp, otf->input[i]);
1059  }
1060  fprintf (fp, "\t lookaheadGlyphCount: %d\n", otf->lookaheadGlyphCount);
1061  for (i = 0; i < otf->lookaheadGlyphCount; i++) {
1062  fprintf (fp, "\t %2d. lookahead", i);
1063  otfPrintCoverage (fp, otf->lookahead[i]);
1064  }
1065  printOtfLookupRecord (fp, " ", otf->otfCount, otf->otf);
1066 }
1067 
1069 {
1070  int i;
1071 
1072  for (i = 0; i < otf->backtrackGlyphCount; i++)
1073  otfFreeCoverage (otf->backtrack[i]);
1074  free (otf->backtrack);
1075  for (i = 0; i < otf->inputGlyphCount; i++)
1076  otfFreeCoverage (otf->input[i]);
1077  free (otf->input);
1078  for (i = 0; i < otf->lookaheadGlyphCount; i++)
1079  otfFreeCoverage (otf->lookahead[i]);
1080  free (otf->lookahead);
1081  free (otf->otf);
1082 }
1083 
#define free(a)
Definition: decNumber.cpp:310
#define SEEK_SET
Definition: jmemansi.c:26
small capitals from c petite p scientific i
Definition: afcover.h:80
int num
Definition: disdvi.c:621
#define XTALLOC(n, t)
Definition: writet1.c:32
unsigned short USHORT
Definition: sfnt.h:36
KPSEDLL void xfseek(FILE *fp, long offset, int wherefrom, const_string filename)
Definition: xfseek.c:22
KPSEDLL address xcalloc(size_t nelem, size_t elsize)
Definition: xcalloc.c:23
#define fprintf
Definition: mendex.h:64
#define USHORT
Definition: ttf.h:11
ULONG ttfGetULONG(FILE *fp)
Definition: ttfread.c:66
USHORT ttfGetUSHORT(FILE *fp)
Definition: ttfread.c:48
USHORT * ttfMakeUSHORT(size_t nelem, FILE *fp)
Definition: ttfread.c:145
void ttfReadUSHORT(USHORT *array, size_t nelem, FILE *fp)
Definition: ttfread.c:114
void freeOTFCtx2(OtfCtx2Ptr otf)
Definition: otfcommon.c:724
OtfChn2Ptr makeOTFChn2(FILE *fp, ULONG offset)
Definition: otfcommon.c:920
void otfFreeLookupList(LookupListPtr lookupList, FreeLookupFunc freeLookup)
Definition: otfcommon.c:316
static void otfLoadFeatureRecord(FILE *fp, FeatureRecordPtr featureRecord, ULONG offset)
Definition: otfcommon.c:166
ClassDefPtr otfMakeClassDef(FILE *fp, ULONG offset)
Definition: otfcommon.c:418
static void loadChainOtfRuleSet(ChainOtfRuleSetPtr chainOtfRuleSet, FILE *fp, ULONG offset)
Definition: otfcommon.c:800
void otfFreeCoverage(CoveragePtr coverage)
Definition: otfcommon.c:401
void otfFreeClassDef(ClassDefPtr classDef)
Definition: otfcommon.c:482
OtfChn1Ptr makeOTFChn1(FILE *fp, ULONG offset)
Definition: otfcommon.c:815
void printOTFChn2(FILE *fp, OtfChn2Ptr otf)
Definition: otfcommon.c:947
OtfChn3Ptr makeOTFChn3(FILE *fp, ULONG offset)
Definition: otfcommon.c:1014
static void loadOtfClassRule(OtfClassRulePtr otfClassRule, FILE *fp, ULONG offset)
Definition: otfcommon.c:647
static void loadChainOtfClassRule(ChainOtfClassRulePtr chainOtfClassRule, FILE *fp, ULONG offset)
Definition: otfcommon.c:890
void otfFreeScriptList(ScriptListPtr scriptList)
Definition: otfcommon.c:155
static void otfLoadScriptRecord(FILE *fp, ScriptRecordPtr scriptRecord, ULONG offset)
Definition: otfcommon.c:30
void otfPrintCoverage(FILE *fp, CoveragePtr coverage)
Definition: otfcommon.c:371
void otfPrintClassDef(FILE *fp, ClassDefPtr classDef)
Definition: otfcommon.c:454
static void otfFreeScriptRecord(ScriptRecordPtr scriptRecord)
Definition: otfcommon.c:143
CoveragePtr otfMakeCoverage(FILE *fp, ULONG offset)
Definition: otfcommon.c:336
static void otfPrintFeatureRecord(FILE *fp, FeatureRecordPtr featureRecord)
Definition: otfcommon.c:204
static void otfPrintLangSys(FILE *fp, LangSysPtr langSys)
Definition: otfcommon.c:87
void freeOTFChn2(OtfChn2Ptr otf)
Definition: otfcommon.c:992
void printOTFCtx2(FILE *fp, OtfCtx2Ptr otf)
Definition: otfcommon.c:695
void printOTFChn1(FILE *fp, OtfChn1Ptr otf)
Definition: otfcommon.c:834
static void loadOtfRule(OtfRulePtr otfRule, FILE *fp, ULONG offset)
Definition: otfcommon.c:559
static LangSysPtr otfMakeLangSys(FILE *fp, ULONG offset)
Definition: otfcommon.c:13
void freeOTFCtx1(OtfCtx1Ptr otf)
Definition: otfcommon.c:630
ScriptListPtr otfMakeScriptList(FILE *fp, ULONG offset)
Definition: otfcommon.c:61
void printOTFChn3(FILE *fp, OtfChn3Ptr otf)
Definition: otfcommon.c:1044
void otfPrintFeatureList(FILE *fp, FeatureListPtr featureList)
Definition: otfcommon.c:220
OtfCtx2Ptr makeOTFCtx2(FILE *fp, ULONG offset)
Definition: otfcommon.c:672
void otfPrintDevice(FILE *fp, DevicePtr device)
Definition: otfcommon.c:523
void otfPrintScriptList(FILE *fp, ScriptListPtr scriptList)
Definition: otfcommon.c:122
OtfCtx3Ptr makeOTFCtx3(FILE *fp, ULONG offset)
Definition: otfcommon.c:742
void freeOTFChn3(OtfChn3Ptr otf)
Definition: otfcommon.c:1068
void freeOTFCtx3(OtfCtx3Ptr otf)
Definition: otfcommon.c:774
void otfPrintLookupList(FILE *fp, LookupListPtr lookupList, PrintLookupFunc printLookup)
Definition: otfcommon.c:291
static void otfFreeLangSys(LangSysPtr langSys)
Definition: otfcommon.c:136
FeatureListPtr otfMakeFeatureList(FILE *fp, ULONG offset)
Definition: otfcommon.c:176
static void loadChainOtfClassSet(ChainOtfClassSetPtr chainOtfClassSet, FILE *fp, ULONG offset)
Definition: otfcommon.c:905
static void printOtfLookupRecord(FILE *fp, const char *str, USHORT otfCount, OtfLookupRecordPtr otf)
Definition: otfcommon.c:549
static void loadOtfClassSet(OtfClassSetPtr otfClassSet, FILE *fp, ULONG offset)
Definition: otfcommon.c:657
static void loadOtfRuleSet(OtfRuleSetPtr otfRuleSet, FILE *fp, ULONG offset)
Definition: otfcommon.c:569
DevicePtr otfMakeDevice(FILE *fp, ULONG offset)
Definition: otfcommon.c:499
void printOTFCtx3(FILE *fp, OtfCtx3Ptr otf)
Definition: otfcommon.c:760
void otfFreeFeatureList(FeatureListPtr featureList)
Definition: otfcommon.c:234
static void otfLoadLookupRecord(FILE *fp, LookupRecordPtr lookupRecord, ULONG offset, MakeLookupFunc makeLookup)
Definition: otfcommon.c:247
static void loadChainOtfRule(ChainOtfRulePtr chainOtfRule, FILE *fp, ULONG offset)
Definition: otfcommon.c:785
static OtfLookupRecordPtr makeOtfLookupRecord(USHORT otfCount, FILE *fp)
Definition: otfcommon.c:536
void freeOTFChn1(OtfChn1Ptr otf)
Definition: otfcommon.c:870
LookupListPtr otfMakeLookupList(FILE *fp, ULONG offset, MakeLookupFunc makeLookup)
Definition: otfcommon.c:268
OtfCtx1Ptr makeOTFCtx1(FILE *fp, ULONG offset)
Definition: otfcommon.c:584
static void otfPrintScriptRecord(FILE *fp, ScriptRecordPtr scriptRecord)
Definition: otfcommon.c:104
void printOTFCtx1(FILE *fp, OtfCtx1Ptr otf)
Definition: otfcommon.c:603
void() PrintLookupFunc(FILE *fp, LookupPtr lookup)
Definition: otftables.h:347
struct Device * DevicePtr
void() FreeLookupFunc(LookupPtr lookup)
Definition: otftables.h:348
#define lookupFlag_UseMarkFilteringSet
Definition: otftables.h:335
LookupPtr() MakeLookupFunc(FILE *fp, USHORT lookupType, ULONG offset)
Definition: otftables.h:346
int k
Definition: otp-parser.c:70
static int format
Definition: pbmclean.c:15
unsigned long ULONG
Definition: pdfgen.h:158
#define fp
static int offset
Definition: ppmtogif.c:642
#define str(s)
Definition: sh6.c:399
USHORT * lookahead
Definition: otftables.h:255
USHORT backtrackGlyphCount
Definition: otftables.h:250
USHORT inputGlyphCount
Definition: otftables.h:252
USHORT * backtrack
Definition: otftables.h:251
USHORT * input
Definition: otftables.h:253
USHORT lookaheadGlyphCount
Definition: otftables.h:254
OtfLookupRecordPtr otf
Definition: otftables.h:257
ChainOtfClassRulePtr chainOtfClassRule
Definition: otftables.h:264
USHORT chainOtfClassRuleCnt
Definition: otftables.h:263
ChainOtfRulePtr chainOtfRule
Definition: otftables.h:230
USHORT chainOtfRuleCount
Definition: otftables.h:229
USHORT backtrackGlyphCount
Definition: otftables.h:216
USHORT inputGlyphCount
Definition: otftables.h:218
OtfLookupRecordPtr otf
Definition: otftables.h:223
USHORT lookaheadGlyphCount
Definition: otftables.h:220
USHORT otfCount
Definition: otftables.h:222
USHORT * input
Definition: otftables.h:219
USHORT * lookahead
Definition: otftables.h:221
USHORT * backtrack
Definition: otftables.h:217
USHORT startGlyph
Definition: otftables.h:98
USHORT * classValueArray
Definition: otftables.h:100
USHORT glyphCount
Definition: otftables.h:99
ClassRangeRecordPtr classRangeRecord
Definition: otftables.h:108
USHORT classRangeCount
Definition: otftables.h:107
USHORT classValue
Definition: otftables.h:91
USHORT endSize
Definition: otftables.h:123
USHORT deltaFormat
Definition: otftables.h:124
USHORT deltaValue[1]
Definition: otftables.h:125
USHORT startSize
Definition: otftables.h:122
FeatureRecord * featureRecord
Definition: otftables.h:51
USHORT featureCount
Definition: otftables.h:50
USHORT lookupCount
Definition: otftables.h:43
USHORT featureParams
Definition: otftables.h:42
USHORT * lookupListIndex
Definition: otftables.h:44
LangSysPtr langSys
Definition: otftables.h:19
USHORT * featureIndex
Definition: otftables.h:12
USHORT reqFeatureIndex
Definition: otftables.h:10
USHORT featureCount
Definition: otftables.h:11
USHORT lookupCount
Definition: otftables.h:341
LookupRecord * lookupRecord
Definition: otftables.h:342
USHORT subTableCount
Definition: otftables.h:325
USHORT markFilteringSet
Definition: otftables.h:326
USHORT lookupFlag
Definition: otftables.h:324
LookupPtr * lookup
Definition: otftables.h:327
ChainOtfRuleSetPtr chainOtfRuleSet
Definition: otftables.h:240
USHORT chainOtfRuleSetCount
Definition: otftables.h:239
USHORT lookupType
Definition: otftables.h:236
CoveragePtr coverage
Definition: otftables.h:238
USHORT chainOtfClassSetCnt
Definition: otftables.h:276
ChainOtfClassSetPtr chainOtfClassSet
Definition: otftables.h:277
ClassDefPtr backtrackClassDef
Definition: otftables.h:273
USHORT lookupType
Definition: otftables.h:270
ClassDefPtr lookaheadClassDef
Definition: otftables.h:275
CoveragePtr coverage
Definition: otftables.h:272
ClassDefPtr inputClassDef
Definition: otftables.h:274
USHORT otfCount
Definition: otftables.h:295
CoveragePtr * input
Definition: otftables.h:292
CoveragePtr * lookahead
Definition: otftables.h:294
CoveragePtr * backtrack
Definition: otftables.h:290
OtfLookupRecordPtr otf
Definition: otftables.h:296
USHORT lookaheadGlyphCount
Definition: otftables.h:293
USHORT backtrackGlyphCount
Definition: otftables.h:289
USHORT inputGlyphCount
Definition: otftables.h:291
USHORT lookupType
Definition: otftables.h:287
USHORT glyphCount
Definition: otftables.h:170
USHORT otfCount
Definition: otftables.h:171
OtfLookupRecordPtr otf
Definition: otftables.h:173
USHORT * class
Definition: otftables.h:172
USHORT otfClassRuleCnt
Definition: otftables.h:179
OtfClassRulePtr otfClassRule
Definition: otftables.h:180
CoveragePtr coverage
Definition: otftables.h:158
OtfRuleSetPtr otfRuleSet
Definition: otftables.h:160
USHORT lookupType
Definition: otftables.h:156
USHORT otfRuleSetCount
Definition: otftables.h:159
ClassDefPtr classDef
Definition: otftables.h:189
OtfClassSetPtr otfClassSet
Definition: otftables.h:191
USHORT otfClassSetCnt
Definition: otftables.h:190
USHORT lookupType
Definition: otftables.h:186
CoveragePtr coverage
Definition: otftables.h:188
USHORT otfCount
Definition: otftables.h:204
CoveragePtr * glyphs
Definition: otftables.h:205
USHORT lookupType
Definition: otftables.h:201
USHORT glyphCount
Definition: otftables.h:203
OtfLookupRecordPtr otf
Definition: otftables.h:206
USHORT lookupListIndex
Definition: otftables.h:134
USHORT sequenceIndex
Definition: otftables.h:133
USHORT lookupType
Definition: otftables.h:309
USHORT lookupFormat
Definition: otftables.h:310
USHORT otfRuleCount
Definition: otftables.h:149
OtfRulePtr otfRule
Definition: otftables.h:150
USHORT otfCount
Definition: otftables.h:141
USHORT glyphCount
Definition: otftables.h:140
OtfLookupRecordPtr otf
Definition: otftables.h:143
USHORT * input
Definition: otftables.h:142
USHORT scriptCount
Definition: otftables.h:34
ScriptRecord * scriptRecord
Definition: otftables.h:35
LangSysPtr defaultLangSys
Definition: otftables.h:26
LangSysRecord * langSysRecord
Definition: otftables.h:28
USHORT langSysCount
Definition: otftables.h:27
ULONG tag
Definition: otftables.h:25
Definition: tfm.c:163
#define FILE
Definition: t1stdio.h:34
int j
Definition: t4ht.c:1589
#define XCALLOC1(t)
Definition: ttfutil.h:60
void ttfError(const char *msg)
Definition: ttfutil.c:32
#define XCALLOC(n, t)
Definition: ttfutil.h:59
char * TagToStr(ULONG tag)
Definition: ttfutil.c:21
ClassDef2Ptr classDef2
Definition: otftables.h:116
USHORT * format
Definition: otftables.h:114
ClassDef1Ptr classDef1
Definition: otftables.h:115
OtfLookupPtr otf
Definition: otftables.h:316