📄 harfbuzz-dump.c
字号:
Dump_ContextSubstFormat3 (&ContextSubst->csf.csf3, stream, indent+2, hb_type); break; default: fprintf(stderr, "invalid subformat!!!!!\n"); }}DEF_DUMP (ChainContextSubstFormat1){ HB_UNUSED(hb_type); HB_UNUSED(ChainContextSubstFormat1); DUMP("<!-- Not implemented!!! -->\n");}DEF_DUMP (ChainContextSubstFormat2){ int i; RECURSE (Coverage, Coverage, &ChainContextSubstFormat2->Coverage); DUMP_FUINT (ChainContextSubstFormat2, MaxBacktrackLength); RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->BacktrackClassDef); DUMP_FUINT (ChainContextSubstFormat2, MaxInputLength); RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->InputClassDef); DUMP_FUINT (ChainContextSubstFormat2, MaxLookaheadLength); RECURSE (ClassDefinition, ClassDefinition, &ChainContextSubstFormat2->LookaheadClassDef); DUMP_FUINT (ChainContextSubstFormat2, ChainSubClassSetCount); for (i = 0; i < ChainContextSubstFormat2->ChainSubClassSetCount; i++) RECURSE (ChainSubClassSet, ChainSubClassSet, &ChainContextSubstFormat2->ChainSubClassSet[i]);}DEF_DUMP (ChainContextSubstFormat3){ int i; DUMP_FUINT (ChainContextSubstFormat3, BacktrackGlyphCount); for (i = 0; i < ChainContextSubstFormat3->BacktrackGlyphCount; i++) RECURSE (BacktrackCoverage, Coverage, &ChainContextSubstFormat3->BacktrackCoverage[i]); DUMP_FUINT (ChainContextSubstFormat3, InputGlyphCount); for (i = 0; i < ChainContextSubstFormat3->InputGlyphCount; i++) RECURSE (InputCoverage, Coverage, &ChainContextSubstFormat3->InputCoverage[i]); DUMP_FUINT (ChainContextSubstFormat3, LookaheadGlyphCount); for (i = 0; i < ChainContextSubstFormat3->LookaheadGlyphCount; i++) RECURSE (LookaheadCoverage, Coverage, &ChainContextSubstFormat3->LookaheadCoverage[i]); for (i = 0; i < ChainContextSubstFormat3->SubstCount; i++) RECURSE_NUM (SubstLookupRecord, i, SubstLookupRecord, &ChainContextSubstFormat3->SubstLookupRecord[i]);}static voidDump_GSUB_Lookup_Chain (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type){ HB_ChainContextSubst *chain = &subtable->st.gsub.chain; DUMP_FUINT (chain, SubstFormat); switch (chain->SubstFormat) { case 1: Dump_ChainContextSubstFormat1 (&chain->ccsf.ccsf1, stream, indent+2, hb_type); break; case 2: Dump_ChainContextSubstFormat2 (&chain->ccsf.ccsf2, stream, indent+2, hb_type); break; case 3: Dump_ChainContextSubstFormat3 (&chain->ccsf.ccsf3, stream, indent+2, hb_type); break; default: fprintf(stderr, "invalid subformat!!!!!\n"); }}static voidDump_Device (HB_Device *Device, FILE *stream, int indent, HB_Type hb_type){ int i; int bits; int n_per; unsigned int mask; HB_UNUSED(hb_type); DUMP_FUINT (Device, StartSize); DUMP_FUINT (Device, EndSize); DUMP_FUINT (Device, DeltaFormat); switch (Device->DeltaFormat) { case 1: bits = 2; break; case 2: bits = 4; break; case 3: bits = 8; break; default: bits = 0; break; } DUMP ("<DeltaValue>"); if (!bits) { fprintf(stderr, "invalid DeltaFormat!!!!!\n"); } else { n_per = 16 / bits; mask = (1 << bits) - 1; mask = mask << (16 - bits); for (i = Device->StartSize; i <= Device->EndSize ; i++) { HB_UShort val = Device->DeltaValue[i / n_per]; HB_Short signed_val = ((val << ((i % n_per) * bits)) & mask); dump (stream, indent, "%d", signed_val >> (16 - bits)); if (i != Device->EndSize) DUMP (", "); } } DUMP ("</DeltaValue>\n");}static voidDump_ValueRecord (HB_ValueRecord *ValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort value_format){ if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT) DUMP_FINT (ValueRecord, XPlacement); if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT) DUMP_FINT (ValueRecord, YPlacement); if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE) DUMP_FINT (ValueRecord, XAdvance); if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE) DUMP_FINT (ValueRecord, XAdvance); if (value_format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE) RECURSE (Device, Device, &ValueRecord->XPlacementDevice); if (value_format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE) RECURSE (Device, Device, &ValueRecord->YPlacementDevice); if (value_format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE) RECURSE (Device, Device, &ValueRecord->XAdvanceDevice); if (value_format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE) RECURSE (Device, Device, &ValueRecord->YAdvanceDevice); if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_PLACEMENT) DUMP_FUINT (ValueRecord, XIdPlacement); if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_PLACEMENT) DUMP_FUINT (ValueRecord, YIdPlacement); if (value_format & HB_GPOS_FORMAT_HAVE_X_ID_ADVANCE) DUMP_FUINT (ValueRecord, XIdAdvance); if (value_format & HB_GPOS_FORMAT_HAVE_Y_ID_ADVANCE) DUMP_FUINT (ValueRecord, XIdAdvance);}static voidDump_GPOS_Lookup_Single (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type){ HB_SinglePos *SinglePos = &subtable->st.gpos.single; DUMP_FUINT (SinglePos, PosFormat); RECURSE (Coverage, Coverage, &SinglePos->Coverage); DUMP_FUINT (SinglePos, ValueFormat); if (SinglePos->PosFormat == 1) { DUMP_VALUE_RECORD (&SinglePos->spf.spf1.Value, SinglePos->ValueFormat); } else { int i; DUMP_FUINT (&SinglePos->spf.spf2, ValueCount); for (i = 0; i < SinglePos->spf.spf2.ValueCount; i++) DUMP_VALUE_RECORD (&SinglePos->spf.spf2.Value[i], SinglePos->ValueFormat); }}static voidDump_PairValueRecord (HB_PairValueRecord *PairValueRecord, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2){ DUMP_FUINT (PairValueRecord, SecondGlyph); DUMP_VALUE_RECORD (&PairValueRecord->Value1, ValueFormat1); DUMP_VALUE_RECORD (&PairValueRecord->Value2, ValueFormat2);}static voidDump_PairSet (HB_PairSet *PairSet, FILE *stream, int indent, HB_Type hb_type, HB_UShort ValueFormat1, HB_UShort ValueFormat2){ int i; DUMP_FUINT (PairSet, PairValueCount); for (i = 0; i < PairSet->PairValueCount; i++) { DUMP ("<PairValueRecord>\n"); Dump_PairValueRecord (&PairSet->PairValueRecord[i], stream, indent + 1, hb_type, ValueFormat1, ValueFormat2); DUMP ("</PairValueRecord>\n"); }}static voidDump_GPOS_Lookup_Pair (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type){ HB_PairPos *PairPos = &subtable->st.gpos.pair; DUMP_FUINT (PairPos, PosFormat); RECURSE (Coverage, Coverage, &PairPos->Coverage); DUMP_FUINT (PairPos, ValueFormat1); DUMP_FUINT (PairPos, ValueFormat2); if (PairPos->PosFormat == 1) { int i; DUMP_FUINT (&PairPos->ppf.ppf1, PairSetCount); for (i = 0; i < PairPos->ppf.ppf1.PairSetCount; i++) { DUMP ("<PairSet>\n"); Dump_PairSet (&PairPos->ppf.ppf1.PairSet[i], stream, indent + 1, hb_type, PairPos->ValueFormat1, PairPos->ValueFormat2); DUMP ("</PairSet>\n"); } } else { }}static voidDump_GPOS_Lookup_Markbase (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type){ int i; HB_MarkBasePos *markbase = &subtable->st.gpos.markbase; DUMP_FUINT (markbase, PosFormat); RECURSE (Coverage, Coverage, &markbase->MarkCoverage); RECURSE (Coverage, Coverage, &markbase->BaseCoverage); DUMP_FUINT (markbase, ClassCount); RECURSE (MarkArray, MarkArray, &markbase->MarkArray); DUMP ("<BaseArray>\n"); indent++; DUMP_FUINT (&markbase->BaseArray, BaseCount); for (i = 0; i < markbase->BaseArray.BaseCount; i++) { int j; HB_BaseRecord *r = &markbase->BaseArray.BaseRecord[i]; DUMP1 ("<BaseRecord> <!-- %d -->\n", i); for (j = 0; j < markbase->ClassCount; j++) DUMP1 (" <Anchor>%d</Anchor>\n", r->BaseAnchor->PosFormat); DUMP ("<BaseRecord>\n"); } indent--; DUMP ("</BaseArray>\n");}DEF_DUMP (Lookup){ int i; const char *lookup_name; void (*lookup_func) (HB_SubTable *subtable, FILE *stream, int indent, HB_Type hb_type) = NULL; if (hb_type == HB_Type_GSUB) { switch (Lookup->LookupType) { case HB_GSUB_LOOKUP_SINGLE: lookup_name = "SINGLE"; lookup_func = Dump_GSUB_Lookup_Single; break; case HB_GSUB_LOOKUP_MULTIPLE: lookup_name = "MULTIPLE"; break; case HB_GSUB_LOOKUP_ALTERNATE: lookup_name = "ALTERNATE"; break; case HB_GSUB_LOOKUP_LIGATURE: lookup_name = "LIGATURE"; lookup_func = Dump_GSUB_Lookup_Ligature; break; case HB_GSUB_LOOKUP_CONTEXT: lookup_name = "CONTEXT"; lookup_func = Dump_GSUB_Lookup_Context; break; case HB_GSUB_LOOKUP_CHAIN: lookup_name = "CHAIN"; lookup_func = Dump_GSUB_Lookup_Chain; break; default: lookup_name = "(unknown)"; lookup_func = NULL; break; } } else { switch (Lookup->LookupType) { case HB_GPOS_LOOKUP_SINGLE: lookup_name = "SINGLE"; lookup_func = Dump_GPOS_Lookup_Single; break; case HB_GPOS_LOOKUP_PAIR: lookup_name = "PAIR"; lookup_func = Dump_GPOS_Lookup_Pair; break; case HB_GPOS_LOOKUP_CURSIVE: lookup_name = "CURSIVE"; break; case HB_GPOS_LOOKUP_MARKBASE: lookup_name = "MARKBASE"; lookup_func = Dump_GPOS_Lookup_Markbase; break; case HB_GPOS_LOOKUP_MARKLIG: lookup_name = "MARKLIG"; break; case HB_GPOS_LOOKUP_MARKMARK: lookup_name = "MARKMARK"; break; case HB_GPOS_LOOKUP_CONTEXT: lookup_name = "CONTEXT"; break; case HB_GPOS_LOOKUP_CHAIN: lookup_name = "CHAIN"; break; default: lookup_name = "(unknown)"; lookup_func = NULL; break; } } DUMP2("<LookupType>%s</LookupType> <!-- %d -->\n", lookup_name, Lookup->LookupType); DUMP1("<LookupFlag>%#06x</LookupFlag>\n", Lookup->LookupFlag); for (i=0; i < Lookup->SubTableCount; i++) { DUMP ("<Subtable>\n"); if (lookup_func) (*lookup_func) (&Lookup->SubTable[i], stream, indent + 1, hb_type); DUMP ("</Subtable>\n"); }}DEF_DUMP (LookupList){ int i; DUMP_FUINT (LookupList, LookupCount); for (i=0; i < LookupList->LookupCount; i++) RECURSE_NUM (Lookup, i, Lookup, &LookupList->Lookup[i]);}voidHB_Dump_GSUB_Table (HB_GSUB gsub, FILE *stream){ int indent = 1; HB_Type hb_type = HB_Type_GSUB; do_indent (stream, indent); fprintf(stream, "<!-- GSUB -->\n"); RECURSE (ScriptList, ScriptList, &gsub->ScriptList); RECURSE (FeatureList, FeatureList, &gsub->FeatureList); RECURSE (LookupList, LookupList, &gsub->LookupList);}voidHB_Dump_GPOS_Table (HB_GPOS gpos, FILE *stream){ int indent = 1; HB_Type hb_type = HB_Type_GPOS; do_indent (stream, indent); fprintf(stream, "<!-- GPOS -->\n"); RECURSE (ScriptList, ScriptList, &gpos->ScriptList); RECURSE (FeatureList, FeatureList, &gpos->FeatureList); RECURSE (LookupList, LookupList, &gpos->LookupList);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -