From 4a629f97d8d855db0f9b253e6785fef8f7462871 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 17 Dec 2009 06:15:06 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 7 +++++++ src/otfdrive.c | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a64f9e..49ae63f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-12-17 Kenichi Handa + + * src/otfdrive.c (gstring_subst): Update g->MarkAttachGlass. + (lookup_gsub): Update g->GlyphClass and g->MarkAttachGlass. + (OTF_drive_gdef): Don't return error even if GDEF table doesn't + exist. + 2009-11-30 Kenichi Handa * src/otfdrive.c (OTF_drive_gsub_internal): Fix previous change. diff --git a/src/otfdrive.c b/src/otfdrive.c index 3dd3c16..c807e56 100644 --- a/src/otfdrive.c +++ b/src/otfdrive.c @@ -112,11 +112,14 @@ gstring_subst (OTF *otf, OTF_GlyphString *gstring, int from, int to, int flag, if (gstring->glyphs[from + i].glyph_id != ids[i]) { gstring->glyphs[from + i].c = 0; - if (otf->gdef) + if (otf->gdef && otf->gdef->glyph_class_def.offset) gstring->glyphs[from + i].GlyphClass = get_class_def (&otf->gdef->glyph_class_def, ids[i]); else gstring->glyphs[from + i].GlyphClass = 0; + if (otf->gdef && otf->gdef->mark_attach_class_def.offset) + gstring->glyphs[from + i].MarkAttachClass + = get_class_def (&otf->gdef->mark_attach_class_def, ids[i]); } gstring->glyphs[from + i].glyph_id = ids[i]; gstring->glyphs[from + i].positioning_type = 1; @@ -456,6 +459,14 @@ lookup_gsub (OTF *otf, OTF_LookupList *lookup_list, unsigned lookup_list_index, g->glyph_id += subtable->u.single1.DeltaGlyphID; else g->glyph_id = subtable->u.single2.Substitute[coverage_idx]; + if (otf->gdef && otf->gdef->glyph_class_def.offset) + g->GlyphClass + = get_class_def (&otf->gdef->glyph_class_def, g->glyph_id); + else + g->GlyphClass = 0; + if (otf->gdef && otf->gdef->mark_attach_class_def.offset) + g->MarkAttachClass + = get_class_def (&otf->gdef->mark_attach_class_def, g->glyph_id); g->positioning_type = 1; gidx++; break; @@ -1692,19 +1703,17 @@ OTF_get_variation_glyphs (OTF *otf, int c, OTF_GlyphID code[256]) return n; } - int OTF_drive_gdef (OTF *otf, OTF_GlyphString *gstring) { OTF_GDEF *gdef; int i; - if (! otf->gdef - && OTF_get_table (otf, "GDEF") < 0) - return -1; + if (! otf->gdef) + OTF_get_table (otf, "GDEF"); gdef = otf->gdef; - if (gdef->glyph_class_def.offset) + if (gdef && gdef->glyph_class_def.offset) for (i = 0; i < gstring->used; i++) gstring->glyphs[i].GlyphClass = get_class_def (&gdef->glyph_class_def, -- 1.7.10.4