static void
free_stream (OTF_Stream *stream)
{
- free (stream->buf);
+ if (stream->buf)
+ free (stream->buf);
free (stream);
}
OTF_GDEF *gdef;
OTF_CALLOC (gdef, 1, "");
- read_gdef_header (stream, (OTF_GDEFHeader *) &gdef->header);
- if (gdef->header.GlyphClassDef)
+ if (stream->buf)
{
- gdef->glyph_class_def.offset = gdef->header.GlyphClassDef;
- read_class_def_without_offset (otf, stream, &gdef->glyph_class_def);
- }
- if (gdef->header.AttachList)
- read_attach_list (otf, stream, gdef->header.AttachList,
- &gdef->attach_list);
- if (gdef->header.LigCaretList)
- read_lig_caret_list (otf, stream, gdef->header.LigCaretList,
- &gdef->lig_caret_list);
- if (gdef->header.MarkAttachClassDef)
- {
- gdef->mark_attach_class_def.offset = gdef->header.MarkAttachClassDef;
- read_class_def_without_offset (otf, stream, &gdef->mark_attach_class_def);
+ read_gdef_header (stream, (OTF_GDEFHeader *) &gdef->header);
+ if (gdef->header.GlyphClassDef)
+ {
+ gdef->glyph_class_def.offset = gdef->header.GlyphClassDef;
+ read_class_def_without_offset (otf, stream,
+ &gdef->glyph_class_def);
+ }
+ if (gdef->header.AttachList)
+ read_attach_list (otf, stream, gdef->header.AttachList,
+ &gdef->attach_list);
+ if (gdef->header.LigCaretList)
+ read_lig_caret_list (otf, stream, gdef->header.LigCaretList,
+ &gdef->lig_caret_list);
+ if (gdef->header.MarkAttachClassDef)
+ {
+ gdef->mark_attach_class_def.offset = gdef->header.MarkAttachClassDef;
+ read_class_def_without_offset (otf, stream,
+ &gdef->mark_attach_class_def);
+ }
}
*table->address = gdef;
internal_data->table_info[OTF_TABLE_TYPE_GPOS].stream = stream;
}
+ if (! internal_data->table_info[OTF_TABLE_TYPE_GDEF].stream)
+ /* We can simulate the GDEF table. */
+ internal_data->table_info[OTF_TABLE_TYPE_GDEF].stream
+ = make_stream ("GDEF");
return 0;
}