Deploy: 2026-05-23 18:37:08
This commit is contained in:
@@ -108,6 +108,11 @@ class WhatsAppClient {
|
||||
if (!is_dir($fontDir)) {
|
||||
@mkdir($fontDir, 0755, true);
|
||||
}
|
||||
$fontDir = realpath($fontDir);
|
||||
|
||||
if (!$fontDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fonts = [
|
||||
'Roboto-Bold.ttf' => 'https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Bold.ttf',
|
||||
@@ -166,15 +171,17 @@ class WhatsAppClient {
|
||||
$useTtf = false;
|
||||
$availableFonts = [];
|
||||
if (function_exists('imagettftext')) {
|
||||
$fontDir = __DIR__ . '/../fonts';
|
||||
if (file_exists($fontDir . '/Roboto-Bold.ttf') && @filesize($fontDir . '/Roboto-Bold.ttf') > 20000) {
|
||||
$availableFonts[] = $fontDir . '/Roboto-Bold.ttf';
|
||||
}
|
||||
if (file_exists($fontDir . '/Lora-Bold.ttf') && @filesize($fontDir . '/Lora-Bold.ttf') > 20000) {
|
||||
$availableFonts[] = $fontDir . '/Lora-Bold.ttf';
|
||||
}
|
||||
if (!empty($availableFonts)) {
|
||||
$useTtf = true;
|
||||
$fontDir = realpath(__DIR__ . '/../fonts');
|
||||
if ($fontDir) {
|
||||
if (file_exists($fontDir . '/Roboto-Bold.ttf') && @filesize($fontDir . '/Roboto-Bold.ttf') > 20000) {
|
||||
$availableFonts[] = $fontDir . '/Roboto-Bold.ttf';
|
||||
}
|
||||
if (file_exists($fontDir . '/Lora-Bold.ttf') && @filesize($fontDir . '/Lora-Bold.ttf') > 20000) {
|
||||
$availableFonts[] = $fontDir . '/Lora-Bold.ttf';
|
||||
}
|
||||
if (!empty($availableFonts)) {
|
||||
$useTtf = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user