commit 5eecf8a1ebb02a99c0a3f6c4577a717fd9a01861 Author: Nico Verbruggen Date: Mon Mar 2 16:04:33 2026 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e37b8da --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ebook-fonts diff --git a/index.php b/index.php new file mode 100644 index 0000000..42baae2 --- /dev/null +++ b/index.php @@ -0,0 +1,656 @@ +isFile()) { + continue; + } + if (strtolower($fileInfo->getExtension()) !== 'ttf') { + continue; + } + $relative = str_replace(__DIR__ . '/', '', $fileInfo->getPathname()); + $relative = str_replace(DIRECTORY_SEPARATOR, '/', $relative); + + $fileName = pathinfo($relative, PATHINFO_FILENAME); + $parts = explode('-', $fileName); + $rawFamily = count($parts) > 1 ? implode('-', array_slice($parts, 0, -1)) : $fileName; + $family = str_replace('_', ' ', $rawFamily); + if ($family === 'NV OpenDyslexic') { + continue; + } + $fontFamilies[$family][] = $relative; + $fontEntries[] = $relative; +} + +sort($fontEntries, SORT_NATURAL | SORT_FLAG_CASE); +$fontFilesJson = json_encode($fontEntries, JSON_UNESCAPED_SLASHES); +if ($fontFilesJson === false) { + $fontFilesJson = '[]'; +} + +?> + + + + + + eBook Fonts Showcase + + + +
+
+ + +
+
+
+
+ Pride and Prejudice + 9:00 +
+
+ +
+
+ +
+
+
+ + + + diff --git a/nixpacks.toml b/nixpacks.toml new file mode 100644 index 0000000..3dcc83a --- /dev/null +++ b/nixpacks.toml @@ -0,0 +1,6 @@ +[phases.setup] +nixPkgs = ["php84"] +cmds = ["git clone --branch v3.x --depth 1 https://github.com/nicoverbruggen/ebook-fonts.git ./ebook-fonts"] + +[start] +cmd = "php -S 0.0.0.0:${PORT:-8080} -t ."