Deploy: 2026-05-23 18:56:57

This commit is contained in:
Hamza-Ayed
2026-05-23 18:56:57 +03:00
parent 88788e6ea1
commit 6c1d3ed255
2 changed files with 22 additions and 60 deletions

View File

@@ -25,23 +25,20 @@ try {
$fontDir = realpath(__DIR__ . '/../fonts');
$roboto = $fontDir ? $fontDir . '/Roboto-Bold.ttf' : '';
$lora = $fontDir ? $fontDir . '/Lora-Bold.ttf' : '';
$cairo = $fontDir ? $fontDir . '/Cairo-Bold.ttf' : '';
$results = [
'font_dir' => $fontDir,
'roboto_path' => $roboto,
'lora_path' => $lora,
'cairo_path' => $cairo,
'roboto_exists' => file_exists($roboto),
'lora_exists' => file_exists($lora),
'cairo_exists' => file_exists($cairo),
'php_errors_during_init' => $errors
];
// Reset captured errors for rendering phase
$errors = [];
$im = imagecreatetruecolor(200, 200);
$im = imagecreatetruecolor(100, 100);
$color = imagecolorallocate($im, 0, 0, 0);
function testFontDigits($im, $fontPath, $color) {
@@ -63,15 +60,6 @@ function testFontDigits($im, $fontPath, $color) {
$results['Roboto-Bold.ttf_digits'] = testFontDigits($im, $roboto, $color);
$results['Lora-Bold.ttf_digits'] = testFontDigits($im, $lora, $color);
$results['Cairo-Bold.ttf_digits'] = testFontDigits($im, $cairo, $color);
// Test Arabic text rendering specifically for Cairo
if ($cairo && file_exists($cairo)) {
$res = imagettftext($im, 14, 0, 10, 100, $color, $cairo, 'ﻖﻘﺤﺘﻠﺎ ﺰﻣﺮ'); // رمز التحقق (RTL shaped)
$results['Cairo-Bold.ttf_arabic_render'] = ($res === false) ? 'Failed' : 'Success';
} else {
$results['Cairo-Bold.ttf_arabic_render'] = 'File not found';
}
$results['rendering_errors'] = $errors;