From 932eeb3be23a62d7a43c7a153eec45447274f27e Mon Sep 17 00:00:00 2001 From: handa Date: Fri, 6 Aug 2004 00:43:57 +0000 Subject: [PATCH] (lookup_gsub): Fix handling of Extension lookup. (lookup_gpos): Support Extension lookup. --- src/otfdrive.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/otfdrive.c b/src/otfdrive.c index 5acdf22..cd50897 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -435,7 +435,7 @@ lookup_gsub (OTF_LookupList *lookup_list, unsigned lookup_list_index, continue; } - switch (lookup->LookupType) + switch (lookup_type) { case 1: if (subtable->Format == 1) @@ -739,9 +739,18 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, /* Try all subtables until one of them handles the current glyph. */ for (i = 0; i < lookup->SubTableCount && gidx == orig_gidx; i++) { + unsigned lookup_type = lookup->LookupType; OTF_LookupSubTableGPOS *subtable = lookup->SubTable.gpos + i; int coverage_idx; + if (lookup_type == 9) + { + OTF_GPOS_Extension1 *extension1 = &subtable->u.extension1; + + lookup_type = extension1->ExtensionLookupType; + subtable = extension1->ExtensionSubtable; + } + if (subtable->Coverage.offset) { coverage_idx = get_coverage_index (&subtable->Coverage, @@ -750,10 +759,10 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, continue; } - switch (lookup->LookupType) + switch (lookup_type) { case 1: - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; if (subtable->Format == 1) { OTF_GPOS_Single1 *single1 = &subtable->u.single1; @@ -797,14 +806,14 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, { if (pair1->ValueFormat1) { - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; g->f.f2.format = pair1->ValueFormat1; g->f.f2.value = &set->PairValueRecord[j].Value1; } gidx = next_gidx; if (pair1->ValueFormat2) { - nextg->positioning_type = lookup->LookupType; + nextg->positioning_type = lookup_type; nextg->f.f2.format = pair1->ValueFormat2; nextg->f.f2.value = &set->PairValueRecord[j].Value2; gidx++; @@ -821,7 +830,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, class2 = get_class_def (&pair2->ClassDef2, nextg->glyph_id); if (pair2->ValueFormat1) { - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; g->f.f2.format = pair2->ValueFormat1; g->f.f2.value = &pair2->Class1Record[class1].Class2Record[class2].Value1; @@ -829,7 +838,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, gidx = next_gidx; if (pair2->ValueFormat2) { - nextg->positioning_type = lookup->LookupType; + nextg->positioning_type = lookup_type; nextg->f.f2.format = pair2->ValueFormat2; nextg->f.f2.value = &pair2->Class1Record[class1].Class2Record[class2].Value2; @@ -843,7 +852,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, { OTF_GPOS_Cursive1 *cursive1 = &subtable->u.cursive1; - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; g->f.f3.entry_anchor = &cursive1->EntryExitRecord[coverage_idx].EntryAnchor; g->f.f3.exit_anchor @@ -879,7 +888,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, g->f.f4.mark_anchor = &mark_record->MarkAnchor; g->f.f4.base_anchor = &base_record->Anchor[mark_record->Class]; - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; } break; @@ -928,7 +937,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, if (lig_anchor[mark_record->Class].AnchorFormat && num_class[mark_record->Class]-- == 0) { - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; g->f.f5.mark_anchor = &mark_record->MarkAnchor; g->f.f5.ligature_anchor = lig_anchor + mark_record->Class; break; @@ -966,7 +975,7 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, g->f.f6.mark1_anchor = &mark1_record->MarkAnchor; g->f.f6.mark2_anchor = &mark2_record->Anchor[mark1_record->Class]; - g->positioning_type = lookup->LookupType; + g->positioning_type = lookup_type; break; } break; @@ -1133,10 +1142,6 @@ lookup_gpos (OTF_LookupList *lookup_list, unsigned lookup_list_index, OTF_ERROR (OTF_ERROR_GPOS_DRIVE, " (invalid subformat)"); break; - case 9: - OTF_ERROR (OTF_ERROR_GPOS_DRIVE, " (not yet supported)"); - break; - default: continue; } -- 1.7.10.4