add font sample thingy

This commit is contained in:
Ben Harris 2020-02-19 19:55:06 -05:00
parent b60fbb40c4
commit 9cb60b7fa4
4 changed files with 64 additions and 7 deletions

View File

@ -1 +1 @@
440
458

61
fonts/display.php Normal file
View File

@ -0,0 +1,61 @@
<?php
$font = $_REQUEST["font"];
if (!is_dir($font) || !is_file("$font/font.css")) die("font not available to preview");
preg_match("/font-family: '(.*)'/", file_get_contents("$font/font.css"), $matches);
$fontname = $matches[1];
?>
<!DOCTYPE html>
<html>
<head>
<title>preview for <?=$font?></title>
<link rel="stylesheet" href="../gruvbox/gruvbox.css">
<link rel="stylesheet" href="https://tilde.team/~ben/fonts/<?=$font?>/font.css">
<style>
* {
font-family: '<?=$fontname?>';
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body id="top">
<main>
<h1><?=$font?></h1>
<p><a href=".">&lt;- back</a></p>
<p></p>
<p>here's a sample of the font</p>
<hr>
<p>
<?php foreach (range('a', 'z') as $letter) { ?>
<?=$letter?>
<?php } ?>
</p>
<p>
<?php foreach (range('A', 'Z') as $letter) { ?>
<?=$letter?>
<?php } ?>
</p>
<p>
<?php foreach (range(0, 9) as $digit) { ?>
<?=$digit?>
<?php } ?>
</p>
<p><?=htmlspecialchars("~ ! @ # $ % ^ & * ( ) - _ = + < > , . / ? `")?></p>
<textarea>try typing something here</textarea>
</main>
</body>
</html>

View File

@ -24,7 +24,7 @@
if (!is_dir($dir)) continue;
$dir = basename($dir); ?>
<h4><a href="<?=$dir?>/"><?=$dir?></a></h4>
<h4><a href="display.php?font=<?=$dir?>"><?=$dir?></a> - <a href="<?=$dir?>/">dir</a></h4>
<pre>@import "https://tilde.team/~ben/fonts/<?=$dir?>/font.css";</pre>
<?php } ?>

View File

@ -113,9 +113,7 @@
<div class="row">
<div class="col-md-4 col-xs-12"><h4>infra</h4><hr>
<ul>
<li><a href="https://pve.bhh.sh:8006/">proxmox</a></li>
<li><a href="https://infra.bhh.sh:8006/">infra</a></li>
<li><a href="https://ca.soyoustart.com/manager/?lang=en_US#/login">sys</a></li>
<li><a href="https://ca.ovh.com/manager/">ovh</a></li>
<li><a href="https://www.namesilo.com/account_domains.php">namesilo</a></li>
</ul>
@ -124,7 +122,6 @@
<div class="col-md-4 col-xs-12"><h4>utils</h4><hr>
<ul>
<li><a href="https://pad.tildeverse.org">cryptpad</a></li>
<li><a href="https://app.standardnotes.org">standardnotes</a></li>
<li><a href="https://ttm.sh">nullpointer</a></li>
<li><a href="https://lobste.rs">lobste.rs</a></li>
<li><a href="https://dev.to">dev.to</a></li>
@ -133,9 +130,8 @@
<div class="col-md-4 col-xs-12"><h4>fedi</h4><hr>
<ul>
<li><a href="https://pleroma.tilde.zone/">tilderoma</a></li>
<li><a href="https://tilde.zone/">mastildon</a></li>
<li><a href="https://tooty.tilde.zone/">tooty</a></li>
<li><a href="https://pleroma.tilde.zone/">tilderoma</a></li>
<li><a href="https://halcyon.tilde.zone/">halcyon</a></li>
<li><a href="https://pinafore.tilde.zone/">pinafore</a></li>
</ul>