I'm trying to use the "Glyphicons" (We bought it for 59$ to have the complete font with 610 icons and font quality not images) with the FPDF library.
Here is what I've done :
define('FPDF_FONTPATH', 'font/');
$pdf = new myPDF();
$pdf->AddFont("glyphicons");
(same as $pdf->AddFont("glyphicons", "", "glyphicons.php");
)$pdf->SetFont("GLYPHICONS", '', 10);
$pdf->Cell(0, 0, '');
(the character to write is a representation of a check icon)However, instead of beautiful pics I got a rectangle (it means to me that it can't find the related characters within the font or the font is not available).
How can I use the Glyphicons with FPDF? Is it possible?
Thanks for your help or any feedback based on usage.
I should have answered to my post here. Here we are.
For anyone coming to this post and having the same problem : Use the tFPDF add-on of FPDF: fpdf.org/~~V/en/script/script92.php.
Important: With the current version of tFPDF, the calling PHP code seems to be strictly on the same directory as the TFPDF.php file is.
Otherwise, the TTF path (starting from the path of TFPDF.php) can't be found getting the message:
Can't open file font/unifont/glyphicons.ttf
In my case I've overriden the AddFont
method to specify a parameter of the rootPath and use it as prefix of the two usages of $this->_getfontpath().'unifont/'