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:
parent
10df6ae399
commit
bd7f69539c
1 changed files with 20 additions and 0 deletions
20
src/core/ui/settings/pages/Fonts/preview.html
Normal file
20
src/core/ui/settings/pages/Fonts/preview.html
Normal 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>
|
||||
Loading…
Add table
Reference in a new issue