fix: ACTUALLY fix font theming

This commit is contained in:
Twig 2025-07-15 00:44:41 +02:00
parent 64131e6f9c
commit 63dbfa2a0d
No known key found for this signature in database
6 changed files with 7 additions and 6 deletions

View file

@ -27,7 +27,8 @@ export default (name: string, seed: string): string => {
ctx.fillStyle = 'white'
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
const preferredFont = document.documentElement.style.getPropertyValue("--preferred-font")
const root = document.documentElement;
const preferredFont = getComputedStyle(root).getPropertyValue("--preferred-font");
ctx.font = `bold 96px ${preferredFont}, Arial, Helvetica, sans-serif`
// 136 isn't actually centered, but it *looks* centered
ctx.fillText(previewName, 128, 136)