feat: add preferred font field to themes
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful

This commit is contained in:
Twig 2025-07-15 00:25:52 +02:00
parent 26243a8cd6
commit 186d3c7a0a
No known key found for this signature in database
7 changed files with 19 additions and 13 deletions

View file

@ -27,7 +27,8 @@ export default (name: string, seed: string): string => {
ctx.fillStyle = 'white'
ctx.textAlign = 'center'
ctx.textBaseline = 'middle'
ctx.font = 'bold 96px Arial, Helvetica, sans-serif'
const preferredFont = document.documentElement.style.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)