Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/canvas/offscreen/set-proprietary-font-names-001-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE>
<title>Setting font of offscreen</title>
<script src="/css/css-fonts/support/font-family-keywords.js"></script>
<script>
let ctx = (new OffscreenCanvas(1024, 50)).getContext('2d');
function setFont(keyword) { ctx.font = `12px ${keyword}` };
kNonGenericFontFamilyKeywords.forEach(setFont);
kGenericFontFamilyKeywords.forEach(keyword => {
setFont(`-webkit-${keyword}`);
});
</script>