<?php
GdImage|false imageloadfont ( string $filename )
where,
$filename = The font binary file
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
define('P2GDF', 'gdf/');
$gdf_font_name01 = "04b.gdf";
$gdf_fnt01 = imageloadfont(P2GDF . $gdf_font_name01);
echo "Font identifier:<br>";
var_dump($gdf_fnt01);
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$gdf_font_name02 = "gdf/andale12.gdf";
$gdf_fnt02 = imageloadfont($gdf_font_name02);
echo "Font identifier:<br>";
var_dump($gdf_fnt02);
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
error_reporting(0);
$var = getcwd();
echo $var . '<br><br>';
$ttf_font_name03 = $var . "/ttf/Vera.ttf";
// TrueType font
echo $ttf_font_name03 . '<br><br>';
$ttf_fnt03 = imageloadfont($ttf_font_name03);
var_dump($ttf_fnt03);
/* - - - - - - - - - - - - - - - - - - - - - - -
Errors like this one occur whenever trying
to load TrueType font
The Warning verified when running this
exercise proves that this function
should only be used for user-defined
bitmap fonts, never for ttf fonts
- - - - - - - - - - - - - - - - - - - - - - - - */
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
error_reporting(0);
var_dump( imageloadfont('\src\invalidfile.font') );
?>