Bug 1269187 - Accept a Unicode-platform 'cmap' subtable if there's no MS-platform subtable in the font. r=emk

This commit is contained in:
Jonathan Kew 2016-05-03 16:48:48 +01:00
Родитель fb5e0a3be3
Коммит 9e554db122
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -379,9 +379,8 @@ gfxFontUtils::ReadCMAPTableFormat14(const uint8_t *aBuf, uint32_t aLength,
return NS_OK;
}
// Windows requires fonts to have a format-4 cmap with a Microsoft ID (3). On the Mac, fonts either have
// a format-4 cmap with Microsoft platform/encoding id or they have one with a platformID == Unicode (0)
// For fonts with two format-4 tables, the first one (Unicode platform) is preferred on the Mac.
// For fonts with two format-4 tables, the first one (Unicode platform) is preferred on the Mac;
// on other platforms we allow the Microsoft-platform subtable to replace it.
#if defined(XP_MACOSX)
#define acceptableFormat4(p,e,k) (((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDMicrosoft && !(k)) || \
@ -392,7 +391,8 @@ gfxFontUtils::ReadCMAPTableFormat14(const uint8_t *aBuf, uint32_t aLength,
((p) == PLATFORM_ID_UNICODE && \
((e) != EncodingIDUVSForUnicodePlatform)))
#else
#define acceptableFormat4(p,e,k) ((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDMicrosoft)
#define acceptableFormat4(p,e,k) (((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDMicrosoft) || \
((p) == PLATFORM_ID_UNICODE))
#define acceptableUCS4Encoding(p, e, k) \
((p) == PLATFORM_ID_MICROSOFT && (e) == EncodingIDUCS4ForMicrosoftPlatform)