Source code

Revision control

Copy as Markdown

Other Tools

/* Any copyright is dedicated to the Public Domain.
"use strict";
self.onmessage = async ({ data: { bytes, at } }) => {
while (Date.now() < at) {
// Busy-wait until the shared start time.
}
const face = new FontFace("test", bytes);
const statusAfterConstructor = face.status;
self.fonts.add(face);
let error = null;
try {
await face.loaded;
} catch (e) {
error = `${e.name}: ${e.message}`;
}
self.postMessage({ statusAfterConstructor, error });
};
self.postMessage("ready");