зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1320665) for Windows failures in 1320665-cmap-format-13.html
Backed out changeset b2bac083c74e (bug 1320665) Backed out changeset 59bdf1eb5d2d (bug 1320665) MozReview-Commit-ID: 2M9tcerb3pm
This commit is contained in:
Родитель
d1584879a8
Коммит
ce8fd410e7
|
@ -139,13 +139,9 @@ gfxFontUtils::ReadCMAPTableFormat10(const uint8_t *aBuf, uint32_t aLength,
|
|||
}
|
||||
|
||||
nsresult
|
||||
gfxFontUtils::ReadCMAPTableFormat12or13(const uint8_t *aBuf, uint32_t aLength,
|
||||
gfxSparseBitSet& aCharacterMap)
|
||||
gfxFontUtils::ReadCMAPTableFormat12(const uint8_t *aBuf, uint32_t aLength,
|
||||
gfxSparseBitSet& aCharacterMap)
|
||||
{
|
||||
// Format 13 has the same structure as format 12, the only difference is
|
||||
// the interpretation of the glyphID field. So we can share the code here
|
||||
// that reads the table and just records character coverage.
|
||||
|
||||
// Ensure table is large enough that we can safely read the header
|
||||
NS_ENSURE_TRUE(aLength >= sizeof(Format12CmapHeader),
|
||||
NS_ERROR_GFX_CMAP_MALFORMED);
|
||||
|
@ -153,10 +149,9 @@ gfxFontUtils::ReadCMAPTableFormat12or13(const uint8_t *aBuf, uint32_t aLength,
|
|||
// Sanity-check header fields
|
||||
const Format12CmapHeader *cmap12 =
|
||||
reinterpret_cast<const Format12CmapHeader*>(aBuf);
|
||||
NS_ENSURE_TRUE(uint16_t(cmap12->format) == 12 ||
|
||||
uint16_t(cmap12->format) == 13,
|
||||
NS_ENSURE_TRUE(uint16_t(cmap12->format) == 12,
|
||||
NS_ERROR_GFX_CMAP_MALFORMED);
|
||||
NS_ENSURE_TRUE(uint16_t(cmap12->reserved) == 0,
|
||||
NS_ENSURE_TRUE(uint16_t(cmap12->reserved) == 0,
|
||||
NS_ERROR_GFX_CMAP_MALFORMED);
|
||||
|
||||
uint32_t tablelen = cmap12->length;
|
||||
|
@ -477,7 +472,7 @@ gfxFontUtils::FindPreferredSubtable(const uint8_t *aBuf, uint32_t aBufLength,
|
|||
keepFormat = format;
|
||||
*aTableOffset = offset;
|
||||
*aSymbolEncoding = false;
|
||||
} else if ((format == 10 || format == 12 || format == 13) &&
|
||||
} else if ((format == 10 || format == 12) &&
|
||||
acceptableUCS4Encoding(platformID, encodingID, keepFormat)) {
|
||||
keepFormat = format;
|
||||
*aTableOffset = offset;
|
||||
|
@ -526,11 +521,10 @@ gfxFontUtils::ReadCMAP(const uint8_t *aBuf, uint32_t aBufLength,
|
|||
aCharacterMap);
|
||||
|
||||
case 12:
|
||||
case 13:
|
||||
aUnicodeFont = true;
|
||||
aSymbolFont = false;
|
||||
return ReadCMAPTableFormat12or13(aBuf + offset, aBufLength - offset,
|
||||
aCharacterMap);
|
||||
return ReadCMAPTableFormat12(aBuf + offset, aBufLength - offset,
|
||||
aCharacterMap);
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -657,17 +651,13 @@ gfxFontUtils::MapCharToGlyphFormat10(const uint8_t *aBuf, uint32_t aCh)
|
|||
}
|
||||
|
||||
uint32_t
|
||||
gfxFontUtils::MapCharToGlyphFormat12or13(const uint8_t *aBuf, uint32_t aCh)
|
||||
gfxFontUtils::MapCharToGlyphFormat12(const uint8_t *aBuf, uint32_t aCh)
|
||||
{
|
||||
// The only difference between formats 12 and 13 is the interpretation of
|
||||
// the glyphId field. So the code here uses the same "Format12" structures,
|
||||
// etc., to handle both subtable formats.
|
||||
|
||||
const Format12CmapHeader *cmap12 =
|
||||
reinterpret_cast<const Format12CmapHeader*>(aBuf);
|
||||
|
||||
// We know that numGroups is within range for the subtable size
|
||||
// because it was checked by ReadCMAPTableFormat12or13.
|
||||
// because it was checked by ReadCMAPTableFormat12.
|
||||
uint32_t numGroups = cmap12->numGroups;
|
||||
|
||||
// The array of groups immediately follows the subtable header.
|
||||
|
@ -698,13 +688,10 @@ gfxFontUtils::MapCharToGlyphFormat12or13(const uint8_t *aBuf, uint32_t aCh)
|
|||
}
|
||||
|
||||
// Check if the character is actually present in the range and return
|
||||
// the corresponding glyph ID. Here is where formats 12 and 13 interpret
|
||||
// the startGlyphId (12) or glyphId (13) field differently
|
||||
// the corresponding glyph ID
|
||||
startCharCode = groups[range].startCharCode;
|
||||
if (startCharCode <= aCh && groups[range].endCharCode >= aCh) {
|
||||
return uint16_t(cmap12->format) == 12
|
||||
? uint16_t(groups[range].startGlyphId) + aCh - startCharCode
|
||||
: uint16_t(groups[range].startGlyphId);
|
||||
return groups[range].startGlyphId + aCh - startCharCode;
|
||||
}
|
||||
|
||||
// Else it's not present, so return the .notdef glyph
|
||||
|
@ -780,8 +767,7 @@ gfxFontUtils::MapCharToGlyph(const uint8_t *aCmapBuf, uint32_t aBufLength,
|
|||
gid = MapCharToGlyphFormat10(aCmapBuf + offset, aUnicode);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
gid = MapCharToGlyphFormat12or13(aCmapBuf + offset, aUnicode);
|
||||
gid = MapCharToGlyphFormat12(aCmapBuf + offset, aUnicode);
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("unsupported cmap format, glyphs will be missing");
|
||||
|
@ -807,9 +793,8 @@ gfxFontUtils::MapCharToGlyph(const uint8_t *aCmapBuf, uint32_t aBufLength,
|
|||
aUnicode);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
varGID = MapCharToGlyphFormat12or13(aCmapBuf + offset,
|
||||
aUnicode);
|
||||
varGID = MapCharToGlyphFormat12(aCmapBuf + offset,
|
||||
aUnicode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -781,8 +781,8 @@ public:
|
|||
gfxSparseBitSet& aCharacterMap);
|
||||
|
||||
static nsresult
|
||||
ReadCMAPTableFormat12or13(const uint8_t *aBuf, uint32_t aLength,
|
||||
gfxSparseBitSet& aCharacterMap);
|
||||
ReadCMAPTableFormat12(const uint8_t *aBuf, uint32_t aLength,
|
||||
gfxSparseBitSet& aCharacterMap);
|
||||
|
||||
static nsresult
|
||||
ReadCMAPTableFormat4(const uint8_t *aBuf, uint32_t aLength,
|
||||
|
@ -810,7 +810,7 @@ public:
|
|||
MapCharToGlyphFormat10(const uint8_t *aBuf, uint32_t aCh);
|
||||
|
||||
static uint32_t
|
||||
MapCharToGlyphFormat12or13(const uint8_t *aBuf, uint32_t aCh);
|
||||
MapCharToGlyphFormat12(const uint8_t *aBuf, uint32_t aCh);
|
||||
|
||||
static uint16_t
|
||||
MapUVSToGlyphFormat14(const uint8_t *aBuf, uint32_t aCh, uint32_t aVS);
|
||||
|
|
|
@ -131,10 +131,8 @@ gfxHarfBuzzShaper::GetNominalGlyph(hb_codepoint_t unicode) const
|
|||
unicode);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
gid =
|
||||
gfxFontUtils::MapCharToGlyphFormat12or13(data + mSubtableOffset,
|
||||
unicode);
|
||||
gid = gfxFontUtils::MapCharToGlyphFormat12(data + mSubtableOffset,
|
||||
unicode);
|
||||
break;
|
||||
default:
|
||||
NS_WARNING("unsupported cmap format, glyphs will be missing");
|
||||
|
@ -192,10 +190,8 @@ gfxHarfBuzzShaper::GetVariationGlyph(hb_codepoint_t unicode,
|
|||
compat);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
return
|
||||
gfxFontUtils::MapCharToGlyphFormat12or13(data + mSubtableOffset,
|
||||
compat);
|
||||
return gfxFontUtils::MapCharToGlyphFormat12(data + mSubtableOffset,
|
||||
compat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<style>
|
||||
body {
|
||||
font-family: monospace;
|
||||
font-size: 48px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
PASS
|
|
@ -1,22 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset=utf-8>
|
||||
<style>
|
||||
/* Adobe Blank 2 font from https://github.com/adobe-fonts/adobe-blank-2/blob/master/adobe-blank-2.css,
|
||||
licensed under the SIL Open Font License, Version 1.1. http://scripts.sil.org/OFL */
|
||||
@font-face {
|
||||
font-family: AdobeBlank2;
|
||||
src: url("data:font/opentype;base64,T1RUTwAKAIAAAwAgQ0ZGIN6nWacAAAfMAAABMURTSUcAAAABAAAJCAAAAAhPUy8yAF+xmwAAARAAAABgY21hcAE0tLwAAAasAAABAGhlYWQIOsNZAAAArAAAADZoaGVhB1oD7wAAAOQAAAAkaG10eAPoAHwAAAkAAAAACG1heHAAAlAAAAABCAAAAAZuYW1lc0mXUAAAAXAAAAU6cG9zdP+4ADIAAAesAAAAIAABAAAAAgBB1Q6SE18PPPUAAwPoAAAAANKdP6AAAAAA0p0/oAB8/4gDbANwAAAAAwACAAAAAAAAAAEAAANw/4gAAAPoAHwAfANsAAEAAAAAAAAAAAAAAAAAAAACAABQAAACAAAAAwPoAZAABQAAAooCWAAAAEsCigJYAAABXgAyANwAAAAAAAAAAAAAAAD3/67/+9///w/gAD8AAAAAQURCTwBAAAD//wNw/4gAAANwAHhgLwH/AAAAAAAAAAAAAAAgAAAAAAALAIoAAwABBAkAAACUAAAAAwABBAkAAQAaAJQAAwABBAkAAgAOAK4AAwABBAkAAwA4ALwAAwABBAkABAAaAJQAAwABBAkABQB0APQAAwABBAkABgAWAWgAAwABBAkACAA0AX4AAwABBAkACwA0AbIAAwABBAkADQKWAeYAAwABBAkADgA0BHwAQwBvAHAAeQByAGkAZwBoAHQAIACpACAAMgAwADEAMwAsACAAMgAwADEANQAgAEEAZABvAGIAZQAgAFMAeQBzAHQAZQBtAHMAIABJAG4AYwBvAHIAcABvAHIAYQB0AGUAZAAgACgAaAB0AHQAcAA6AC8ALwB3AHcAdwAuAGEAZABvAGIAZQAuAGMAbwBtAC8AKQAuAEEAZABvAGIAZQAgAEIAbABhAG4AawAgADIAUgBlAGcAdQBsAGEAcgAyAC4AMAAwADEAOwBBAEQAQgBPADsAQQBkAG8AYgBlAEIAbABh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AaQBvAG4AcwAgAGcAbwB2AGUAcgBuAGkAbgBnACAAeQBvAHUAcgAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUALgBoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAAEAAwAKAAAADAANAAAAAAD0AAAAAAAAABMAAAAAAADX/wAAAAEAAOAAAAD9zwAAAAEAAP3wAAD//QAAAAEAAQAAAAH//QAAAAEAAgAAAAL//QAAAAEAAwAAAAP//QAAAAEABAAAAAT//QAAAAEABQAAAAX//QAAAAEABgAAAAb//QAAAAEABwAAAAf//QAAAAEACAAAAAj//QAAAAEACQAAAAn//QAAAAEACgAAAAr//QAAAAEACwAAAAv//QAAAAEADAAAAAz//QAAAAEADQAAAA3//QAAAAEADgAAAA7//QAAAAEADwAAAA///QAAAAEAEAAAABD//QAAAAEAAwAAAAAAAP+1ADIAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAIAAQEBDEFkb2JlQmxhbmsyAAEBAS34G/gciwwe+B0B+B4Ci/sM+gD6BAUeKgAfDB+NDCL3Uw/3WRH3Vgwl96wMJAAFAQEGDlZjcEFkb2JlSWRlbnRpdHlDb3B5cmlnaHQgMjAxMywgMjAxNSBBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZCAoaHR0cDovL3d3dy5hZG9iZS5jb20vKS5BZG9iZSBCbGFuayAyQWRvYmVCbGFuazItMgAAAAABAAAAAAIBAUxO+nz7DLf6JLcB9xC3+Sy3A/cQ+gQV/nz5hPp8B/1Y/icV+dIH98X8MwWmsBX7xfg3Bfj2BqZiFf3SB/vF+DMFcGYV98X8NwX89gYOiw4AAQEBCfgfDCaX97kS+46LHAVGiwa9Cr0LAAAAA+gAfAAAAAAAAAABAAAAAA==");
|
||||
}
|
||||
body {
|
||||
font-family: monospace;
|
||||
font-size: 48px;
|
||||
}
|
||||
span {
|
||||
font-family: AdobeBlank2;
|
||||
font-size: 24px; /* smaller size to avoid risk of disrupting line height */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
P<span> (fail) </span>A<span>ሴ顶ꯍ</span>S<span>𐐀🌳</span>S
|
|
@ -185,7 +185,6 @@ HTTP(..) != fallback-mark-stacking-1.html fallback-mark-stacking-1-notref.html
|
|||
== 745555-2.html 745555-2-ref.html
|
||||
== 820255.html 820255-ref.html
|
||||
HTTP(..) != 1170688.html 1170688-ref.html
|
||||
== 1320665-cmap-format-13.html 1320665-cmap-format-13-ref.html
|
||||
|
||||
# ensure emoji chars don't render blank (bug 715798, bug 779042);
|
||||
# should at least render hexboxes if there's no font support
|
||||
|
|
Загрузка…
Ссылка в новой задаче