From 23af767a4475fecc1fe9fe9108f12c05c89bc8c9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 1 Aug 2009 19:10:41 -0400 Subject: [PATCH] [HB] Fix for dfont's with multiple faces --- src/hb-ot-layout-open-private.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-layout-open-private.h b/src/hb-ot-layout-open-private.h index 6a75eb1..76a5ade 100644 --- a/src/hb-ot-layout-open-private.h +++ b/src/hb-ot-layout-open-private.h @@ -470,9 +470,11 @@ struct OpenTypeFontFile } const OpenTypeFontFace& get_face (unsigned int i) const { - if (HB_UNLIKELY (i >= get_face_count ())) return Null(OpenTypeFontFace); switch (tag) { - default: /* Never happens because of the if above */ + default: return Null(OpenTypeFontFace); + /* Note: for non-collection SFNT data we ignore index. This is because + * Apple dfont container is a container of SFNT's. So each SFNT is a + * non-TTC, but the index is more than zero. */ case TrueTypeTag: case CFFTag: return *(const OffsetTable*)this; case TTCTag: return this+TTCHeader::get_for_data ((const char *) this).table[i]; } -- 2.7.4