something something for fonts preview

I don't know if its gonna work, as it didn't for me, but we'll see :3
This commit is contained in:
kmmiio99o 2025-12-20 00:21:56 +01:00
parent 10df6ae399
commit bd7f69539c

View file

@ -0,0 +1,20 @@
<head>
<meta name="viewport" content="initial-scale=1.0" />
</head>
<body style="overflow: hidden; padding: 0; margin: 0"></body>
<script>
const props = $$props;
new FontFace("Preview", `url(${props.family})`).load().then((font) => {
document.fonts.add(font);
const p = document.createElement("p");
p.textContent = props.text;
p.style.fontFamily = font.family;
p.style.fontSize = `${props.size}px`;
p.style.color = props.color;
document.body.appendChild(p);
ReactNativeWebView.postMessage(true);
});
</script>