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_LookupSubTableGSUB *subtable);
441 static void dump_lookup_subtable_gpos (int indent, int index, unsigned type,
442 OTF_LookupSubTableGPOS *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,
464 lookup->SubTable.gsub + j);
466 for (j = 0; j < lookup->SubTableCount; j++)
467 dump_lookup_subtable_gpos (indent + 1, j,
469 lookup->SubTable.gpos + j);
481 dump_lookup_subtable_gsub (int indent, int index, unsigned type,
482 OTF_LookupSubTableGSUB *subtable)
484 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
489 if (subtable->Format == 1)
491 dump_coverage (indent, NULL, &subtable->Coverage);
492 IPRINT ("(DeltaGlyhpID #x%04X)",
493 subtable->u.single1.DeltaGlyphID);
495 else if (subtable->Format == 2)
497 dump_coverage (indent, NULL, &subtable->Coverage);
498 IPRINT ("(GlyphCount %d)",
499 subtable->u.single2.GlyphCount);
500 IPRINT ("(Substitute");
501 dump_glyph_ids (subtable->u.single2.Substitute,
502 subtable->u.single2.GlyphCount);
508 if (subtable->Format == 1)
510 dump_coverage (indent, NULL, &subtable->Coverage);
511 dump_sequence_list (indent,
512 subtable->u.multiple1.Sequence,
513 subtable->u.multiple1.SequenceCount);
518 if (subtable->Format == 1)
520 dump_coverage (indent, NULL, &subtable->Coverage);
521 dump_ligature_set_list (indent,
522 subtable->u.ligature1.LigatureSet,
523 subtable->u.ligature1.LigSetCount);
528 if (subtable->Format == 1)
531 read_coverage (fp, offset,
532 &subtable->u.chain_context1.Coverage);
533 subtable->u.chain_context1.ChainSubRuleSetCount
534 = (read_chain_subrule_set
536 &subtable->u.chain_context1.ChainSubRuleSet));
539 else if (subtable->Format == 2)
542 read_coverage (fp, offset,
543 &subtable->u.chain_context2.Coverage);
544 read_class_def (fp, offset,
545 &subtable->u.chain_context2.Backtrack);
546 read_class_def (fp, offset,
547 &subtable->u.chain_context2.Input);
548 read_class_def (fp, offset,
549 &subtable->u.chain_context2.LookAhead);
550 subtable->u.chain_context2.ChainSubClassSetCnt
551 = (read_chain_subclass_set
553 &subtable->u.chain_context2.ChainSubClassSet));
556 else if (subtable->Format == 3)
559 (indent, "BackTrackGlyphCount",
560 subtable->u.chain_context3.Backtrack,
561 subtable->u.chain_context3.BacktrackGlyphCount);
563 (indent, "InputGlyphCount",
564 subtable->u.chain_context3.Input,
565 subtable->u.chain_context3.InputGlyphCount);
567 (indent, "LookaheaGlyphCount",
568 subtable->u.chain_context3.LookAhead,
569 subtable->u.chain_context3.LookaheadGlyphCount);
570 dump_subst_lookup_record_list
572 subtable->u.chain_context3.SubstLookupRecord,
573 subtable->u.chain_context3.SubstCount);
581 dump_gsub_table (int indent, OTF_GSUB *gsub)
587 IPRINT ("(Version %d.%d)", gsub->Version.high, gsub->Version.low);
588 IPRINT ("(ScriptList #x%04X)", gsub->ScriptList.offset);
589 IPRINT ("(FeatureList #x%04X)", gsub->FeatureList.offset);
590 IPRINT ("(LookupList #x%04X))", gsub->LookupList.offset);
592 dump_script_list (indent, &gsub->ScriptList);
593 dump_feature_list (indent, &gsub->FeatureList);
594 dump_lookup_list (indent, &gsub->LookupList, 1);
602 dump_lookup_subtable_gpos (int indent, int index, unsigned type,
603 OTF_LookupSubTableGPOS *subtable)
605 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
611 if (subtable->Format == 1)
613 dump_coverage (indent, NULL, &subtable->u.single1.Coverage);
614 IPRINT ("(DeltaGlyhpID #x%04X)",
615 subtable->u.single1.DeltaGlyphID);
617 else if (subtable->Format == 2)
619 dump_coverage (indent, NULL, &subtable->u.single2.Coverage);
620 IPRINT ("(GlyphCount %d)",
621 subtable->u.single2.GlyphCount);
622 IPRINT ("(Substitute");
623 dump_glyph_ids (subtable->u.single2.Substitute,
624 subtable->u.single2.GlyphCount);
631 if (subtable->Format == 1)
633 dump_coverage (indent, NULL, &subtable->Coverage);
635 else if (subtable->Format == 2)
637 dump_coverage (indent, NULL, &subtable->Coverage);
638 IPRINT ("(ValueFormat1 #x%04X)",
639 subtable->u.pair2.ValueFormat1);
640 IPRINT ("(ValueFormat2 #x%04X)",
641 subtable->u.pair2.ValueFormat2);
642 dump_class_def (indent, "ClassDef1",
643 &subtable->u.pair2.ClassDef1);
644 dump_class_def (indent, "ClassDef2",
645 &subtable->u.pair2.ClassDef2);
646 IPRINT ("(Class1Count %d)",
647 subtable->u.pair2.Class1Count);
648 IPRINT ("(Class2Count %d)",
649 subtable->u.pair2.Class2Count);
650 dump_class1_record_list (indent,
651 subtable->u.pair2.Class1Count,
652 subtable->u.pair2.Class2Count,
653 subtable->u.pair2.Class1Record);
658 if (subtable->Format == 1)
660 dump_coverage (indent, "Mark", &subtable->Coverage);
661 dump_coverage (indent, "Base",
662 &subtable->u.mark_base1.BaseCoverage);
663 IPRINT ("(ClassCount %d)",
664 subtable->u.mark_base1.ClassCount);
665 dump_mark_array (indent, &subtable->u.mark_base1.MarkArray);
666 dump_base_array (indent, subtable->u.mark_base1.ClassCount,
667 &subtable->u.mark_base1.BaseArray);
672 if (subtable->Format == 1)
675 read_coverage (fp, offset,
676 &subtable->u.chain_context1.Coverage);
677 subtable->u.chain_context1.ChainSubRuleSetCount
678 = (read_chain_subrule_set
680 &subtable->u.chain_context1.ChainSubRuleSet));
683 else if (subtable->Format == 2)
686 read_coverage (fp, offset,
687 &subtable->u.chain_context2.Coverage);
688 read_class_def (fp, offset,
689 &subtable->u.chain_context2.Backtrack);
690 read_class_def (fp, offset,
691 &subtable->u.chain_context2.Input);
692 read_class_def (fp, offset,
693 &subtable->u.chain_context2.LookAhead);
694 subtable->u.chain_context2.ChainSubClassSetCnt
695 = (read_chain_subclass_set
697 &subtable->u.chain_context2.ChainSubClassSet));
700 else if (subtable->Format == 3)
704 (indent, "BackTrackGlyphCount",
705 subtable->u.chain_context3.Backtrack,
706 subtable->u.chain_context3.BacktrackGlyphCount);
708 (indent, "InputGlyphCount",
709 subtable->u.chain_context3.Input,
710 subtable->u.chain_context3.InputGlyphCount);
712 (indent, "LookaheaGlyphCount",
713 subtable->u.chain_context3.LookAhead,
714 subtable->u.chain_context3.LookaheadGlyphCount);
715 dump_subst_lookup_record_list
717 subtable->u.chain_context3.SubstLookupRecord,
718 subtable->u.chain_context3.SubstCount);
728 dump_gpos_table (int indent, OTF_GPOS *gpos)
736 IPRINT ("(Version %d.%d)", gpos->Version.high, gpos->Version.low);
737 IPRINT ("(ScriptList #x%04X)", gpos->ScriptList.offset);
738 IPRINT ("(FeatureList #x%04X)", gpos->FeatureList.offset);
739 IPRINT ("(LookupList #x%04X))", gpos->LookupList.offset);
741 dump_script_list (indent, &gpos->ScriptList);
742 dump_feature_list (indent, &gpos->FeatureList);
743 dump_lookup_list (indent, &gpos->LookupList, 0);
749 dump_base_table (OTF_BASE *base)
754 dump_jstf_table (OTF_JSTF *jstf)
762 dump_gdef_header (int indent, OTF_GDEFHeader *header)
766 IPRINT ("(Version %d.%d)",
767 header->Version.high, header->Version.low);
768 IPRINT ("(GlyphClassDef #x%04X)", header->GlyphClassDef);
769 IPRINT ("(AttachList #x%04X)", header->AttachList);
770 IPRINT ("(LigCaretList #x%04X)", header->LigCaretList);
771 IPRINT ("(MarkAttachClassDef #x%04X))",
772 header->MarkAttachClassDef);
776 dump_attach_list (int indent, OTF_AttachList *list)
781 dump_lig_caret_list (int indent, OTF_LigCaretList *list)
785 IPRINT ("(LigCaretList");
787 dump_coverage (indent, NULL, &list->Coverage);
788 IPRINT ("(LigGlyphCount %d)", list->LigGlyphCount);
789 for (i = 0; i < list->LigGlyphCount; i++)
791 IPRINT ("(LigGlyph (%d) (offset #x%04X)",
792 i, list->LigGlyph[i].offset);
794 IPRINT ("(CaretCount %d)", list->LigGlyph[i].CaretCount);
795 for (j = 0; j < list->LigGlyph[i].CaretCount; j++)
797 unsigned format = list->LigGlyph[i].CaretValue[j].CaretValueFormat;
799 IPRINT ("(Caret (%d) (CaretValueFormat %d)", j, format);
802 printf ("(Coordinate %d)",
803 list->LigGlyph[i].CaretValue[j].f.f1.Coordinate);
805 else if (format == 2)
807 printf ("(CaretValuePoint %d)",
808 list->LigGlyph[i].CaretValue[j].f.f2.CaretValuePoint);
810 else if (format == 3)
812 printf ("(Coodinate %d)",
813 list->LigGlyph[i].CaretValue[j].f.f3.Coordinate);
816 (indent, "DeviceTable",
817 &list->LigGlyph[i].CaretValue[j].f.f3.DeviceTable);
829 dump_gdef_table (int indent, OTF_GDEF *gdef)
835 dump_gdef_header (indent, &gdef->header);
836 if (gdef->header.GlyphClassDef)
837 dump_class_def (indent, "GlyphClassDef", &gdef->glyph_class_def);
838 if (gdef->header.AttachList)
839 dump_attach_list (indent, &gdef->attach_list);
840 if (gdef->header.LigCaretList)
841 dump_lig_caret_list (indent, &gdef->lig_caret_list);
842 if (gdef->header.MarkAttachClassDef)
843 dump_class_def (indent, "MarkAttachClassDef",
844 &gdef->mark_attach_class_def);
851 dump_cmap_table (int indent, OTF_cmap *cmap)
857 IPRINT ("(version %d)", cmap->version);
858 IPRINT ("(numTables %d)", cmap->numTables);
859 for (i = 0; i < cmap->numTables; i++)
861 IPRINT ("(EncodingRecord (%d) (platformID %d) (encodingID %d)",
863 cmap->EncodingRecord[i].platformID,
864 cmap->EncodingRecord[i].encodingID);
866 IPRINT ("(Subtable (offset #x%04X) (format %d) (length #x%04X) (language %d)",
867 cmap->EncodingRecord[i].offset,
868 cmap->EncodingRecord[i].subtable.format,
869 cmap->EncodingRecord[i].subtable.length,
870 cmap->EncodingRecord[i].subtable.language);
872 switch (cmap->EncodingRecord[i].subtable.format)
878 = cmap->EncodingRecord[i].subtable.f.f0->glyphIdArray;
880 IPRINT ("(glyphIdArray");
881 for (j = 0; j < 16; j++)
884 for (k = 0; k < 16; k++)
885 printf (" %3d", array[j * 16 + k]);
893 OTF_EncodingSubtable4 *sub4
894 = cmap->EncodingRecord[i].subtable.f.f4;
897 IPRINT ("(segCountX2 %d) (searchRange %d)",
898 sub4->segCountX2, sub4->searchRange);
899 IPRINT ("(entrySelector %d) (rangeShift %d)",
900 sub4->entrySelector, sub4->rangeShift);
901 for (j = 0; j < sub4->segCountX2 / 2; j++)
903 IPRINT ("(Segment (%d)", j);
905 IPRINT ("(startCount #x%04X) (endCount #x%04X)",
906 sub4->segments[j].startCount,
907 sub4->segments[j].endCount);
908 IPRINT ("(idDelta %d) (idRangeOffset #x%04X))",
909 sub4->segments[j].idDelta,
910 sub4->segments[j].idRangeOffset);
913 IPRINT ("(glyphIdArray");
914 for (j = 0; j < sub4->GlyphCount; j++)
918 printf (" %3d", sub4->glyphIdArray[j]);
934 dump_name_table (int indent, OTF_name *name)
940 IPRINT ("(format %d)", name->format);
941 IPRINT ("(count %d)", name->count);
942 IPRINT ("(stringOffset %d)", name->stringOffset);
943 for (i = 0; i < name->count; i++)
945 OTF_NameRecord *rec = name->nameRecord + i;
947 IPRINT ("(nameRecord (%d)", i);
949 IPRINT ("(platformID %d) (encodingID %d) (languageID %d) (nameID %d)",
950 rec->platformID, rec->encodingID, rec->languageID, rec->nameID);
951 IPRINT ("(length %d) (offset #x%04X))", rec->length, rec->offset);
954 for (i = 0; i <= OTF_max_nameID; i++)
956 IPRINT ("(nameID %d \"%s\")", i, name->name[i]);
970 dump_offset_table (1, &otf->offset_table);
971 for (i = 0; i < otf->offset_table.numTables; i++)
972 dump_table_directory (1, otf->table_dirs + i, i);
975 dump_head_table (1, otf->head);
977 dump_name_table (1, otf->name);
979 dump_cmap_table (1, otf->cmap);
981 dump_gdef_table (1, otf->gdef);
983 dump_gsub_table (1, otf->gsub);
985 dump_gpos_table (1, otf->gpos);
988 dump_base_table (1, otf->base);
990 dump_jstf_table (1, otf->jstf);
997 main (int argc, char **argv)
1003 fprintf (stderr, "Usage, dtfdump OTF-FILE");
1007 otf = OTF_open (argv[1]);
1010 OTF_perror ("otfdump");
1013 OTF_get_table (otf, "head");
1014 OTF_get_table (otf, "name");
1015 OTF_get_table (otf, "cmap");
1016 OTF_get_table (otf, "GDEF");
1017 OTF_get_table (otf, "GSUB");
1018 OTF_get_table (otf, "GPOS");
1020 OTF_get_table (otf, "BASE");
1021 OTF_get_table (otf, "JSTF");