2
* Copyright (C) 2000, 2007 Red Hat, Inc.
4
* This is part of HarfBuzz, an OpenType Layout engine library.
6
* Permission is hereby granted, without written agreement and without
7
* license or royalty fees, to use, copy, modify, and distribute this
8
* software and its documentation for any purpose, provided that the
9
* above copyright notice and the following two paragraphs appear in
10
* all copies of this software.
12
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24
* Red Hat Author(s): Owen Taylor, Behdad Esfahbod
27
#include "harfbuzz-impl.h"
28
#include "harfbuzz-dump.h"
29
#include "harfbuzz-gdef-private.h"
30
#include "harfbuzz-gsub-private.h"
31
#include "harfbuzz-gpos-private.h"
32
#include "harfbuzz-open-private.h"
35
#define DUMP(format) dump (stream, indent, format)
36
#define DUMP1(format, arg1) dump (stream, indent, format, arg1)
37
#define DUMP2(format, arg1, arg2) dump (stream, indent, format, arg1, arg2)
38
#define DUMP3(format, arg1, arg2, arg3) dump (stream, indent, format, arg1, arg2, arg3)
40
#define DUMP_FINT(strct,fld) dump (stream, indent, "<" #fld ">%d</" #fld ">\n", (strct)->fld)
41
#define DUMP_FUINT(strct,fld) dump (stream, indent, "<" #fld ">%u</" #fld ">\n", (strct)->fld)
42
#define DUMP_FGLYPH(strct,fld) dump (stream, indent, "<" #fld ">%#06x</" #fld ">\n", (strct)->fld)
43
#define DUMP_FGLYPH(strct,fld) dump (stream, indent, "<" #fld ">%#06x</" #fld ">\n", (strct)->fld)
44
#define DUMP_USHORT_ARRAY(strct,fld,cnt) Dump_UShort_Array ((strct)->fld, cnt, #fld, stream, indent);
46
#define DEF_DUMP(type) static void Dump_ ## type (HB_ ## type *type, FILE *stream, int indent, HB_Type hb_type)
47
#define RECURSE(name, type, val) do { DUMP ("<" #name ">\n"); Dump_ ## type (val, stream, indent + 1, hb_type); DUMP ("</" #name ">\n"); } while (0)
48
#define RECURSE_NUM(name, i, type, val) do { DUMP1 ("<" #name "> <!-- %d -->\n", i); Dump_ ## type (val, stream, indent + 1, hb_type); DUMP ("</" #name ">\n"); } while (0)
49
#define DUMP_VALUE_RECORD(val, frmt) do { DUMP ("<ValueRecord>\n"); Dump_ValueRecord (val, stream, indent + 1, hb_type, frmt); DUMP ("</ValueRecord>\n"); } while (0)
52
do_indent (FILE *stream, int indent)
54
fprintf (stream, "%*s", indent * 3, "");
58
dump (FILE *stream, int indent, const char *format, ...)
62
do_indent (stream, indent);
64
va_start (list, format);
65
vfprintf (stream, format, list);
70
Dump_UShort_Array (HB_UShort *array, int count, const char *name, FILE *stream, int indent)
74
do_indent (stream, indent);
76
fprintf (stream, "<%s>", name);
77
for (i = 0; i < count; i++)
78
fprintf (stream, "%d%s", array[i], i == 0 ? "" : " ");
79
fprintf (stream, "</%s>\n", name);
83
Print_Tag (HB_UInt tag, FILE *stream)
85
fprintf (stream, "%c%c%c%c",
86
(unsigned char)(tag >> 24),
87
(unsigned char)((tag >> 16) & 0xff),
88
(unsigned char)((tag >> 8) & 0xff),
89
(unsigned char)(tag & 0xff));
98
DUMP_FUINT (LangSys, LookupOrderOffset);
99
DUMP_FUINT (LangSys, ReqFeatureIndex);
100
DUMP_FUINT (LangSys, FeatureCount);
102
for (i=0; i < LangSys->FeatureCount; i++)
103
DUMP1("<FeatureIndex>%d</FeatureIndex>\n", LangSys->FeatureIndex[i]);
106
DEF_DUMP (ScriptTable)
110
RECURSE (DefaultLangSys, LangSys, &ScriptTable->DefaultLangSys);
112
DUMP_FUINT (ScriptTable, LangSysCount);
114
for (i=0; i < ScriptTable->LangSysCount; i++)
116
do_indent (stream, indent);
117
fprintf (stream, "<LangSysTag>");
118
Print_Tag (ScriptTable->LangSysRecord[i].LangSysTag, stream);
119
fprintf (stream, "</LangSysTag>\n");
120
RECURSE_NUM (LangSys, i, LangSys, &ScriptTable->LangSysRecord[i].LangSys);
124
DEF_DUMP (ScriptList)
128
DUMP_FUINT (ScriptList, ScriptCount);
130
for (i=0; i < ScriptList->ScriptCount; i++)
132
do_indent (stream, indent);
133
fprintf (stream, "<ScriptTag>");
134
Print_Tag (ScriptList->ScriptRecord[i].ScriptTag, stream);
135
fprintf (stream, "</ScriptTag>\n");
136
RECURSE_NUM (Script, i, ScriptTable, &ScriptList->ScriptRecord[i].Script);
146
DUMP_FUINT (Feature, FeatureParams);
147
DUMP_FUINT (Feature, LookupListCount);
149
for (i=0; i < Feature->LookupListCount; i++)
150
DUMP1("<LookupIndex>%d</LookupIndex>\n", Feature->LookupListIndex[i]);
153
DEF_DUMP (MarkRecord)
157
DUMP_FUINT (MarkRecord, Class);
158
DUMP1("<Anchor>%d</Anchor>\n", MarkRecord->MarkAnchor.PosFormat );
165
DUMP_FUINT (MarkArray, MarkCount);
167
for (i=0; i < MarkArray->MarkCount; i++)
168
RECURSE_NUM (MarkRecord, i, MarkRecord, &MarkArray->MarkRecord[i]);
171
DEF_DUMP (FeatureList)
175
DUMP_FUINT (FeatureList, FeatureCount);
177
for (i=0; i < FeatureList->FeatureCount; i++)
179
do_indent (stream, indent);
180
fprintf (stream, "<FeatureTag>");
181
Print_Tag (FeatureList->FeatureRecord[i].FeatureTag, stream);
182
fprintf (stream, "</FeatureTag> <!-- %d -->\n", i);
183
RECURSE_NUM (Feature, i, Feature, &FeatureList->FeatureRecord[i].Feature);
191
DUMP_FUINT (Coverage, CoverageFormat);
193
if (Coverage->CoverageFormat == 1)
196
DUMP_FUINT (&Coverage->cf.cf1, GlyphCount);
198
for (i = 0; i < Coverage->cf.cf1.GlyphCount; i++)
199
DUMP2("<Glyph>%#06x</Glyph> <!-- %d -->\n",
200
Coverage->cf.cf1.GlyphArray[i], i);
205
DUMP_FUINT (&Coverage->cf.cf2, RangeCount);
207
for ( i = 0; i < Coverage->cf.cf2.RangeCount; i++ )
208
DUMP3("<Glyph>%#06x - %#06x</Glyph> <!-- %d -->\n",
209
Coverage->cf.cf2.RangeRecord[i].Start,
210
Coverage->cf.cf2.RangeRecord[i].End, i);
214
DEF_DUMP (ClassRangeRecord)
218
DUMP_FGLYPH (ClassRangeRecord, Start);
219
DUMP_FGLYPH (ClassRangeRecord, End);
220
DUMP_FUINT (ClassRangeRecord, Class);
223
DEF_DUMP (ClassDefinition)
227
DUMP_FUINT( ClassDefinition, ClassFormat);
228
DUMP_FUINT( ClassDefinition, loaded);
230
if (ClassDefinition->ClassFormat == 1)
233
HB_ClassDefFormat1 *ClassDefFormat1 = &ClassDefinition->cd.cd1;
234
DUMP("<ClassDefinition>\n");
235
DUMP_FUINT (ClassDefFormat1, StartGlyph );
236
DUMP_FUINT (ClassDefFormat1, GlyphCount );
237
for (i = 0; i < ClassDefFormat1->GlyphCount; i++)
238
DUMP2(" <Class>%d</Class> <!-- %#06x -->", ClassDefFormat1->ClassValueArray[i],
239
ClassDefFormat1->StartGlyph+i );
241
else if (ClassDefinition->ClassFormat == 2)
244
HB_ClassDefFormat2 *ClassDefFormat2 = &ClassDefinition->cd.cd2;
245
DUMP_FUINT (ClassDefFormat2, ClassRangeCount);
247
for (i = 0; i < ClassDefFormat2->ClassRangeCount; i++)
248
RECURSE_NUM (ClassRangeRecord, i, ClassRangeRecord, &ClassDefFormat2->ClassRangeRecord[i]);
251
fprintf(stderr, "invalid class def table!!!\n");
254
DEF_DUMP (SubstLookupRecord)
258
DUMP_FUINT (SubstLookupRecord, SequenceIndex);
259
DUMP_FUINT (SubstLookupRecord, LookupListIndex);
262
DEF_DUMP (ChainSubClassRule)
266
DUMP_USHORT_ARRAY (ChainSubClassRule, Backtrack, ChainSubClassRule->BacktrackGlyphCount);
267
DUMP_USHORT_ARRAY (ChainSubClassRule, Input, ChainSubClassRule->InputGlyphCount - 1);
268
DUMP_USHORT_ARRAY (ChainSubClassRule, Lookahead, ChainSubClassRule->LookaheadGlyphCount);
270
for (i = 0; i < ChainSubClassRule->SubstCount; i++)
271
RECURSE_NUM (SubstLookupRecord, i, SubstLookupRecord, &ChainSubClassRule->SubstLookupRecord[i]);
276
DEF_DUMP (ChainSubClassSet)
280
DUMP_FUINT( ChainSubClassSet, ChainSubClassRuleCount );
281
for (i = 0; i < ChainSubClassSet->ChainSubClassRuleCount; i++)
282
RECURSE_NUM (ChainSubClassRule, i, ChainSubClassRule, &ChainSubClassSet->ChainSubClassRule[i]);
286
Dump_GSUB_Lookup_Single (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
288
HB_SingleSubst *SingleSubst = &subtable->st.gsub.single;
290
DUMP_FUINT (SingleSubst, SubstFormat);
291
RECURSE (Coverage, Coverage, &SingleSubst->Coverage);
293
if (SingleSubst->SubstFormat == 1)
295
DUMP_FINT (&SingleSubst->ssf.ssf1, DeltaGlyphID);
301
DUMP_FINT (&SingleSubst->ssf.ssf2, GlyphCount);
302
for (i=0; i < SingleSubst->ssf.ssf2.GlyphCount; i++)
303
DUMP2("<Substitute>%#06x</Substitute> <!-- %d -->\n", SingleSubst->ssf.ssf2.Substitute[i], i);
313
DUMP_FGLYPH (Ligature, LigGlyph);
314
DUMP_FUINT (Ligature, ComponentCount);
316
for (i=0; i < Ligature->ComponentCount - 1; i++)
317
DUMP1("<Component>%#06x</Component>\n", Ligature->Component[i]);
320
DEF_DUMP (LigatureSet)
324
DUMP_FUINT (LigatureSet, LigatureCount);
326
for (i=0; i < LigatureSet->LigatureCount; i++)
327
RECURSE_NUM (Ligature, i, Ligature, &LigatureSet->Ligature[i]);
331
Dump_GSUB_Lookup_Ligature (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
334
HB_LigatureSubst *LigatureSubst = &subtable->st.gsub.ligature;
336
DUMP_FUINT (LigatureSubst, SubstFormat);
337
RECURSE (Coverage, Coverage, &LigatureSubst->Coverage);
339
DUMP_FUINT (LigatureSubst, LigatureSetCount);
341
for (i=0; i < LigatureSubst->LigatureSetCount; i++)
342
RECURSE_NUM (LigatureSet, i, LigatureSet, &LigatureSubst->LigatureSet[i]);
345
DEF_DUMP (ContextSubstFormat1)
348
HB_UNUSED(ContextSubstFormat1);
351
DUMP("<!-- Not implemented!!! -->\n");
354
DEF_DUMP (ContextSubstFormat2)
356
DUMP_FUINT (ContextSubstFormat2, MaxContextLength);
357
RECURSE (Coverage, Coverage, &ContextSubstFormat2->Coverage);
358
RECURSE (ClassDefinition, ClassDefinition, &ContextSubstFormat2->ClassDef);
361
DEF_DUMP (ContextSubstFormat3)
364
HB_UNUSED(ContextSubstFormat3);
366
DUMP("<!-- Not implemented!!! -->\n");
370
Dump_GSUB_Lookup_Context (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
372
HB_ContextSubst *ContextSubst = &subtable->st.gsub.context;
374
DUMP_FUINT (ContextSubst, SubstFormat);
375
switch( ContextSubst->SubstFormat )
378
Dump_ContextSubstFormat1 (&ContextSubst->csf.csf1, stream, indent+2, hb_type);
381
Dump_ContextSubstFormat2 (&ContextSubst->csf.csf2, stream, indent+2, hb_type);
384
Dump_ContextSubstFormat3 (&ContextSubst->csf.csf3, stream, indent+2, hb_type);
387
fprintf(stderr, "invalid subformat!!!!!\n");
391
DEF_DUMP (ChainContextSubstFormat1)
394
HB_UNUSED(ChainContextSubstFormat1);
396
DUMP("<!-- Not implemented!!! -->\n");
399
DEF_DUMP (ChainContextSubstFormat2)
403
RECURSE (Coverage, Coverage, &ChainContextSubstFormat2->Coverage);
404
DUMP_FUINT (ChainContextSubstFormat2, MaxBacktrackLength);
405
RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->BacktrackClassDef);
406
DUMP_FUINT (ChainContextSubstFormat2, MaxInputLength);
407
RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->InputClassDef);
408
DUMP_FUINT (ChainContextSubstFormat2, MaxLookaheadLength);
409
RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->LookaheadClassDef);
411
DUMP_FUINT (ChainContextSubstFormat2, ChainSubClassSetCount);
412
for (i = 0; i < ChainContextSubstFormat2->ChainSubClassSetCount; i++)
413
RECURSE (ChainSubClassSet, ChainSubClassSet, &ChainContextSubstFormat2->ChainSubClassSet[i]);
416
DEF_DUMP (ChainContextSubstFormat3)
420
DUMP_FUINT (ChainContextSubstFormat3, BacktrackGlyphCount);
421
for (i = 0; i < ChainContextSubstFormat3->BacktrackGlyphCount; i++)
422
RECURSE (BacktrackCoverage, Coverage, &ChainContextSubstFormat3->BacktrackCoverage[i]);
423
DUMP_FUINT (ChainContextSubstFormat3, InputGlyphCount);
424
for (i = 0; i < ChainContextSubstFormat3->InputGlyphCount; i++)
425
RECURSE (InputCoverage, Coverage, &ChainContextSubstFormat3->InputCoverage[i]);
426
DUMP_FUINT (ChainContextSubstFormat3, LookaheadGlyphCount);
427
for (i = 0; i < ChainContextSubstFormat3->LookaheadGlyphCount; i++)
428
RECURSE (LookaheadCoverage, Coverage, &ChainContextSubstFormat3->LookaheadCoverage[i]);
430
for (i = 0; i < ChainContextSubstFormat3->SubstCount; i++)
431
RECURSE_NUM (SubstLookupRecord, i, SubstLookupRecord, &ChainContextSubstFormat3->SubstLookupRecord[i]);
436
Dump_GSUB_Lookup_Chain (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
438
HB_ChainContextSubst *chain = &subtable->st.gsub.chain;
440
DUMP_FUINT (chain, SubstFormat);
441
switch (chain->SubstFormat)
444
Dump_ChainContextSubstFormat1 (&chain->ccsf.ccsf1, stream, indent+2, hb_type);
447
Dump_ChainContextSubstFormat2 (&chain->ccsf.ccsf2, stream, indent+2, hb_type);
450
Dump_ChainContextSubstFormat3 (&chain->ccsf.ccsf3, stream, indent+2, hb_type);
453
fprintf(stderr, "invalid subformat!!!!!\n");
458
Dump_Device (HB_Device *Device, FILE *stream, int indent, HB_Type hb_type)
467
DUMP_FUINT (Device, StartSize);
468
DUMP_FUINT (Device, EndSize);
469
DUMP_FUINT (Device, DeltaFormat);
470
switch (Device->DeltaFormat)
486
DUMP ("<DeltaValue>");
490
fprintf(stderr, "invalid DeltaFormat!!!!!\n");
495
mask = (1 << bits) - 1;
496
mask = mask << (16 - bits);
498
for (i = Device->StartSize; i <= Device->EndSize ; i++)
500
HB_UShort val = Device->DeltaValue[i / n_per];
501
HB_Short signed_val = ((val << ((i % n_per) * bits)) & mask);
502
dump (stream, indent, "%d", signed_val >> (16 - bits));
503
if (i != Device->EndSize)
507
DUMP ("</DeltaValue>\n");
511
Dump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort value_format)
513
if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT)
514
DUMP_FINT (ValueRecord, XPlacement);
515
if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT)
516
DUMP_FINT (ValueRecord, YPlacement);
517
if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE)
518
DUMP_FINT (ValueRecord, XAdvance);
519
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE)
520
DUMP_FINT (ValueRecord, XAdvance);
521
if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE)
522
RECURSE (Device, Device, &ValueRecord->XPlacementDevice);
523
if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE)
524
RECURSE (Device, Device, &ValueRecord->YPlacementDevice);
525
if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE)
526
RECURSE (Device, Device, &ValueRecord->XAdvanceDevice);
527
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE)
528
RECURSE (Device, Device, &ValueRecord->YAdvanceDevice);
529
if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT)
530
DUMP_FUINT (ValueRecord, XIdPlacement);
531
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT)
532
DUMP_FUINT (ValueRecord, YIdPlacement);
533
if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE)
534
DUMP_FUINT (ValueRecord, XIdAdvance);
535
if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE)
536
DUMP_FUINT (ValueRecord, XIdAdvance);
540
Dump_GPOS_Lookup_Single (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
542
HB_SinglePos *SinglePos = &subtable->st.gpos.single;
544
DUMP_FUINT (SinglePos, PosFormat);
545
RECURSE (Coverage, Coverage, &SinglePos->Coverage);
547
DUMP_FUINT (SinglePos, ValueFormat);
549
if (SinglePos->PosFormat == 1)
551
DUMP_VALUE_RECORD (&SinglePos->spf.spf1.Value, SinglePos->ValueFormat);
557
DUMP_FUINT (&SinglePos->spf.spf2, ValueCount);
558
for (i = 0; i < SinglePos->spf.spf2.ValueCount; i++)
559
DUMP_VALUE_RECORD (&SinglePos->spf.spf2.Value[i], SinglePos->ValueFormat);
564
Dump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2)
566
DUMP_FUINT (PairValueRecord, SecondGlyph);
567
DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1);
568
DUMP_VALUE_RECORD (&PairValueRecord->Value2, ValueFormat2);
572
Dump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2)
575
DUMP_FUINT (PairSet, PairValueCount);
577
for (i = 0; i < PairSet->PairValueCount; i++)
579
DUMP ("<PairValueRecord>\n");
580
Dump_PairValueRecord (&PairSet->PairValueRecord[i], stream, indent + 1, hb_type, ValueFormat1, ValueFormat2);
581
DUMP ("</PairValueRecord>\n");
586
Dump_GPOS_Lookup_Pair (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
588
HB_PairPos *PairPos = &subtable->st.gpos.pair;
590
DUMP_FUINT (PairPos, PosFormat);
591
RECURSE (Coverage, Coverage, &PairPos->Coverage);
593
DUMP_FUINT (PairPos, ValueFormat1);
594
DUMP_FUINT (PairPos, ValueFormat2);
596
if (PairPos->PosFormat == 1)
600
DUMP_FUINT (&PairPos->ppf.ppf1, PairSetCount);
601
for (i = 0; i < PairPos->ppf.ppf1.PairSetCount; i++)
603
DUMP ("<PairSet>\n");
604
Dump_PairSet (&PairPos->ppf.ppf1.PairSet[i], stream, indent + 1, hb_type, PairPos->ValueFormat1, PairPos->ValueFormat2);
605
DUMP ("</PairSet>\n");
614
Dump_GPOS_Lookup_Markbase (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type)
617
HB_MarkBasePos *markbase = &subtable->st.gpos.markbase;
619
DUMP_FUINT (markbase, PosFormat);
620
RECURSE (Coverage, Coverage, &markbase->MarkCoverage);
621
RECURSE (Coverage, Coverage, &markbase->BaseCoverage);
622
DUMP_FUINT (markbase, ClassCount);
623
RECURSE (MarkArray, MarkArray, &markbase->MarkArray);
625
DUMP ("<BaseArray>\n");
628
DUMP_FUINT (&markbase->BaseArray, BaseCount);
629
for (i = 0; i < markbase->BaseArray.BaseCount; i++)
632
HB_BaseRecord *r = &markbase->BaseArray.BaseRecord[i];
633
DUMP1 ("<BaseRecord> <!-- %d -->\n", i);
634
for (j = 0; j < markbase->ClassCount; j++)
635
DUMP1 (" <Anchor>%d</Anchor>\n", r->BaseAnchor->PosFormat);
636
DUMP ("<BaseRecord>\n");
640
DUMP ("</BaseArray>\n");
646
const char *lookup_name;
647
void (*lookup_func) (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type) = NULL;
649
if (hb_type == HB_Type_GSUB)
651
switch (Lookup->LookupType)
653
case HB_GSUB_LOOKUP_SINGLE:
654
lookup_name = "SINGLE";
655
lookup_func = Dump_GSUB_Lookup_Single;
657
case HB_GSUB_LOOKUP_MULTIPLE:
658
lookup_name = "MULTIPLE";
660
case HB_GSUB_LOOKUP_ALTERNATE:
661
lookup_name = "ALTERNATE";
663
case HB_GSUB_LOOKUP_LIGATURE:
664
lookup_name = "LIGATURE";
665
lookup_func = Dump_GSUB_Lookup_Ligature;
667
case HB_GSUB_LOOKUP_CONTEXT:
668
lookup_name = "CONTEXT";
669
lookup_func = Dump_GSUB_Lookup_Context;
671
case HB_GSUB_LOOKUP_CHAIN:
672
lookup_name = "CHAIN";
673
lookup_func = Dump_GSUB_Lookup_Chain;
676
lookup_name = "(unknown)";
683
switch (Lookup->LookupType)
685
case HB_GPOS_LOOKUP_SINGLE:
686
lookup_name = "SINGLE";
687
lookup_func = Dump_GPOS_Lookup_Single;
689
case HB_GPOS_LOOKUP_PAIR:
690
lookup_name = "PAIR";
691
lookup_func = Dump_GPOS_Lookup_Pair;
693
case HB_GPOS_LOOKUP_CURSIVE:
694
lookup_name = "CURSIVE";
696
case HB_GPOS_LOOKUP_MARKBASE:
697
lookup_name = "MARKBASE";
698
lookup_func = Dump_GPOS_Lookup_Markbase;
700
case HB_GPOS_LOOKUP_MARKLIG:
701
lookup_name = "MARKLIG";
703
case HB_GPOS_LOOKUP_MARKMARK:
704
lookup_name = "MARKMARK";
706
case HB_GPOS_LOOKUP_CONTEXT:
707
lookup_name = "CONTEXT";
709
case HB_GPOS_LOOKUP_CHAIN:
710
lookup_name = "CHAIN";
713
lookup_name = "(unknown)";
719
DUMP2("<LookupType>%s</LookupType> <!-- %d -->\n", lookup_name, Lookup->LookupType);
720
DUMP1("<LookupFlag>%#06x</LookupFlag>\n", Lookup->LookupFlag);
722
for (i=0; i < Lookup->SubTableCount; i++)
724
DUMP ("<Subtable>\n");
726
(*lookup_func) (&Lookup->SubTable[i], stream, indent + 1, hb_type);
727
DUMP ("</Subtable>\n");
731
DEF_DUMP (LookupList)
735
DUMP_FUINT (LookupList, LookupCount);
737
for (i=0; i < LookupList->LookupCount; i++)
738
RECURSE_NUM (Lookup, i, Lookup, &LookupList->Lookup[i]);
742
HB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream)
745
HB_Type hb_type = HB_Type_GSUB;
747
do_indent (stream, indent);
748
fprintf(stream, "<!-- GSUB -->\n");
749
RECURSE (ScriptList, ScriptList, &gsub->ScriptList);
750
RECURSE (FeatureList, FeatureList, &gsub->FeatureList);
751
RECURSE (LookupList, LookupList, &gsub->LookupList);
755
HB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream)
758
HB_Type hb_type = HB_Type_GPOS;
760
do_indent (stream, indent);
761
fprintf(stream, "<!-- GPOS -->\n");
762
RECURSE (ScriptList, ScriptList, &gpos->ScriptList);
763
RECURSE (FeatureList, FeatureList, &gpos->FeatureList);
764
RECURSE (LookupList, LookupList, &gpos->LookupList);