10 char *indent_spaces[] =
11 { "", " ", " ", " ", " ", " ", " ",
15 #define IPRINT printf("\n%s", indent_spaces[indent]), printf
18 dump_tag (OTF_Tag tag)
22 putchar ((tag >> 16) & 0xFF);
23 putchar ((tag >> 8) & 0xFF);
25 printf ("\" #x%04X)", tag);
31 dump_offset_table (int indent, OTF_OffsetTable *table)
33 IPRINT ("(OffsetTable");
35 IPRINT ("(sfnt-version %d.%d)",
36 table->sfnt_version.high, table->sfnt_version.low);
37 IPRINT ("(numTables %d)", table->numTables);
38 IPRINT ("(searchRange %d)", table->searchRange);
39 IPRINT ("(enterSelector %d)", table->enterSelector);
40 IPRINT ("(rangeShift %d))", table->rangeShift);
44 dump_table_directory (int indent, OTF_TableDirectory *table, int idx)
46 IPRINT ("(Table %d ", idx);
47 dump_tag (table->tag);
49 IPRINT ("(checkSum %08X) (offset #x%08X) (length: #x%08X))",
50 table->checkSum, table->offset, table->length);
57 dump_head_table (int indent, OTF_head *head)
61 IPRINT ("(TableVersionNumber %d.%d)",
62 head->TableVersionNumber.high, head->TableVersionNumber.low);
63 IPRINT ("(fontRevision %d.%d)",
64 head->fontRevision.high, head->fontRevision.low);
65 IPRINT ("(checkSumAdjustment #x%04X)", head->checkSumAdjustment);
66 IPRINT ("(magicNumber #x%04X)", head->magicNumber);
67 IPRINT ("(flags #x%04X)", head->flags);
68 IPRINT ("(unitsPerEm %d)", head->unitsPerEm);
76 dump_glyph_ids (OTF_GlyphID *ids, unsigned num)
80 printf (" #x%04X", *ids);
86 dump_coverage (int indent, char *title, OTF_Coverage *coverage)
90 IPRINT ("(%sCoverage (CoverageFormat %d)",
91 (title ? title : ""), coverage->CoverageFormat);
93 if (coverage->CoverageFormat == 1)
95 IPRINT ("(GlyphCount %d)", coverage->Count);
96 IPRINT ("(GlyphArray");
97 dump_glyph_ids (coverage->table.GlyphArray, coverage->Count);
102 IPRINT ("(RangeCount %d)", coverage->Count);
104 for (i = 0; i < coverage->Count; i++)
106 IPRINT ("(Range (%d) (Start #x%04X) (End #x%04X)", i,
107 coverage->table.RangeRecord[i].Start,
108 coverage->table.RangeRecord[i].End);
110 IPRINT ("(StartCoverageIndex %d))",
111 coverage->table.RangeRecord[i].StartCoverageIndex);
119 dump_coverage_list (int indent, char *title,
120 OTF_Coverage *coverage, unsigned num)
124 IPRINT ("(%s %d)", title, num);
125 for (i = 0; i < num; i++)
126 dump_coverage (indent, NULL, coverage + i);
131 dump_language_system (int indent, int index, OTF_Tag tag, OTF_Offset offset,
132 OTF_LangSys *langsys)
136 IPRINT ("(LangSys ");
138 printf ("(%d) ", index);
142 printf ("DefaultLangSys");
143 printf (" (Offset #x%04X)", offset);
145 IPRINT ("(LookupOrder #x%04X)", langsys->LookupOrder);
146 IPRINT ("(ReqFeatureIndex %d)", langsys->ReqFeatureIndex);
147 IPRINT ("(FeatureCount %d)", langsys->FeatureCount);
148 if (langsys->FeatureCount)
150 IPRINT ("(FeatureIndex");
151 for (i = 0; i < langsys->FeatureCount; i++)
152 printf (" %d", langsys->FeatureIndex[i]);
159 dump_script_list (int indent, OTF_ScriptList *list)
163 IPRINT ("(ScriptList (count %d)", list->ScriptCount);
165 for (i = 0; i < list->ScriptCount; i++)
167 OTF_Script *script = list->Script + i;
169 IPRINT ("(Script (%d) ", i);
170 dump_tag (list->Script[i].ScriptTag);
171 printf (" (Offset #x%04X)", list->Script[i].offset);
173 IPRINT ("(DefaultLangSysOffset #x%04X)",
174 script->DefaultLangSysOffset);
175 if (script->DefaultLangSysOffset)
176 dump_language_system (indent, -1, 0,
177 script->DefaultLangSysOffset,
178 &script->DefaultLangSys);
179 IPRINT ("(LangSysCount %d)", script->LangSysCount);
180 for (j = 0; j < script->LangSysCount; j++)
181 dump_language_system (indent, j,
182 script->LangSysRecord[j].LangSysTag,
183 script->LangSysRecord[j].LangSys,
184 script->LangSys + j);
192 dump_feature_list (int indent, OTF_FeatureList *list)
196 IPRINT ("(FeatureList (count %d)", list->FeatureCount);
198 for (i = 0; i < list->FeatureCount; i++)
200 OTF_Feature *feature = list->Feature + i;
202 IPRINT ("(Feature (%d) ", i);
203 dump_tag (list->Feature[i].FeatureTag);
204 printf (" (Offset #x%04X)", list->Feature[i].offset);
205 printf (" (LookupCount %d)", feature->LookupCount);
206 if (feature->LookupCount)
209 IPRINT ("(LookupListIndex");
210 for (j = 0; j < feature->LookupCount; j++)
211 printf (" %d", feature->LookupListIndex[j]);
221 dump_class_def (int indent, char *title, OTF_ClassDef *class)
223 IPRINT ("(%s (offset #x%04X) (ClassFormat %d)",
224 (title ? title : "ClassDef"),
225 class->offset, class->ClassFormat);
227 if (class->ClassFormat == 1)
229 IPRINT ("(StartGlyph #x%04X)", class->f.f1.StartGlyph);
230 IPRINT ("(GlyphCount %d)", class->f.f1.GlyphCount);
231 IPRINT ("(ClassValueArray");
232 dump_glyph_ids ((OTF_GlyphID *) class->f.f1.ClassValueArray,
233 class->f.f1.GlyphCount);
236 else if (class->ClassFormat == 2)
240 IPRINT ("(ClassRangeCount %d)", class->f.f2.ClassRangeCount);
241 IPRINT ("(ClassRangeRecord");
243 for (i = 0; i < class->f.f2.ClassRangeCount; i++)
244 IPRINT ("((Start #x%04X) (End #x%04X) (class %d))",
245 class->f.f2.ClassRangeRecord[i].Start,
246 class->f.f2.ClassRangeRecord[i].End,
247 class->f.f2.ClassRangeRecord[i].Class);
251 printf ("UknownClassFormat");
256 dump_device_table (int indent, char *title, OTF_DeviceTable *table)
262 IPRINT ("(%s (offset #x%04X)", title, table->offset);
264 IPRINT ("(StartSize %d) (EndSize %d) (DeltaFormat %d)",
265 table->StartSize, table->EndSize, table->DeltaFormat);
266 IPRINT ("(DeltaValue");
267 for (i = 0; i < table->EndSize - table->StartSize + 1; i++)
268 printf (" %d", table->DeltaValue[i]);
275 dump_value_record (int indent, char *title, OTF_ValueRecord *rec)
277 IPRINT ("(%s %d %d %d %d", title,
278 rec->XPlacement, rec->YPlacement, rec->XAdvance, rec->YAdvance);
280 if (rec->XPlaDevice.offset)
281 dump_device_table (indent, "XPlaDevice", &rec->XPlaDevice);
282 if (rec->YPlaDevice.offset)
283 dump_device_table (indent, "YPlaDevice", &rec->YPlaDevice);
284 if (rec->XAdvDevice.offset)
285 dump_device_table (indent, "XAdvDevice", &rec->XAdvDevice);
286 if (rec->YAdvDevice.offset)
287 dump_device_table (indent, "YAdvDevice", &rec->YAdvDevice);
293 dump_sequence_list (int indent, OTF_Sequence *sequence, unsigned num)
296 IPRINT ("(SequenceCount %d)", num);
298 for (i = 0; i < num; i++)
300 IPRINT ("(Sequence (%d) (offset #x%04X)",
301 i, sequence[i].offset);
303 IPRINT ("(GlyphCount %d)", sequence[i].GlyphCount);
304 IPRINT ("(Substitute");
305 dump_glyph_ids (sequence[i].Substitute, sequence[i].GlyphCount);
312 dump_ligature_set_list (int indent, OTF_LigatureSet *ligset, unsigned num)
316 IPRINT ("(LigSetCount %d)", num);
317 for (i = 0; i < num; i++)
319 IPRINT ("(LigatureSet (%d) (offset #x%04X) (count %d)",
320 i, ligset[i].offset, ligset[i].LigatureCount);
322 for (j = 0; j < ligset[i].LigatureCount; j++)
324 IPRINT ("(Ligature (%d) (offset #x%04X)",
325 j, ligset[i].Ligature[j].offset);
327 IPRINT ("(LigGlyph #x%04X)",
328 ligset[i].Ligature[j].LigGlyph);
329 IPRINT ("(ComCount %d)",
330 ligset[i].Ligature[j].CompCount);
331 IPRINT ("(Component");
332 dump_glyph_ids (ligset[i].Ligature[j].Component,
333 ligset[i].Ligature[j].CompCount - 1);
343 dump_class1_record_list (int indent,
344 unsigned Class1Count, unsigned Class2Count,
345 OTF_Class1Record *rec)
349 for (i = 0; i < Class1Count; i++)
351 IPRINT ("(Class1Record (%d)", i);
353 for (j = 0; j < Class2Count; j++)
355 IPRINT ("(Class2Record (%d)", j);
357 dump_value_record (indent, "Value1", &rec[i].Class2Record[j].Value1);
358 dump_value_record (indent, "Value2", &rec[i].Class2Record[j].Value2);
368 dump_anchor (int indent, OTF_Anchor *anchor)
370 IPRINT ("(Anchor (offset #x%04X) (AnchorFormat %d)",
371 anchor->offset, anchor->AnchorFormat);
373 IPRINT ("(XCoordinate %d) (YCoordinate %d)",
374 anchor->XCoordinate, anchor->YCoordinate);
375 if (anchor->AnchorFormat == 1)
377 else if (anchor->AnchorFormat == 2)
378 IPRINT ("(AnchorPoint %d)", anchor->f.f1.AnchorPoint);
381 dump_device_table (indent, "XDeviceTable", &anchor->f.f2.XDeviceTable);
382 dump_device_table (indent, "YDeviceTable", &anchor->f.f2.YDeviceTable);
388 dump_mark_array (int indent, OTF_MarkArray *array)
392 IPRINT ("(MarkArray (MarkCount %d)", array->MarkCount);
394 for (i = 0; i < array->MarkCount; i++)
396 IPRINT ("(MarkRecord (%d) (Class %d)", i, array->MarkRecord[i].Class);
397 dump_anchor (indent + 1, &array->MarkRecord[i].MarkAnchor);
404 dump_base_array (int indent, unsigned ClassCount, OTF_BaseArray *array)
408 IPRINT ("(BaseArray (BaseCount %d)", array->BaseCount);
410 for (i = 0; i < array->BaseCount; i++)
412 IPRINT ("(BaseRecord (%d) ", i);
413 for (j = 0; j < ClassCount; j++)
414 dump_anchor (indent + 1, array->BaseRecord[i].BaseAnchor + j);
422 dump_subst_lookup_record_list (int indent,
423 OTF_SubstLookupRecord *rec, unsigned num)
427 IPRINT ("(SubstCount %d)", num);
428 for (i = 0; i < num; i++)
430 IPRINT ("(SubstLookupRecord (%d)", i);
432 IPRINT ("(SequenceIndex %d)", rec[i].SequenceIndex);
433 IPRINT ("(LookupListIndex %d))", rec[i].LookupListIndex);
439 static void dump_lookup_subtable_gsub (int indent, int index, unsigned type,
440 OTF_LookupSubTable *subtable);
441 static void dump_lookup_subtable_gpos (int indent, int index, unsigned type,
442 OTF_LookupSubTable *subtable);
446 dump_lookup_list (int indent, OTF_LookupList *list, int gsub)
450 IPRINT ("(LookupList (count %d)", list->LookupCount);
452 for (i = 0; i < list->LookupCount; i++)
454 OTF_Lookup *lookup = list->Lookup + i;
456 IPRINT ("(Lookup (%d) (Offset #x%04X)",
458 printf (" (Type %d) (Flag #x%04X) (SubTableCount %d)",
459 lookup->LookupType, lookup->LookupFlag, lookup->SubTableCount);
461 for (j = 0; j < lookup->SubTableCount; j++)
462 dump_lookup_subtable_gsub (indent + 1, j,
463 lookup->LookupType, lookup->SubTable + j);
465 for (j = 0; j < lookup->SubTableCount; j++)
466 dump_lookup_subtable_gpos (indent + 1, j,
467 lookup->LookupType, lookup->SubTable + j);
479 dump_lookup_subtable_gsub (int indent, int index, unsigned type,
480 OTF_LookupSubTable *subtable)
482 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
487 if (subtable->Format == 1)
489 dump_coverage (indent, NULL, &subtable->Coverage);
490 IPRINT ("(DeltaGlyhpID #x%04X)",
491 subtable->sub.gsub.single1.DeltaGlyphID);
493 else if (subtable->Format == 2)
495 dump_coverage (indent, NULL, &subtable->Coverage);
496 IPRINT ("(GlyphCount %d)",
497 subtable->sub.gsub.single2.GlyphCount);
498 IPRINT ("(Substitute");
499 dump_glyph_ids (subtable->sub.gsub.single2.Substitute,
500 subtable->sub.gsub.single2.GlyphCount);
506 if (subtable->Format == 1)
508 dump_coverage (indent, NULL, &subtable->Coverage);
509 dump_sequence_list (indent,
510 subtable->sub.gsub.multiple1.Sequence,
511 subtable->sub.gsub.multiple1.SequenceCount);
516 if (subtable->Format == 1)
518 dump_coverage (indent, NULL, &subtable->Coverage);
519 dump_ligature_set_list (indent,
520 subtable->sub.gsub.ligature1.LigatureSet,
521 subtable->sub.gsub.ligature1.LigSetCount);
526 if (subtable->Format == 1)
529 read_coverage (fp, offset,
530 &subtable->sub.gsub.chain_context1.Coverage);
531 subtable->sub.gsub.chain_context1.ChainSubRuleSetCount
532 = (read_chain_subrule_set
534 &subtable->sub.gsub.chain_context1.ChainSubRuleSet));
537 else if (subtable->Format == 2)
540 read_coverage (fp, offset,
541 &subtable->sub.gsub.chain_context2.Coverage);
542 read_class_def (fp, offset,
543 &subtable->sub.gsub.chain_context2.Backtrack);
544 read_class_def (fp, offset,
545 &subtable->sub.gsub.chain_context2.Input);
546 read_class_def (fp, offset,
547 &subtable->sub.gsub.chain_context2.LookAhead);
548 subtable->sub.gsub.chain_context2.ChainSubClassSetCnt
549 = (read_chain_subclass_set
551 &subtable->sub.gsub.chain_context2.ChainSubClassSet));
554 else if (subtable->Format == 3)
557 (indent, "BackTrackGlyphCount",
558 subtable->sub.gsub.chain_context3.Backtrack,
559 subtable->sub.gsub.chain_context3.BacktrackGlyphCount);
561 (indent, "InputGlyphCount",
562 subtable->sub.gsub.chain_context3.Input,
563 subtable->sub.gsub.chain_context3.InputGlyphCount);
565 (indent, "LookaheaGlyphCount",
566 subtable->sub.gsub.chain_context3.LookAhead,
567 subtable->sub.gsub.chain_context3.LookaheadGlyphCount);
568 dump_subst_lookup_record_list
570 subtable->sub.gsub.chain_context3.SubstLookupRecord,
571 subtable->sub.gsub.chain_context3.SubstCount);
579 dump_gsub_table (int indent, OTF_GSUB *gsub)
585 IPRINT ("(Version %d.%d)", gsub->Version.high, gsub->Version.low);
586 IPRINT ("(ScriptList #x%04X)", gsub->ScriptList.offset);
587 IPRINT ("(FeatureList #x%04X)", gsub->FeatureList.offset);
588 IPRINT ("(LookupList #x%04X))", gsub->LookupList.offset);
590 dump_script_list (indent, &gsub->ScriptList);
591 dump_feature_list (indent, &gsub->FeatureList);
592 dump_lookup_list (indent, &gsub->LookupList, 1);
600 dump_lookup_subtable_gpos (int indent, int index, unsigned type,
601 OTF_LookupSubTable *subtable)
603 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
609 if (subtable->Format == 1)
611 dump_coverage (indent, NULL, &subtable->sub.gpos.single1.Coverage);
612 IPRINT ("(DeltaGlyhpID #x%04X)",
613 subtable->sub.gsub.single1.DeltaGlyphID);
615 else if (subtable->Format == 2)
617 dump_coverage (indent, NULL, &subtable->sub.gsub.single2.Coverage);
618 IPRINT ("(GlyphCount %d)",
619 subtable->sub.gsub.single2.GlyphCount);
620 IPRINT ("(Substitute");
621 dump_glyph_ids (subtable->sub.gsub.single2.Substitute,
622 subtable->sub.gsub.single2.GlyphCount);
629 if (subtable->Format == 1)
631 dump_coverage (indent, NULL, &subtable->Coverage);
633 else if (subtable->Format == 2)
635 dump_coverage (indent, NULL, &subtable->Coverage);
636 IPRINT ("(ValueFormat1 #x%04X)",
637 subtable->sub.gpos.pair2.ValueFormat1);
638 IPRINT ("(ValueFormat2 #x%04X)",
639 subtable->sub.gpos.pair2.ValueFormat2);
640 dump_class_def (indent, "ClassDef1",
641 &subtable->sub.gpos.pair2.ClassDef1);
642 dump_class_def (indent, "ClassDef2",
643 &subtable->sub.gpos.pair2.ClassDef2);
644 IPRINT ("(Class1Count %d)",
645 subtable->sub.gpos.pair2.Class1Count);
646 IPRINT ("(Class2Count %d)",
647 subtable->sub.gpos.pair2.Class2Count);
648 dump_class1_record_list (indent,
649 subtable->sub.gpos.pair2.Class1Count,
650 subtable->sub.gpos.pair2.Class2Count,
651 subtable->sub.gpos.pair2.Class1Record);
656 if (subtable->Format == 1)
658 dump_coverage (indent, "Mark", &subtable->Coverage);
659 dump_coverage (indent, "Base",
660 &subtable->sub.gpos.mark_base1.BaseCoverage);
661 IPRINT ("(ClassCount %d)",
662 subtable->sub.gpos.mark_base1.ClassCount);
663 dump_mark_array (indent, &subtable->sub.gpos.mark_base1.MarkArray);
664 dump_base_array (indent, subtable->sub.gpos.mark_base1.ClassCount,
665 &subtable->sub.gpos.mark_base1.BaseArray);
670 if (subtable->Format == 1)
673 read_coverage (fp, offset,
674 &subtable->sub.gsub.chain_context1.Coverage);
675 subtable->sub.gsub.chain_context1.ChainSubRuleSetCount
676 = (read_chain_subrule_set
678 &subtable->sub.gsub.chain_context1.ChainSubRuleSet));
681 else if (subtable->Format == 2)
684 read_coverage (fp, offset,
685 &subtable->sub.gsub.chain_context2.Coverage);
686 read_class_def (fp, offset,
687 &subtable->sub.gsub.chain_context2.Backtrack);
688 read_class_def (fp, offset,
689 &subtable->sub.gsub.chain_context2.Input);
690 read_class_def (fp, offset,
691 &subtable->sub.gsub.chain_context2.LookAhead);
692 subtable->sub.gsub.chain_context2.ChainSubClassSetCnt
693 = (read_chain_subclass_set
695 &subtable->sub.gsub.chain_context2.ChainSubClassSet));
698 else if (subtable->Format == 3)
702 (indent, "BackTrackGlyphCount",
703 subtable->sub.gsub.chain_context3.Backtrack,
704 subtable->sub.gsub.chain_context3.BacktrackGlyphCount);
706 (indent, "InputGlyphCount",
707 subtable->sub.gsub.chain_context3.Input,
708 subtable->sub.gsub.chain_context3.InputGlyphCount);
710 (indent, "LookaheaGlyphCount",
711 subtable->sub.gsub.chain_context3.LookAhead,
712 subtable->sub.gsub.chain_context3.LookaheadGlyphCount);
713 dump_subst_lookup_record_list
715 subtable->sub.gsub.chain_context3.SubstLookupRecord,
716 subtable->sub.gsub.chain_context3.SubstCount);
726 dump_gpos_table (int indent, OTF_GPOS *gpos)
732 IPRINT ("(Version %d.%d)", gpos->Version.high, gpos->Version.low);
733 IPRINT ("(ScriptList #x%04X)", gpos->ScriptList.offset);
734 IPRINT ("(FeatureList #x%04X)", gpos->FeatureList.offset);
735 IPRINT ("(LookupList #x%04X))", gpos->LookupList.offset);
737 dump_script_list (indent, &gpos->ScriptList);
738 dump_feature_list (indent, &gpos->FeatureList);
739 dump_lookup_list (indent, &gpos->LookupList, 0);
745 dump_base_table (OTF_BASE *base)
750 dump_jstf_table (OTF_JSTF *jstf)
758 dump_gdef_header (int indent, OTF_GDEFHeader *header)
760 IPRINT ("(Header\n");
762 IPRINT ("(Version %d.%d)",
763 header->Version.high, header->Version.low);
764 IPRINT ("(GlyphClassDef #x%04X)", header->GlyphClassDef);
765 IPRINT ("(AttachList #x%04X)", header->AttachList);
766 IPRINT ("(LigCaretList #x%04X)", header->LigCaretList);
767 IPRINT ("(MarkAttachClassDef #x%04X))",
768 header->MarkAttachClassDef);
772 dump_attach_list (int indent, OTF_AttachList *list)
777 dump_lig_caret_list (int indent, OTF_LigCaretList *list)
781 IPRINT ("(LigCaretList");
783 dump_coverage (indent, NULL, &list->Coverage);
784 IPRINT ("(LigGlyphCount %d)", list->LigGlyphCount);
785 for (i = 0; i < list->LigGlyphCount; i++)
787 IPRINT ("(LigGlyph (%d) (offset #x%04X)",
788 i, list->LigGlyph[i].offset);
790 IPRINT ("(CaretCount %d)", list->LigGlyph[i].CaretCount);
791 for (j = 0; j < list->LigGlyph[i].CaretCount; j++)
793 unsigned format = list->LigGlyph[i].CaretValue[j].CaretValueFormat;
795 IPRINT ("(Caret (%d) (CaretValueFormat %d)", j, format);
798 printf ("(Coordinate %d)",
799 list->LigGlyph[i].CaretValue[j].f.f1.Coordinate);
801 else if (format == 2)
803 printf ("(CaretValuePoint %d)",
804 list->LigGlyph[i].CaretValue[j].f.f2.CaretValuePoint);
806 else if (format == 3)
808 printf ("(Coodinate %d)",
809 list->LigGlyph[i].CaretValue[j].f.f3.Coordinate);
812 (indent, "DeviceTable",
813 &list->LigGlyph[i].CaretValue[j].f.f3.DeviceTable);
825 dump_gdef_table (int indent, OTF_GDEF *gdef)
829 dump_gdef_header (indent, &gdef->header);
830 if (gdef->header.GlyphClassDef)
831 dump_class_def (indent, "GlyphClassDef", &gdef->glyph_class_def);
832 if (gdef->header.AttachList)
833 dump_attach_list (indent, &gdef->attach_list);
834 if (gdef->header.LigCaretList)
835 dump_lig_caret_list (indent, &gdef->lig_caret_list);
836 if (gdef->header.MarkAttachClassDef)
837 dump_class_def (indent, "MarkAttachClassDef",
838 &gdef->mark_attach_class_def);
845 dump_cmap_table (int indent, OTF_cmap *cmap)
851 IPRINT ("(version %d)", cmap->version);
852 IPRINT ("(numTables %d)", cmap->numTables);
853 for (i = 0; i < cmap->numTables; i++)
855 IPRINT ("(EncodingRecord (%d) (platformID %d) (encodingID %d)",
857 cmap->EncodingRecord[i].platformID,
858 cmap->EncodingRecord[i].encodingID);
860 IPRINT ("(Subtable (offset #x%04X) (format %d) (length #x%04X) (language %d)",
861 cmap->EncodingRecord[i].offset,
862 cmap->EncodingRecord[i].subtable.format,
863 cmap->EncodingRecord[i].subtable.length,
864 cmap->EncodingRecord[i].subtable.language);
866 switch (cmap->EncodingRecord[i].subtable.format)
872 = cmap->EncodingRecord[i].subtable.f.f0->glyphIdArray;
874 IPRINT ("(glyphIdArray");
875 for (j = 0; j < 16; j++)
878 for (k = 0; k < 16; k++)
879 printf (" %3d", array[j * 16 + k]);
887 OTF_EncodingSubtable4 *sub4
888 = cmap->EncodingRecord[i].subtable.f.f4;
891 IPRINT ("(segCountX2 %d) (searchRange %d)",
892 sub4->segCountX2, sub4->searchRange);
893 IPRINT ("(entrySelector %d) (rangeShift %d)",
894 sub4->entrySelector, sub4->rangeShift);
895 for (j = 0; j < sub4->segCountX2 / 2; j++)
897 IPRINT ("(Segment (%d)", j);
899 IPRINT ("(startCount #x%04X) (endCount #x%04X)",
900 sub4->segments[j].startCount,
901 sub4->segments[j].endCount);
902 IPRINT ("(idDelta %d) (idRangeOffset #x%04X))",
903 sub4->segments[j].idDelta,
904 sub4->segments[j].idRangeOffset);
907 IPRINT ("(glyphIdArray");
908 for (j = 0; j < sub4->GlyphCount; j++)
912 printf (" %3d", sub4->glyphIdArray[j]);
928 dump_name_table (int indent, OTF_name *name)
934 IPRINT ("(format %d)", name->format);
935 IPRINT ("(count %d)", name->count);
936 IPRINT ("(stringOffset %d)", name->stringOffset);
937 for (i = 0; i < name->count; i++)
939 OTF_NameRecord *rec = name->nameRecord + i;
941 IPRINT ("(nameRecord (%d)", i);
943 IPRINT ("(platformID %d) (encodingID %d) (languageID %d) (nameID %d)",
944 rec->platformID, rec->encodingID, rec->languageID, rec->nameID);
945 IPRINT ("(length %d) (offset #x%04X))", rec->length, rec->offset);
948 for (i = 0; i <= OTF_max_nameID; i++)
950 IPRINT ("(nameID %d \"%s\")", i, name->name[i]);
963 dump_offset_table (1, &otf->offset_table);
964 for (i = 0; i < otf->offset_table.numTables; i++)
965 dump_table_directory (1, otf->table_dirs + i, i);
966 dump_head_table (1, (OTF_head *) otf_get_table (otf, otf_tag ("head")));
967 dump_name_table (1, (OTF_name *) otf_get_table (otf, otf_tag ("name")));
968 dump_cmap_table (1, (OTF_cmap *) otf_get_table (otf, otf_tag ("cmap")));
969 dump_gdef_table (1, (OTF_GDEF *) otf_get_table (otf, otf_tag ("GDEF")));
970 dump_gsub_table (1, (OTF_GSUB *) otf_get_table (otf, otf_tag ("GSUB")));
971 dump_gpos_table (1, (OTF_GPOS *) otf_get_table (otf, otf_tag ("GPOS")));
973 dump_base_table (1, (OTF_BASE *) otf_get_table (otf, otf_tag ("BASE")));
974 dump_jstf_table (1, (OTF_JSTF *) otf_get_table (otf, otf_tag ("JSTF")));
981 main (int argc, char **argv)
987 fprintf (stderr, "Usage, dtfdump OTF-FILE");
991 otf = otf_open (argv[1]);