#!/usr/local/bin/perl

# This *freeware* program is meant to use with fonts
# stolen with restorefont from the SVGAlib package,
# and manipulated with tools from the SVGATextMode package
# (see programs dump and undump in contrib/changefonts)

# I converted VISCII 1.0 fonts into VISCII 1.1 fonts with the command:
# (./dump | ./fontutil | ./undump)  < viscii10-8x16.psf > viscii11-8x16.psf

my ($NCHARS,$NLINES) = (256,32) ;

my (@Font) ;


sub getfont {
  my ($i,$j) ;
  for ($i=0;$i<$NCHARS;$i++) {
    $Font[i] = [] ;
  }
  my ($i,$j) = (0,0) ;
  while (<>) {
    if ( ++$j == $NLINES ) {
        $i++ ;
        $j = 0 ;
    }
    push @{$Font[$i]}, $_ ;
  }
}

sub putfont {
  print ( join("",map { join "", @$_ } @Font ) ) ;
}

sub viscii10to11 {
  my ($Onga,$anang) = ($Font[0xA0],$Font[0xD5]) ;
  ($Font[0xA0],$Font[0xD5]) = ($anang,$Onga) ;
}


getfont () ;
viscii10to11 () ;
putfont () ;

