I'm trying to create PDF by FPDF (tFPDF) but I still can't create output with correct charset.
Problem is in czech letters: ě,š,č,ř,ž,ů etc...
Source:
<?php
require_once('../tfpdf/tfpdf.php');
define("_SYSTEM_TTFONTS", "C:/Windows/Fonts/");
$pdf = new tFPDF('P','mm','A5');
$pdf->SetMargins(8,5,8);
$pdf->AddPage();
// Pracoviště
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(25,12,'Pracoviště:','L',0);
$pdf->Output();
?>
I need to write "Pracoviště:" but output is "PracoviÅ¡tÄ›:".
For regular Arial I solved it by:
$pdf->AddFont('Arial','','arial.ttf',true);
but it doesen't work for bold.
I tried:
$pdf->AddFont('Arial','','arial.ttf',true); // Arial
$pdf->AddFont('Arial','B','arialbd.ttf',true); // Arial Bold
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(25,12,'Pracoviště:'); // output: Pracoviště:
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(25,12,'Pracoviště:'); // output: PracoviÅ¡tÄ›:
Interestingly if I use Arial Black file, it works, but it's not font what I need.
$pdf->AddFont('Arial','','arial.ttf',true); // Arial
$pdf->AddFont('Arial','B','ariblk.ttf',true); // Arial Black
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(25,12,'Pracoviště:'); // output: Pracoviště:
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(25,12,'Pracoviště:'); // output: Pracoviště: - but Arial Black font, I need Arial Bold
Why Arial works, Arial Black works too and Arial Bold doesn't work? How to solve it?