網站自動產生 TTF字型檔
$fontpath = "fonts/"; //原生字型檔路徑,結尾需加斜線/ $outputpath = "fonts/"; //產生之字型檔存放路徑,結尾需加斜線/ $orifont = "wayhunt.ttf"; //原生字型檔名 $outputfont = "out.ttf"; //產生字型檔名 $txt_array = str_split($body, 3);//擷取 UTF-8中文字為 3bytes $txt_array = array_unique($txt_array); foreach ($txt_array as $txt){ $txt = str_replace(" ","",trim($txt)); $txtbody .= $txt; } require_once "TTFsubset.php"; $txtbody = "xfexff".iconv('UTF-8', 'UTF-16be//IGNORE', strip_tags($txtbody)); $t = new TTFsubset(); $subset = $t->doSubset($fontpath.$orifont, $txtbody, null); file_put_contents($outputpath.$outputfont, $subset);
網站選單
Search
好站推薦
美人時計