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)
63 IPRINT ("(TableVersionNumber %d.%d)",
64 head->TableVersionNumber.high, head->TableVersionNumber.low);
65 IPRINT ("(fontRevision %d.%d)",
66 head->fontRevision.high, head->fontRevision.low);
67 IPRINT ("(checkSumAdjustment #x%04X)", head->checkSumAdjustment);
68 IPRINT ("(magicNumber #x%04X)", head->magicNumber);
69 IPRINT ("(flags #x%04X)", head->flags);
70 IPRINT ("(unitsPerEm %d)", head->unitsPerEm);
78 dump_glyph_ids (OTF_GlyphID *ids, unsigned num)
82 printf (" #x%04X", *ids);
88 dump_coverage (int indent, char *title, OTF_Coverage *coverage)
92 IPRINT ("(%sCoverage (CoverageFormat %d)",
93 (title ? title : ""), coverage->CoverageFormat);
95 if (coverage->CoverageFormat == 1)
97 IPRINT ("(GlyphCount %d)", coverage->Count);
98 IPRINT ("(GlyphArray");
99 dump_glyph_ids (coverage->table.GlyphArray, coverage->Count);
104 IPRINT ("(RangeCount %d)", coverage->Count);
106 for (i = 0; i < coverage->Count; i++)
108 IPRINT ("(Range (%d) (Start #x%04X) (End #x%04X)", i,
109 coverage->table.RangeRecord[i].Start,
110 coverage->table.RangeRecord[i].End);
112 IPRINT ("(StartCoverageIndex %d))",
113 coverage->table.RangeRecord[i].StartCoverageIndex);
121 dump_coverage_list (int indent, char *title,
122 OTF_Coverage *coverage, unsigned num)
126 IPRINT ("(%s %d)", title, num);
127 for (i = 0; i < num; i++)
128 dump_coverage (indent, NULL, coverage + i);
133 dump_language_system (int indent, int index, OTF_Tag tag, OTF_Offset offset,
134 OTF_LangSys *langsys)
138 IPRINT ("(LangSys ");
140 printf ("(%d) ", index);
144 printf ("DefaultLangSys");
145 printf (" (Offset #x%04X)", offset);
147 IPRINT ("(LookupOrder #x%04X)", langsys->LookupOrder);
148 IPRINT ("(ReqFeatureIndex %d)", langsys->ReqFeatureIndex);
149 IPRINT ("(FeatureCount %d)", langsys->FeatureCount);
150 if (langsys->FeatureCount)
152 IPRINT ("(FeatureIndex");
153 for (i = 0; i < langsys->FeatureCount; i++)
154 printf (" %d", langsys->FeatureIndex[i]);
161 dump_script_list (int indent, OTF_ScriptList *list)
165 IPRINT ("(ScriptList (count %d)", list->ScriptCount);
167 for (i = 0; i < list->ScriptCount; i++)
169 OTF_Script *script = list->Script + i;
171 IPRINT ("(Script (%d) ", i);
172 dump_tag (list->ScriptRecord[i].ScriptTag);
173 printf (" (Offset #x%04X)", list->ScriptRecord[i].Script);
175 IPRINT ("(DefaultLangSysOffset #x%04X)",
176 script->DefaultLangSysOffset);
177 if (script->DefaultLangSysOffset)
178 dump_language_system (indent, -1, 0,
179 script->DefaultLangSysOffset,
180 &script->DefaultLangSys);
181 IPRINT ("(LangSysCount %d)", script->LangSysCount);
182 for (j = 0; j < script->LangSysCount; j++)
183 dump_language_system (indent, j,
184 script->LangSysRecord[j].LangSysTag,
185 script->LangSysRecord[j].LangSys,
186 script->LangSys + j);
194 dump_feature_list (int indent, OTF_FeatureList *list)
198 IPRINT ("(FeatureList (count %d)", list->FeatureCount);
200 for (i = 0; i < list->FeatureCount; i++)
202 OTF_Feature *feature = list->Feature + i;
204 IPRINT ("(Feature (%d) ", i);
205 dump_tag (list->FeatureRecord[i].FeatureTag);
206 printf (" (Offset #x%04X)", list->FeatureRecord[i].Feature);
207 printf (" (LookupCount %d)", feature->LookupCount);
208 if (feature->LookupCount)
211 IPRINT ("(LookupListIndex");
212 for (j = 0; j < feature->LookupCount; j++)
213 printf (" %d", feature->LookupListIndex[j]);
223 dump_class_def (int indent, char *title, OTF_ClassDef *class)
225 IPRINT ("(%s (offset #x%04X) (ClassFormat %d)",
226 (title ? title : "ClassDef"),
227 class->offset, class->ClassFormat);
229 if (class->ClassFormat == 1)
231 IPRINT ("(StartGlyph #x%04X)", class->f.f1.StartGlyph);
232 IPRINT ("(GlyphCount %d)", class->f.f1.GlyphCount);
233 IPRINT ("(ClassValueArray");
234 dump_glyph_ids ((OTF_GlyphID *) class->f.f1.ClassValueArray,
235 class->f.f1.GlyphCount);
238 else if (class->ClassFormat == 2)
242 IPRINT ("(ClassRangeCount %d)", class->f.f2.ClassRangeCount);
243 IPRINT ("(ClassRangeRecord");
245 for (i = 0; i < class->f.f2.ClassRangeCount; i++)
246 IPRINT ("((Start #x%04X) (End #x%04X) (class %d))",
247 class->f.f2.ClassRangeRecord[i].Start,
248 class->f.f2.ClassRangeRecord[i].End,
249 class->f.f2.ClassRangeRecord[i].Class);
253 printf ("UknownClassFormat");
258 dump_device_table (int indent, char *title, OTF_DeviceTable *table)
264 IPRINT ("(%s (offset #x%04X)", title, table->offset);
266 IPRINT ("(StartSize %d) (EndSize %d) (DeltaFormat %d)",
267 table->StartSize, table->EndSize, table->DeltaFormat);
268 IPRINT ("(DeltaValue");
269 for (i = 0; i < table->EndSize - table->StartSize + 1; i++)
270 printf (" %d", table->DeltaValue[i]);
277 dump_value_record (int indent, char *title, OTF_ValueRecord *rec)
279 IPRINT ("(%s %d %d %d %d", title,
280 rec->XPlacement, rec->YPlacement, rec->XAdvance, rec->YAdvance);
282 if (rec->XPlaDevice.offset)
283 dump_device_table (indent, "XPlaDevice", &rec->XPlaDevice);
284 if (rec->YPlaDevice.offset)
285 dump_device_table (indent, "YPlaDevice", &rec->YPlaDevice);
286 if (rec->XAdvDevice.offset)
287 dump_device_table (indent, "XAdvDevice", &rec->XAdvDevice);
288 if (rec->YAdvDevice.offset)
289 dump_device_table (indent, "YAdvDevice", &rec->YAdvDevice);
295 dump_sequence_list (int indent, OTF_Sequence *sequence, unsigned num)
298 IPRINT ("(SequenceCount %d)", num);
300 for (i = 0; i < num; i++)
302 IPRINT ("(Sequence (%d) (offset #x%04X)",
303 i, sequence[i].offset);
305 IPRINT ("(GlyphCount %d)", sequence[i].GlyphCount);
306 IPRINT ("(Substitute");
307 dump_glyph_ids (sequence[i].Substitute, sequence[i].GlyphCount);
314 dump_ligature_set_list (int indent, OTF_LigatureSet *ligset, unsigned num)
318 IPRINT ("(LigSetCount %d)", num);
319 for (i = 0; i < num; i++)
321 IPRINT ("(LigatureSet (%d) (offset #x%04X) (count %d)",
322 i, ligset[i].offset, ligset[i].LigatureCount);
324 for (j = 0; j < ligset[i].LigatureCount; j++)
326 IPRINT ("(Ligature (%d) (offset #x%04X)",
327 j, ligset[i].Ligature[j].offset);
329 IPRINT ("(LigGlyph #x%04X)",
330 ligset[i].Ligature[j].LigGlyph);
331 IPRINT ("(ComCount %d)",
332 ligset[i].Ligature[j].CompCount);
333 IPRINT ("(Component");
334 dump_glyph_ids (ligset[i].Ligature[j].Component,
335 ligset[i].Ligature[j].CompCount - 1);
345 dump_class1_record_list (int indent,
346 unsigned Class1Count, unsigned Class2Count,
347 OTF_Class1Record *rec)
351 for (i = 0; i < Class1Count; i++)
353 IPRINT ("(Class1Record (%d)", i);
355 for (j = 0; j < Class2Count; j++)
357 IPRINT ("(Class2Record (%d)", j);
359 dump_value_record (indent, "Value1", &rec[i].Class2Record[j].Value1);
360 dump_value_record (indent, "Value2", &rec[i].Class2Record[j].Value2);
370 dump_anchor (int indent, OTF_Anchor *anchor)
372 IPRINT ("(Anchor (offset #x%04X) (AnchorFormat %d)",
373 anchor->offset, anchor->AnchorFormat);
375 IPRINT ("(XCoordinate %d) (YCoordinate %d)",
376 anchor->XCoordinate, anchor->YCoordinate);
377 if (anchor->AnchorFormat == 1)
379 else if (anchor->AnchorFormat == 2)
380 IPRINT ("(AnchorPoint %d)", anchor->f.f1.AnchorPoint);
383 dump_device_table (indent, "XDeviceTable", &anchor->f.f2.XDeviceTable);
384 dump_device_table (indent, "YDeviceTable", &anchor->f.f2.YDeviceTable);
390 dump_mark_array (int indent, OTF_MarkArray *array)
394 IPRINT ("(MarkArray (MarkCount %d)", array->MarkCount);
396 for (i = 0; i < array->MarkCount; i++)
398 IPRINT ("(MarkRecord (%d) (Class %d)", i, array->MarkRecord[i].Class);
399 dump_anchor (indent + 1, &array->MarkRecord[i].MarkAnchor);
406 dump_base_array (int indent, unsigned ClassCount, OTF_BaseArray *array)
410 IPRINT ("(BaseArray (BaseCount %d)", array->BaseCount);
412 for (i = 0; i < array->BaseCount; i++)
414 IPRINT ("(BaseRecord (%d) ", i);
415 for (j = 0; j < ClassCount; j++)
416 dump_anchor (indent + 1, array->BaseRecord[i].BaseAnchor + j);
424 dump_subst_lookup_record_list (int indent,
425 OTF_SubstLookupRecord *rec, unsigned num)
429 IPRINT ("(SubstCount %d)", num);
430 for (i = 0; i < num; i++)
432 IPRINT ("(SubstLookupRecord (%d)", i);
434 IPRINT ("(SequenceIndex %d)", rec[i].SequenceIndex);
435 IPRINT ("(LookupListIndex %d))", rec[i].LookupListIndex);
441 static void dump_lookup_subtable_gsub (int indent, int index, unsigned type,
442 OTF_LookupSubTable *subtable);
443 static void dump_lookup_subtable_gpos (int indent, int index, unsigned type,
444 OTF_LookupSubTable *subtable);
448 dump_lookup_list (int indent, OTF_LookupList *list, int gsub)
452 IPRINT ("(LookupList (count %d)", list->LookupCount);
454 for (i = 0; i < list->LookupCount; i++)
456 OTF_Lookup *lookup = list->Lookup + i;
458 IPRINT ("(Lookup (%d) (Offset #x%04X)",
459 i, list->LookupOffset[i]);
460 printf (" (Type %d) (Flag #x%04X) (SubTableCount %d)",
461 lookup->LookupType, lookup->LookupFlag, lookup->SubTableCount);
463 for (j = 0; j < lookup->SubTableCount; j++)
464 dump_lookup_subtable_gsub (indent + 1, j,
465 lookup->LookupType, lookup->SubTable + j);
467 for (j = 0; j < lookup->SubTableCount; j++)
468 dump_lookup_subtable_gpos (indent + 1, j,
469 lookup->LookupType, lookup->SubTable + j);
480 dump_gsub_header (int indent, OTF_GSUBHeader *header)
484 IPRINT ("(Version %d.%d)",
485 header->Version.high, header->Version.low);
486 IPRINT ("(ScriptList #x%04X)", header->ScriptList);
487 IPRINT ("(FeatureList #x%04X)", header->FeatureList);
488 IPRINT ("(LookupList #x%04X))", header->LookupList);
493 dump_lookup_subtable_gsub (int indent, int index, unsigned type,
494 OTF_LookupSubTable *subtable)
496 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
501 if (subtable->Format == 1)
503 dump_coverage (indent, NULL, &subtable->Coverage);
504 IPRINT ("(DeltaGlyhpID #x%04X)",
505 subtable->sub.gsub.single1.DeltaGlyphID);
507 else if (subtable->Format == 2)
509 dump_coverage (indent, NULL, &subtable->Coverage);
510 IPRINT ("(GlyphCount %d)",
511 subtable->sub.gsub.single2.GlyphCount);
512 IPRINT ("(Substitute");
513 dump_glyph_ids (subtable->sub.gsub.single2.Substitute,
514 subtable->sub.gsub.single2.GlyphCount);
520 if (subtable->Format == 1)
522 dump_coverage (indent, NULL, &subtable->Coverage);
523 dump_sequence_list (indent,
524 subtable->sub.gsub.multiple1.Sequence,
525 subtable->sub.gsub.multiple1.SequenceCount);
530 if (subtable->Format == 1)
532 dump_coverage (indent, NULL, &subtable->Coverage);
533 dump_ligature_set_list (indent,
534 subtable->sub.gsub.ligature1.LigatureSet,
535 subtable->sub.gsub.ligature1.LigSetCount);
540 if (subtable->Format == 1)
543 read_coverage (fp, offset,
544 &subtable->sub.gsub.chain_context1.Coverage);
545 subtable->sub.gsub.chain_context1.ChainSubRuleSetCount
546 = (read_chain_subrule_set
548 &subtable->sub.gsub.chain_context1.ChainSubRuleSet));
551 else if (subtable->Format == 2)
554 read_coverage (fp, offset,
555 &subtable->sub.gsub.chain_context2.Coverage);
556 read_class_def (fp, offset,
557 &subtable->sub.gsub.chain_context2.Backtrack);
558 read_class_def (fp, offset,
559 &subtable->sub.gsub.chain_context2.Input);
560 read_class_def (fp, offset,
561 &subtable->sub.gsub.chain_context2.LookAhead);
562 subtable->sub.gsub.chain_context2.ChainSubClassSetCnt
563 = (read_chain_subclass_set
565 &subtable->sub.gsub.chain_context2.ChainSubClassSet));
568 else if (subtable->Format == 3)
571 (indent, "BackTrackGlyphCount",
572 subtable->sub.gsub.chain_context3.Backtrack,
573 subtable->sub.gsub.chain_context3.BacktrackGlyphCount);
575 (indent, "InputGlyphCount",
576 subtable->sub.gsub.chain_context3.Input,
577 subtable->sub.gsub.chain_context3.InputGlyphCount);
579 (indent, "LookaheaGlyphCount",
580 subtable->sub.gsub.chain_context3.LookAhead,
581 subtable->sub.gsub.chain_context3.LookaheadGlyphCount);
582 dump_subst_lookup_record_list
584 subtable->sub.gsub.chain_context3.SubstLookupRecord,
585 subtable->sub.gsub.chain_context3.SubstCount);
593 dump_gsub_table (int indent, OTF_GSUB *gsub)
597 dump_gsub_header (indent, &gsub->header);
598 dump_script_list (indent, &gsub->script_list);
599 dump_feature_list (indent, &gsub->feature_list);
600 dump_lookup_list (indent, &gsub->lookup_list, 1);
608 dump_lookup_subtable_gpos (int indent, int index, unsigned type,
609 OTF_LookupSubTable *subtable)
611 IPRINT ("(SubTable (%d) (Format %d)", index, subtable->Format);
617 if (subtable->Format == 1)
619 dump_coverage (indent, NULL, &subtable->sub.gpos.single1.Coverage);
620 IPRINT ("(DeltaGlyhpID #x%04X)",
621 subtable->sub.gsub.single1.DeltaGlyphID);
623 else if (subtable->Format == 2)
625 dump_coverage (indent, NULL, &subtable->sub.gsub.single2.Coverage);
626 IPRINT ("(GlyphCount %d)",
627 subtable->sub.gsub.single2.GlyphCount);
628 IPRINT ("(Substitute");
629 dump_glyph_ids (subtable->sub.gsub.single2.Substitute,
630 subtable->sub.gsub.single2.GlyphCount);
637 if (subtable->Format == 1)
639 dump_coverage (indent, NULL, &subtable->Coverage);
641 else if (subtable->Format == 2)
643 dump_coverage (indent, NULL, &subtable->Coverage);
644 IPRINT ("(ValueFormat1 #x%04X)",
645 subtable->sub.gpos.pair2.ValueFormat1);
646 IPRINT ("(ValueFormat2 #x%04X)",
647 subtable->sub.gpos.pair2.ValueFormat2);
648 dump_class_def (indent, "ClassDef1",
649 &subtable->sub.gpos.pair2.ClassDef1);
650 dump_class_def (indent, "ClassDef2",
651 &subtable->sub.gpos.pair2.ClassDef2);
652 IPRINT ("(Class1Count %d)",
653 subtable->sub.gpos.pair2.Class1Count);
654 IPRINT ("(Class2Count %d)",
655 subtable->sub.gpos.pair2.Class2Count);
656 dump_class1_record_list (indent,
657 subtable->sub.gpos.pair2.Class1Count,
658 subtable->sub.gpos.pair2.Class2Count,
659 subtable->sub.gpos.pair2.Class1Record);
664 if (subtable->Format == 1)
666 dump_coverage (indent, "Mark", &subtable->Coverage);
667 dump_coverage (indent, "Base",
668 &subtable->sub.gpos.mark_base1.BaseCoverage);
669 IPRINT ("(ClassCount %d)",
670 subtable->sub.gpos.mark_base1.ClassCount);
671 dump_mark_array (indent, &subtable->sub.gpos.mark_base1.MarkArray);
672 dump_base_array (indent, subtable->sub.gpos.mark_base1.ClassCount,
673 &subtable->sub.gpos.mark_base1.BaseArray);
678 if (subtable->Format == 1)
681 read_coverage (fp, offset,
682 &subtable->sub.gsub.chain_context1.Coverage);
683 subtable->sub.gsub.chain_context1.ChainSubRuleSetCount
684 = (read_chain_subrule_set
686 &subtable->sub.gsub.chain_context1.ChainSubRuleSet));
689 else if (subtable->Format == 2)
692 read_coverage (fp, offset,
693 &subtable->sub.gsub.chain_context2.Coverage);
694 read_class_def (fp, offset,
695 &subtable->sub.gsub.chain_context2.Backtrack);
696 read_class_def (fp, offset,
697 &subtable->sub.gsub.chain_context2.Input);
698 read_class_def (fp, offset,
699 &subtable->sub.gsub.chain_context2.LookAhead);
700 subtable->sub.gsub.chain_context2.ChainSubClassSetCnt
701 = (read_chain_subclass_set
703 &subtable->sub.gsub.chain_context2.ChainSubClassSet));
706 else if (subtable->Format == 3)
710 (indent, "BackTrackGlyphCount",
711 subtable->sub.gsub.chain_context3.Backtrack,
712 subtable->sub.gsub.chain_context3.BacktrackGlyphCount);
714 (indent, "InputGlyphCount",
715 subtable->sub.gsub.chain_context3.Input,
716 subtable->sub.gsub.chain_context3.InputGlyphCount);
718 (indent, "LookaheaGlyphCount",
719 subtable->sub.gsub.chain_context3.LookAhead,
720 subtable->sub.gsub.chain_context3.LookaheadGlyphCount);
721 dump_subst_lookup_record_list
723 subtable->sub.gsub.chain_context3.SubstLookupRecord,
724 subtable->sub.gsub.chain_context3.SubstCount);
734 dump_gpos_table (int indent, OTF_GPOS *gpos)
738 dump_gsub_header (indent, (OTF_GPOSHeader *) &gpos->header);
739 dump_script_list (indent, &gpos->script_list);
740 dump_feature_list (indent, &gpos->feature_list);
741 dump_lookup_list (indent, &gpos->lookup_list, 0);
747 dump_base_table (OTF_BASE *base)
752 dump_jstf_table (OTF_JSTF *jstf)
760 dump_gdef_header (int indent, OTF_GDEFHeader *header)
762 IPRINT ("(Header\n");
764 IPRINT ("(Version %d.%d)",
765 header->Version.high, header->Version.low);
766 IPRINT ("(GlyphClassDef #x%04X)", header->GlyphClassDef);
767 IPRINT ("(AttachList #x%04X)", header->AttachList);
768 IPRINT ("(LigCaretList #x%04X)", header->LigCaretList);
769 IPRINT ("(MarkAttachClassDef #x%04X))",
770 header->MarkAttachClassDef);
774 dump_attach_list (int indent, OTF_AttachList *list)
779 dump_lig_caret_list (int indent, OTF_LigCaretList *list)
783 IPRINT ("(LigCaretList");
785 dump_coverage (indent, NULL, &list->Coverage);
786 IPRINT ("(LigGlyphCount %d)", list->LigGlyphCount);
787 for (i = 0; i < list->LigGlyphCount; i++)
789 IPRINT ("(LigGlyph (%d) (offset #x%04X)",
790 i, list->LigGlyph[i].offset);
792 IPRINT ("(CaretCount %d)", list->LigGlyph[i].CaretCount);
793 for (j = 0; j < list->LigGlyph[i].CaretCount; j++)
795 unsigned format = list->LigGlyph[i].CaretValue[j].CaretValueFormat;
797 IPRINT ("(Caret (%d) (CaretValueFormat %d)", j, format);
800 printf ("(Coordinate %d)",
801 list->LigGlyph[i].CaretValue[j].f.f1.Coordinate);
803 else if (format == 2)
805 printf ("(CaretValuePoint %d)",
806 list->LigGlyph[i].CaretValue[j].f.f2.CaretValuePoint);
808 else if (format == 3)
810 printf ("(Coodinate %d)",
811 list->LigGlyph[i].CaretValue[j].f.f3.Coordinate);
814 (indent, "DeviceTable",
815 &list->LigGlyph[i].CaretValue[j].f.f3.DeviceTable);
827 dump_gdef_table (int indent, OTF_GDEF *gdef)
831 dump_gdef_header (indent, &gdef->header);
832 if (gdef->header.GlyphClassDef)
833 dump_class_def (indent, "GlyphClassDef", &gdef->glyph_class_def);
834 if (gdef->header.AttachList)
835 dump_attach_list (indent, &gdef->attach_list);
836 if (gdef->header.LigCaretList)
837 dump_lig_caret_list (indent, &gdef->lig_caret_list);
838 if (gdef->header.MarkAttachClassDef)
839 dump_class_def (indent, "MarkAttachClassDef",
840 &gdef->mark_attach_class_def);
847 dump_cmap_table (int indent, OTF_cmap *cmap)
853 IPRINT ("(version %d)", cmap->version);
854 IPRINT ("(numTables %d)", cmap->numTables);
855 for (i = 0; i < cmap->numTables; i++)
857 IPRINT ("(EncodingRecord (%d) (platformID %d) (encodingID %d)",
859 cmap->EncodingRecord[i].platformID,
860 cmap->EncodingRecord[i].encodingID);
862 IPRINT ("(Subtable (offset #x%04X) (format %d) (length #x%04X) (language %d)",
863 cmap->EncodingRecord[i].offset,
864 cmap->EncodingRecord[i].subtable.format,
865 cmap->EncodingRecord[i].subtable.length,
866 cmap->EncodingRecord[i].subtable.language);
868 switch (cmap->EncodingRecord[i].subtable.format)
874 = cmap->EncodingRecord[i].subtable.f.f0->glyphIdArray;
876 IPRINT ("(glyphIdArray");
877 for (j = 0; j < 16; j++)
880 for (k = 0; k < 16; k++)
881 printf (" %3d", array[j * 16 + k]);
889 OTF_EncodingSubtable4 *sub4
890 = cmap->EncodingRecord[i].subtable.f.f4;
893 IPRINT ("(segCountX2 %d) (searchRange %d)",
894 sub4->segCountX2, sub4->searchRange);
895 IPRINT ("(entrySelector %d) (rangeShift %d)",
896 sub4->entrySelector, sub4->rangeShift);
897 for (j = 0; j < sub4->segCountX2 / 2; j++)
899 IPRINT ("(Segment (%d)", j);
901 IPRINT ("(startCount #x%04X) (endCount #x%04X)",
902 sub4->segments[j].startCount,
903 sub4->segments[j].endCount);
904 IPRINT ("(idDelta %d) (idRangeOffset #x%04X))",
905 sub4->segments[j].idDelta,
906 sub4->segments[j].idRangeOffset);
909 IPRINT ("(glyphIdArray");
910 for (j = 0; j < sub4->GlyphCount; j++)
914 printf (" %3d", sub4->glyphIdArray[j]);
930 dump_name_table (int indent, OTF_name *name)
936 IPRINT ("(format %d)", name->format);
937 IPRINT ("(count %d)", name->count);
938 IPRINT ("(stringOffset %d)", name->stringOffset);
939 for (i = 0; i < name->count; i++)
941 OTF_NameRecord *rec = name->nameRecord + i;
943 IPRINT ("(nameRecord (%d)", i);
945 IPRINT ("(platformID %d) (encodingID %d) (languageID %d) (nameID %d)",
946 rec->platformID, rec->encodingID, rec->languageID, rec->nameID);
947 IPRINT ("(length %d) (offset #x%04X))", rec->length, rec->offset);
950 for (i = 0; i <= OTF_max_nameID; i++)
952 IPRINT ("(nameID %d \"%s\")", i, name->name[i]);
965 dump_offset_table (1, &otf->offset_table);
966 for (i = 0; i < otf->offset_table.numTables; i++)
967 dump_table_directory (1, otf->table_dirs + i, i);
969 dump_head_table (1, otf->head);
971 dump_name_table (1, otf->name);
973 dump_cmap_table (1, otf->cmap);
975 dump_gdef_table (1, otf->gdef);
977 dump_gsub_table (1, otf->gsub);
979 dump_gpos_table (1, otf->gpos);
982 dump_base_table (otf->base);
984 dump_jstf_table (otf->jstf);
991 main (int argc, char **argv)
997 fprintf (stderr, "Usage, dtfdump OTF-FILE");
1001 otf = otf_open (argv[1]);