Deploy: 2026-05-23 18:30:59
This commit is contained in:
31
backend/api/debug-fonts.php
Normal file
31
backend/api/debug-fonts.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$fontDir = __DIR__ . '/../fonts';
|
||||
$files = [];
|
||||
|
||||
if (is_dir($fontDir)) {
|
||||
$dirFiles = scandir($fontDir);
|
||||
foreach ($dirFiles as $file) {
|
||||
if ($file === '.' || $file === '..') continue;
|
||||
$path = $fontDir . '/' . $file;
|
||||
$files[$file] = [
|
||||
'exists' => true,
|
||||
'size' => filesize($path),
|
||||
'readable' => is_readable($path),
|
||||
'md5' => md5_file($path)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$gdInfo = function_exists('gd_info') ? gd_info() : 'Not available';
|
||||
$ttfSupport = function_exists('imagettftext');
|
||||
|
||||
echo json_encode([
|
||||
'font_dir_exists' => is_dir($fontDir),
|
||||
'font_dir_path' => realpath($fontDir),
|
||||
'files' => $files,
|
||||
'gd_info' => $gdInfo,
|
||||
'imagettftext_exists' => $ttfSupport
|
||||
], JSON_PRETTY_PRINT);
|
||||
?>
|
||||
Reference in New Issue
Block a user