read()) { if(preg_match('/([a-z0-9_-]+)\\.map$/i',$f,$res)) $enc[]=$res[1]; } $d->close(); sort($enc); echo ''; } if(isset($HTTP_POST_FILES['pfb'])){ // get font file $tmp=$HTTP_POST_FILES['pfb']['tmp_name']; $pfb=$HTTP_POST_FILES['pfb']['name']; $a=explode('.',$pfb); if(strtolower($a[1])!='pfb') die('File is not a .pfb'); if(!move_uploaded_file($tmp,$pfb)) die('Error in upload'); $fontname=$HTTP_POST_VARS['fontname']; if(empty($fontname)) $fontname=$a[0]; // get font metric file $tmp=$HTTP_POST_FILES['fm']['tmp_name']; $fm=$HTTP_POST_FILES['fm']['name']; $a=explode('.',$fm); $fm_type=strtolower($a[1]); if($fm_type!='pfm' and $fm_type!='afm') die('File is not .pfm nor .afm'); $fm="$fontname.$fm_type"; if(!move_uploaded_file($tmp,$fm)) die('Error in upload'); if($fm_type=='pfm') { // PFM->AFM conversion system("pfm2afm.exe -a $fm $fontname.afm"); unlink($fm); $fm="$fontname.afm"; } // MakeFont call MakeFont($pfb,$fm,$HTTP_POST_VARS['enc']); copy("$fontname.php","../$fontname.php"); unlink("$fontname.php"); if(file_exists("$fontname.z")) { copy("$fontname.z","../$fontname.z"); unlink("$fontname.z"); } else copy($pfb,"../$pfb"); unlink($fm); unlink($pfb); echo ""; } ?> Font upload
Choose the .pfb file:
Choose the .pfm or .afm file:
Font name:
Font encoding: