Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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>