impl #309 observe font face set changes

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 6c6f9c14da
commit 8b198b338e
7 changed files with 121 additions and 4 deletions

View File

@@ -813,6 +813,22 @@ export class Replayer {
} catch (error) {
this.warnCanvasMutationFailed(d, d.id, error);
}
break;
}
case IncrementalSource.Font: {
try {
const fontFace = new FontFace(
d.family,
d.buffer ? new Uint8Array(JSON.parse(d.fontSource)) : d.fontSource,
d.descriptors,
);
this.iframe.contentDocument?.fonts.add(fontFace);
} catch (error) {
if (this.config.showWarning) {
console.warn(error);
}
}
break;
}
default:
}