Blame view

ext_dep/libvncserver/libvncserver-master/utils/consolefont2c.pl 850 Bytes
8d728d065   신재종   add libvncserver ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  #!/usr/bin/perl
  
  # convert a linux console font (8x16 format) to a font definition
  # suitable for processing with LibVNCServer
  
  #if($#ARGV == 0) { exit; }
  
  foreach $i (@ARGV) {
    $fontname = $i;
    $fontname =~ s/\.fnt$//;
    $fontname =~ s/^.*\///g;
    $fontname =~ y/+/_/;
  
    print STDERR "$i -> $fontname
  ";
  
    open IN, "<$i";
    print STDERR read(IN,$x,4096);
    close(IN);
  
    open OUT, ">$fontname.h";
    print OUT "unsigned char ".$fontname."FontData[4096+1]={";
    for($i=0;$i<4096;$i++) {
      if(($i%16)==0) {
        print OUT "
  ";
      }
      printf OUT "0x%02x,", ord(substr($x,$i));
    }
  
    print OUT "
  };
  int ".$fontname."FontMetaData[256*5+1]={
  ";
    for($i=0;$i<256;$i++) {
      print OUT ($i*16).",8,16,0,0,";
    }
  
    print OUT "};
  rfbFontData ".$fontname."Font = { ".$fontname."FontData, "
      .$fontname."FontMetaData };
  ";
  
    close OUT;
  }