提交 23af767a 编写于 作者: B Behdad Esfahbod

[HB] Fix for dfont's with multiple faces

上级 e97a95f2
...@@ -470,9 +470,11 @@ struct OpenTypeFontFile ...@@ -470,9 +470,11 @@ struct OpenTypeFontFile
} }
const OpenTypeFontFace& get_face (unsigned int i) const const OpenTypeFontFace& get_face (unsigned int i) const
{ {
if (HB_UNLIKELY (i >= get_face_count ())) return Null(OpenTypeFontFace);
switch (tag) { 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 TrueTypeTag: case CFFTag: return *(const OffsetTable*)this;
case TTCTag: return this+TTCHeader::get_for_data ((const char *) this).table[i]; case TTCTag: return this+TTCHeader::get_for_data ((const char *) this).table[i];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册