
Each font's name is rendered to an OffscreenCanvas, and that image is cached in OPFS. There's a list of links to download font files in the preview.
71 lines
No EOL
1.6 KiB
HTML
71 lines
No EOL
1.6 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width">
|
|
<title>Fontsource font preview</title>
|
|
<script type="module" src="script.js"></script>
|
|
<style id="font-style"></style>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
<nav>
|
|
<section id="controls">
|
|
<label for="font-family">Font:</label>
|
|
<select id="font-family">
|
|
</select>
|
|
<button type="button" id="random-font">I'm feeling lucky</button>
|
|
</section>
|
|
|
|
<ul id="font-list"></ul>
|
|
</nav>
|
|
<main>
|
|
<header>
|
|
<h1>Fontsource font preview</h1>
|
|
</header>
|
|
<section id="intro">
|
|
<p>This page shows fonts loaded from <a href="https://fontsource.org">Fontsource</a>.</p>
|
|
</section>
|
|
|
|
<section id="info">
|
|
<h2>About this font</h2>
|
|
|
|
<p><a id="font-link" target="fontsource"></a></p>
|
|
|
|
<section id="variable">
|
|
<h3>Variable axes</h3>
|
|
|
|
<ul id="variable-axes">
|
|
</ul>
|
|
</section>
|
|
|
|
<dl>
|
|
<dt>Category</dt>
|
|
<dd id="category"></dd>
|
|
|
|
<dt>Styles</dt>
|
|
<dd><ul id="styles"></ul></dd>
|
|
|
|
<dt>Weights</dt>
|
|
<dd><ul id="weights"></ul></dd>
|
|
|
|
<dt>Unicode ranges</dt>
|
|
<dd><ul id="unicode-ranges"></ul></dd>
|
|
</dl>
|
|
|
|
</section>
|
|
|
|
<section id="files">
|
|
<h2>Files</h2>
|
|
<ul id="file-links">
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="code">
|
|
<h2>CSS</h2>
|
|
<pre id="css-display"></pre>
|
|
</section>
|
|
|
|
</main>
|
|
</body>
|
|
</html> |