OCR-A Font With FPDF does not work for BOLD style

203 views Asked by At

I created OCRA.PHP and OCRA.z for OCR-A Font online and used with below code

$pdf = new FPDF();
$pdf->AddFont('OCRA','','OCRA.php');
$pdf->AddPage();
$pdf->SetFont('OCRA','',35);
$pdf->Write(10,'Enjoy new fonts with FPDF!');
$pdf->Output();

But when i add style 'B' bold it does not work

$pdf = new FPDF();
$pdf->AddFont('OCRA','','OCRA.php');
$pdf->AddPage();
$pdf->SetFont('OCRA','B',20); // added 'B' - bold here
$pdf->Write(10,'Enjoy new fonts with FPDF!');
$pdf->Output();

It throws error

Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Undefined font: ocra B'

Please help me to figureout the issue. Thanks

0

There are 0 answers