forked from mirrors/gecko-dev
Bug 1938548 - Handle CFF2 in UnscaledFontMac::GetFontFileData. a=RyanVM
Original Revision: https://phabricator.services.mozilla.com/D232808 Differential Revision: https://phabricator.services.mozilla.com/D232904
This commit is contained in:
parent
d574cf55f1
commit
d6b4284438
4 changed files with 29 additions and 2 deletions
|
|
@ -290,7 +290,7 @@ bool UnscaledFontMac::GetFontFileData(FontFileDataOutput aDataCallback,
|
|||
bool CFF = false;
|
||||
for (CFIndex i = 0; i < count; i++) {
|
||||
uint32_t tag = (uint32_t)(uintptr_t)CFArrayGetValueAtIndex(tags, i);
|
||||
if (tag == 0x43464620) { // 'CFF '
|
||||
if (tag == 0x43464620 || tag == 0x43464632) { // 'CFF ', 'CFF2'
|
||||
CFF = true;
|
||||
}
|
||||
CFDataRef data = CGFontCopyTableForTag(mFont, tag);
|
||||
|
|
|
|||
27
gfx/tests/crashtests/1938548.html
Normal file
27
gfx/tests/crashtests/1938548.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: test;
|
||||
/* WhiteOnBlack CFF2 font from https://github.com/adobe-fonts/white-on-black-vf,
|
||||
licensed under the SIL Open Font License version 1.1 */
|
||||
src: url(WhiteOnBlack.otf);
|
||||
}
|
||||
div {
|
||||
font: 40px test;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div>㊎</div>
|
||||
|
||||
<canvas id="c"></canvas>
|
||||
|
||||
<script>
|
||||
document.fonts.ready.then(() => {
|
||||
var ctx = document.getElementById("c").getContext("2d");
|
||||
ctx.font = "40px test";
|
||||
ctx.fillText("\u328E", 0, 100);
|
||||
});
|
||||
</script>
|
||||
BIN
gfx/tests/crashtests/WhiteOnBlack.otf
Normal file
BIN
gfx/tests/crashtests/WhiteOnBlack.otf
Normal file
Binary file not shown.
|
|
@ -225,4 +225,4 @@ load 1825450.html
|
|||
load 1683679.html
|
||||
load 1843622.html
|
||||
load 1898569.html
|
||||
|
||||
load 1938548.html
|
||||
|
|
|
|||
Loading…
Reference in a new issue