diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index 062ab9667afe..22e659327900 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -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)