summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-01 19:10:41 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-01 19:10:41 -0400
commit7257d6625638eaeffa13acd614c0eb53875e8172 (patch)
tree3b0531b8b0be383236695016c262dea63dcbf5e4
parent86f7ff9415d71de495f6257edad2ba991692e042 (diff)
downloadpango-7257d6625638eaeffa13acd614c0eb53875e8172.tar.gz
[HB] Fix for dfont's with multiple faces
-rw-r--r--pango/opentype/hb-ot-layout-open-private.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/pango/opentype/hb-ot-layout-open-private.h b/pango/opentype/hb-ot-layout-open-private.h
index 6a75eb11..76a5ade0 100644
--- a/pango/opentype/hb-ot-layout-open-private.h
+++ b/pango/opentype/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];
}