From 31976752daa4415194525e9f7e877daf1ec63e7d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 May 2026 02:13:39 -0400 Subject: [PATCH] fix font --- app/Controllers/View/CertificateController.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/Controllers/View/CertificateController.php b/app/Controllers/View/CertificateController.php index 53a1e47..9958456 100644 --- a/app/Controllers/View/CertificateController.php +++ b/app/Controllers/View/CertificateController.php @@ -462,7 +462,7 @@ class CertificateController extends BaseController // ── Images $pdf->Image($imgDir . 'title.png', 126, 0, 600); $pdf->Image($imgDir . 'background.png', 280, 176, 291, 340); - $pdf->Image($imgDir . 'signature.png', 140, 399, 90, 90); + $pdf->Image($imgDir . 'signature.png', 140, 410, 90, 80); // ── QR code — bottom-right corner: 1.5 cm from bottom, 2.5 cm from right $qrSize = 42; // pt @@ -484,14 +484,11 @@ class CertificateController extends BaseController $pdf->SetXY(0, 151); $pdf->Cell($W, 24, 'Presented to:', 0, 0, 'C'); - // ── Student name (bold via fill + stroke) + // ── Student name — center based on actual string width $pdf->SetFont($edwardianFont, '', 38); - $pdf->SetDrawColor(0, 0, 0); - $pdf->setTextRenderingMode(0.4, true, false); - $pdf->SetXY(0, 219); - $pdf->Cell($W, 38, $name, 0, 0, 'C'); - $pdf->setTextRenderingMode(0, true, false); - + $nameX = ($W - $pdf->GetStringWidth($name)) / 2; + $this->drawGradientText($pdf, $edwardianFont, 38, $name, $nameX, 229.5); + // ── Line under name $pdf->SetFont('times', '', 20); $pdf->SetXY(0, 243); @@ -518,7 +515,7 @@ class CertificateController extends BaseController $pdf->Cell($W, 20, 'Al Rahma Sunday School', 0, 0, 'C'); // ── Date (gradient script) - $this->drawGradientText($pdf, $edwardianFont, 26, $certDate, 598, 453); + $this->drawGradientText($pdf, $edwardianFont, 26, $certDate, 586, 456); // ── Date underline + label $pdf->SetFont('times', '', 20); @@ -550,7 +547,7 @@ class CertificateController extends BaseController for ($i = 0; $i < 6; $i++) { $pdf->setAlpha(($i + 1) * 25 / 255); $pdf->SetTextColor(0, 0, 0); - $pdf->Text($x + $i / 5, $y + $i / 5, $text); + $pdf->Text($x + $i / 4, $y + $i / 4, $text); } $pdf->setAlpha(1);