Minor updates
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
repos/ebook-fonts
|
||||
public/repos/ebook-fonts
|
||||
.env
|
||||
|
||||
27
README.md
@@ -1,5 +1,26 @@
|
||||
# ebook-fonts showcase
|
||||
# Showcase for ebook-fonts
|
||||
|
||||
A website to showcase my [font collection](https://github.com/nicoverbruggen/ebook-fonts).
|
||||
**This repository is just to make the source code available.** You can visit the interactive showcase here: [ebook-fonts.nicoverbruggen.be](https://ebook-fonts.nicoverbruggen.be).
|
||||
|
||||
You can visit the website at: https://ebook-fonts.nicoverbruggen.be.
|
||||
A website to showcase my [font collection](https://github.com/nicoverbruggen/ebook-fonts). Browse and preview fonts with adjustable size, line height, dark mode, and bezel color.
|
||||
|
||||
## Project structure
|
||||
|
||||
```
|
||||
public/ Web root (served to browsers)
|
||||
assets/ CSS, JS, SVGs, favicons
|
||||
src/ PHP includes (not web-accessible)
|
||||
load_fonts.php Scans the font repo and builds the font list
|
||||
```
|
||||
|
||||
## Local development
|
||||
|
||||
```bash
|
||||
./serve-locally.sh
|
||||
```
|
||||
|
||||
Starts a PHP dev server on `http://localhost:8888`. Set `PORT` to use a different port.
|
||||
|
||||
## Deployment
|
||||
|
||||
Fonts are cloned from [ebook-fonts](https://github.com/nicoverbruggen/ebook-fonts) during the build phase (see `nixpacks.toml`).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[phases.setup]
|
||||
nixPkgs = ["php84"]
|
||||
cmds = ["git clone --branch trunk --depth 1 https://github.com/nicoverbruggen/ebook-fonts.git ./repos/ebook-fonts"]
|
||||
cmds = ["git clone --branch trunk --depth 1 https://github.com/nicoverbruggen/ebook-fonts.git ./public/repos/ebook-fonts"]
|
||||
|
||||
[start]
|
||||
cmd = "php -S 0.0.0.0:${PORT:-8080} -t ."
|
||||
cmd = "php -S 0.0.0.0:${PORT:-8080} -t public"
|
||||
|
||||
BIN
public/assets/favicon/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
public/assets/favicon/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
public/assets/favicon/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
21
public/assets/favicon/site.webmanifest
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "eBook Fonts Showcase",
|
||||
"short_name": "Font Showcase",
|
||||
"icons": [
|
||||
{
|
||||
"src": "assets/favicon/web-app-manifest-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "assets/favicon/web-app-manifest-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
}
|
||||
],
|
||||
"theme_color": "#f6e9de",
|
||||
"background_color": "#fffdf8",
|
||||
"display": "standalone"
|
||||
}
|
||||
BIN
public/assets/favicon/web-app-manifest-192x192.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
public/assets/favicon/web-app-manifest-512x512.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
13
public/assets/showcase.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 1080 1080" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<rect x="-46.172" y="-85.697" width="1171.11" height="1236.78" style="fill:rgb(110,54,27);"/>
|
||||
<g transform="matrix(1.26583,0,0,1.25522,-768.246,-21.9471)">
|
||||
<g transform="matrix(529.24,0,0,529.24,686.323,625.61)">
|
||||
<path d="M0.68,-0.07L0.764,-0.046L0.764,-0L0.473,-0L0.473,-0.046L0.558,-0.069L0.496,-0.234L0.224,-0.234L0.167,-0.069L0.252,-0.046L0.252,-0L0.006,-0L0.006,-0.046L0.084,-0.069L0.318,-0.707L0.433,-0.707L0.68,-0.07ZM0.354,-0.61L0.25,-0.308L0.468,-0.308L0.354,-0.61Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
<g transform="matrix(529.24,0,0,529.24,1087.49,625.61)">
|
||||
<path d="M0.349,-0.116C0.343,-0.093 0.336,-0.073 0.325,-0.056C0.311,-0.034 0.294,-0.017 0.273,-0.006C0.251,0.006 0.226,0.012 0.198,0.012C0.152,0.012 0.116,-0.001 0.09,-0.025C0.064,-0.05 0.052,-0.085 0.052,-0.131C0.052,-0.157 0.056,-0.18 0.065,-0.2C0.074,-0.221 0.091,-0.239 0.116,-0.256C0.14,-0.273 0.175,-0.288 0.221,-0.301C0.255,-0.311 0.297,-0.321 0.347,-0.331L0.347,-0.364C0.347,-0.4 0.34,-0.427 0.325,-0.445C0.311,-0.463 0.285,-0.472 0.248,-0.472C0.23,-0.472 0.213,-0.47 0.198,-0.468C0.193,-0.467 0.188,-0.467 0.183,-0.466C0.182,-0.463 0.181,-0.46 0.181,-0.457C0.178,-0.446 0.175,-0.436 0.172,-0.427C0.169,-0.418 0.166,-0.409 0.163,-0.401C0.157,-0.388 0.15,-0.38 0.141,-0.377C0.132,-0.373 0.121,-0.372 0.108,-0.372C0.09,-0.372 0.076,-0.375 0.066,-0.383C0.057,-0.391 0.052,-0.4 0.052,-0.412C0.052,-0.425 0.058,-0.438 0.069,-0.453C0.08,-0.468 0.096,-0.482 0.117,-0.495C0.138,-0.508 0.162,-0.519 0.19,-0.528C0.218,-0.537 0.249,-0.541 0.282,-0.541C0.323,-0.541 0.356,-0.535 0.381,-0.522C0.405,-0.509 0.423,-0.49 0.434,-0.467C0.445,-0.443 0.45,-0.414 0.45,-0.381L0.45,-0.13C0.45,-0.117 0.452,-0.106 0.456,-0.098C0.459,-0.09 0.465,-0.084 0.472,-0.08C0.48,-0.076 0.489,-0.074 0.5,-0.074C0.507,-0.074 0.515,-0.075 0.523,-0.077C0.531,-0.079 0.54,-0.081 0.548,-0.084L0.548,-0.039C0.532,-0.023 0.515,-0.011 0.497,-0.003C0.479,0.005 0.462,0.009 0.445,0.009C0.425,0.009 0.408,0.004 0.394,-0.006C0.38,-0.016 0.369,-0.032 0.361,-0.053C0.354,-0.07 0.35,-0.091 0.349,-0.116ZM0.347,-0.27C0.316,-0.264 0.289,-0.258 0.268,-0.252C0.238,-0.243 0.216,-0.234 0.2,-0.225C0.185,-0.215 0.174,-0.204 0.169,-0.193C0.164,-0.181 0.161,-0.168 0.161,-0.153C0.161,-0.127 0.168,-0.108 0.181,-0.095C0.195,-0.082 0.215,-0.076 0.242,-0.076C0.262,-0.076 0.28,-0.08 0.296,-0.088C0.311,-0.096 0.324,-0.107 0.333,-0.121C0.342,-0.135 0.347,-0.15 0.347,-0.168L0.347,-0.27Z" style="fill:white;fill-rule:nonzero;"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
define('APP_ROOT', __DIR__);
|
||||
require __DIR__ . '/web/load_fonts.php';
|
||||
define('APP_ROOT', dirname(__DIR__));
|
||||
require __DIR__ . '/../src/load_fonts.php';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -12,7 +12,11 @@ require __DIR__ . '/web/load_fonts.php';
|
||||
<meta property="og:title" content="eBook Fonts Showcase" />
|
||||
<meta property="og:description" content="Preview a variety of fonts that are part of the 'ebook-fonts' collection on GitHub." />
|
||||
<meta property="og:type" content="website" />
|
||||
<link rel="icon" href="assets/showcase.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="assets/favicon/favicon.svg">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="assets/favicon/favicon-96x96.png">
|
||||
<link rel="icon" href="assets/favicon/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png">
|
||||
<link rel="manifest" href="assets/favicon/site.webmanifest">
|
||||
<title>eBook Fonts Showcase</title>
|
||||
<link rel="stylesheet" href="assets/styles.css">
|
||||
<?php if ($additionalTags = getenv('ADDITIONAL_TAGS')): ?>
|
||||
6
serve-locally.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PORT="${PORT:-8888}"
|
||||
echo "Starting server on http://localhost:${PORT}"
|
||||
php -S "0.0.0.0:${PORT}" -t public
|
||||
@@ -4,7 +4,8 @@ if (!defined('APP_ROOT')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$fontRoot = APP_ROOT . '/repos/ebook-fonts/fonts';
|
||||
$fontRoot = APP_ROOT . '/public/repos/ebook-fonts/fonts';
|
||||
$webRoot = APP_ROOT . '/public';
|
||||
$fontEntries = [];
|
||||
|
||||
$iterator = new RecursiveIteratorIterator(
|
||||
@@ -21,7 +22,7 @@ foreach ($iterator as $fileInfo) {
|
||||
if (str_contains($fileInfo->getFilename(), 'NV_OpenDyslexic')) {
|
||||
continue;
|
||||
}
|
||||
$relative = str_replace(APP_ROOT . '/', '', $fileInfo->getPathname());
|
||||
$relative = str_replace($webRoot . '/', '', $fileInfo->getPathname());
|
||||
$relative = str_replace(DIRECTORY_SEPARATOR, '/', $relative);
|
||||
$fontEntries[] = $relative;
|
||||
}
|
||||