Want more features on Pastebin? Sign Up, it's FREE!
Guest

FontRoutine

By: a guest on Aug 4th, 2011  |  syntax: Java  |  size: 0.68 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         public BM_Font( String fileName )
  2.         {      
  3.                 File f = new File( fileName );
  4.                 try
  5.                 {
  6.                         // Lesezugriff auf die Datei
  7.                         FileReader fr = new FileReader( f );
  8.  
  9.                         // Bitmasken einlesen
  10.                         char temp[] = new char[ 256 * 8 ];
  11.                         fontMasks = new boolean[ 256 * 64 ];
  12.                         fr.read( temp );
  13.                        
  14.                         // Aus den char-Bitmasken boolean-Bitmasken erstellen
  15.                         for( int i = 0; i < 256; ++i )
  16.                         {
  17.                                 for( int j = 0; j < 8; ++j )
  18.                                 {
  19.                                         for( int k = 0; k < 8; ++k )
  20.                                         {
  21.                                                 fontMasks[ i * 64 + j * 8 + k ] = ( (byte)( temp[ i * 8 + j ] & (byte)Math.pow( 2, k ) ) != 0 );
  22.                                         }
  23.                                 }
  24.                         }
  25.                 }
  26.                 catch( Exception e )
  27.                 {
  28.                         e.printStackTrace( );
  29.                         System.exit( 0 );
  30.                 }
  31.                
  32.         }
clone this paste RAW Paste Data