Effect:
Source:
<?PHP//Standard ASCII 5x7 font longitudinal modulus//defines ASCII characters 0x20-0x7f (32-127)$font=Array( 0x00, 0x00, 0x00, 0x00, 0x00,//"'0x00, 0x00, 0x5f, 0x00, 0x00,// !0x00, 0x07, 0x00, 0x07, 0x00,// "0x14, 0x7F, 0x14, 0x7F, 0x14,// #0x24, 0x2A, 0x07, 0x2A, 0x12,// $0x23, 0x13, 0x08, 0x64, 0x62,// %0x37, 0x49, 0x55, 0x22, 0x50,//&0x00, 0x05, 0x03, 0x00, 0x00,//'0x00, 0x1C, 0x22, 0x41, 0x00,// (0x00, 0x41, 0x22, 0x1C, 0x00,// )0x08, 0x2A, 0x1C, 0x2A, 0x08,// *0x08, 0x08, 0x3e, 0x08, 0x08,// +0x00, 0x50, 0x30, 0x00, 0x00,// ,0x08, 0x08, 0x08, 0x08, 0x08,// -0x00, 0x60, 0x60, 0x00, 0x00,// .0x20, 0x10, 0x08, 0x04, 0x02,// /0x3e, 0x51, 0x49, 0x45, 0x3e,//00x00, 0x42, 0x7F, 0x40, 0x00,//10x42, 0x61, 0x51, 0x49, 0x46,//20x21, 0x41, 0x45, 0x4B, 0x31,//30x18, 0x14, 0x12, 0x7F, 0x10,//40x27, 0x45, 0x45, 0x45, 0x39,//50x3C, 0x4A, 0x49, 0x49, 0x30,//60x01, 0x71, 0x09, 0x05, 0x03,//70x36, 0x49, 0x49, 0x49, 0x36,//80x06, 0x49, 0x49, 0x29, 0x1E,//90x00, 0x36, 0x36, 0x00, 0x00,// :0x00, 0x56, 0x36, 0x00, 0x00,// ;0x00, 0x08, 0x14, 0x22, 0x41,//<0x14, 0x14, 0x14, 0x14, 0x14,// =0x41, 0x22, 0x14, 0x08, 0x00,//>0x02, 0x01, 0x51, 0x09, 0x06,// ?0x32, 0x49, 0x79, 0x41, 0x3e,// @0x7E, 0x11, 0x11, 0x11, 0x7E,//A0x7F, 0x49, 0x49, 0x49, 0x36,//B0x3e, 0x41, 0x41, 0x41, 0x22,//C0x7F, 0x41, 0x41, 0x22, 0x1C,//D0x7F, 0x49, 0x49, 0x49, 0x41,//E0x7F, 0x09, 0x09, 0x01, 0x01,//F0x3e, 0x41, 0x41, 0x51, 0x32,//G0x7F, 0x08, 0x08, 0x08, 0x7F,//H0x00, 0x41, 0x7F, 0x41, 0x00,//I0x20, 0x40, 0x41, 0x3F, 0x01,//J0x7F, 0x08, 0x14, 0x22, 0x41,//K0x7F, 0x40, 0x40, 0x40, 0x40,//L0x7F, 0x02, 0x04, 0x02, 0x7F,//M0x7F, 0x04, 0x08, 0x10, 0x7F,//N0x3e, 0x41, 0x41, 0x41, 0x3e,//O0x7F, 0x09, 0x09, 0x09, 0x06,//P0x3e, 0x41, 0x51, 0x21, 0x5E,//Q0x7F, 0x09, 0x19, 0x29, 0x46,//R0x46, 0x49, 0x49, 0x49, 0x31,//S0x01, 0x01, 0x7F, 0x01, 0x01,//T0x3F, 0x40, 0x40, 0x40, 0x3F,//U0x1F, 0x20, 0x40, 0x20, 0x1F,//V0x7F, 0x20, 0x18, 0x20, 0x7F,//W0x63, 0x14, 0x08, 0x14, 0x63,//X0x03, 0x04, 0x78, 0x04, 0x03,//Y0x61, 0x51, 0x49, 0x45, 0x43,//Z0x00, 0x00, 0x7F, 0x41, 0x41,// [0x02, 0x04, 0x08, 0x10, 0x20,// "\"0x41, 0x41, 0x7F, 0x00, 0x00,// ]0x04, 0x02, 0x01, 0x02, 0x04,// ^0x40, 0x40, 0x40, 0x40, 0x40,// _0x00, 0x01, 0x02, 0x04, 0x00,// `0x20, 0x54, 0x54, 0x54, 0x78,//a0x7F, 0x48, 0x44, 0x44, 0x38,//b0x38, 0x44, 0x44, 0x44, 0x20,//C0x38, 0x44, 0x44, 0x48, 0x7F,//D0x38, 0x54, 0x54, 0x54, 0x18,//e0x08, 0x7E, 0x09, 0x01, 0x02,//F0x08, 0x14, 0x54, 0x54, 0x3C,//g0x7F, 0x08, 0x04, 0x04, 0x78,//h0x00, 0x44, 0x7d, 0x40, 0x00,//I0x20, 0x40, 0x44, 0x3d, 0x00,//J0x00, 0x7F, 0x10, 0x28, 0x44,//k0x00, 0x41, 0x7F, 0x40, 0x00,//L0x7C, 0x04, 0x18, 0x04, 0x78,//m0x7C, 0x08, 0x04, 0x04, 0x78,//N0x38, 0x44, 0x44, 0x44, 0x38,//o0x7C, 0x14, 0x14, 0x14, 0x08,//P0x08, 0x14, 0x14, 0x18, 0x7C,//Q0x7C, 0x08, 0x04, 0x04, 0x08,//R0x48, 0x54, 0x54, 0x54, 0x20,//s0x04, 0x3F, 0x44, 0x40, 0x20,//T0x3C, 0x40, 0x40, 0x20, 0x7C,//u0x1C, 0x20, 0x40, 0x20, 0x1C,//v0x3C, 0x40, 0x30, 0x40, 0x3C,//W0x44, 0x28, 0x10, 0x28, 0x44,//x0x0C, 0x50, 0x50, 0x50, 0x3C,//y0x44, 0x64, 0x54, 0x4C, 0x44,//Z0x00, 0x08, 0x36, 0x41, 0x00,// {0x00, 0x00, 0x7F, 0x00, 0x00,// |0x00, 0x41, 0x36, 0x08, 0x00,// }0x02, 0x01, 0x02, 0x04, 0x02,// ~0xFF, 0xFF, 0xFF, 0xFF, 0xFF,//Black Block);//Var_dump ($font);$font _bin=Array();foreach($font as $r){ $font _bin[] =Str_pad(Decbin($r), 8, ' 0 ',str_pad_left);}//var_dump ($font _bin);functionShow$str){ Global $font _bin; Echo' <div style= ' font-size:10px; > '; for($i= 0;$i<strlen($str);$i++) { Echo' <div style= ' margin:10px 5px; Float:left; " > '; $index=Ord($str{$i})-32; for($y= 7;$y>0;$y--) { for($x= 0;$x<5;$x++) { $s=substr($font _bin[$index+$x],$y, 1); Echo $s= = ' 1 '? ': ' <span style= ' color: #ddd; " >-</span> '; } Echo' <br> '; } Echo' </div> '; } Echo' <div> ';}$s= ' '; for($i= 32;$i<128;$i++){ $s.=CHR($i);} Show ($s);
Download: Http://files.cnblogs.com/files/zjfree/font_5_7.rar
PHP dot Matrix 5*7 font