代码如下:(效果为16X16点阵中打印一个“学”字)
class 字库{
char 学[] = {0x22,0x08,0x11,0x08,0x11,0x10,0x00,0x20,
0x7F,0xFE,0x40,0x02,0x80,0x04,0x1F,0xE0,
0x00,0x40,0x01,0x80,0xFF,0xFE,0x01,0x00,
0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00};
}
public class Test{
public static void main(String args[]){
int i = 0,j = 0;
字库 字模 = new 字库();
for(i=0;i<32;i++){
for(j=0;j<8;j++){
if(((字模.学[i]<<j)&0x80)==0x80){
System.out.print(" *");
}
else{
System.out.print(" ");
}
}
if(i%2!=0){
System.out.println("");
}
}
}
}
|