package com.mindprod.example;
import com.mindprod.common18.ST;
import com.mindprod.fastcat.FastCat;
import com.mindprod.hunkio.HunkIO;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
/**
* Generate sample Btm files to figure out how to generate various glyphs.
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0 2016-08-24 initial version
* @since 2016-08-24
*/
public final class TestBatChars
{
private static void genBat( final String encoding ) throws IOException
{
final FastCat sb = new FastCat( ( 256 - 33 ) * 7 + 3 );
sb.append( "@echo off\n" );
sb.append( "@echo ", encoding, ".btm generated with encoding ", encoding, "\n" );
for ( int i = 33; i < 256; i++ )
{
if ( i != 96 )
{
sb.append( "@echo \\u", ST.toLZHexString( i, 4 ), " ", i, " \"", ( char ) i, "\"\n" );
}
}
sb.append( "rem -30-\n" );
HunkIO.writeEntireFile( new File( "C:\\temp\\" + encoding + ".btm" ),
sb.toString(),
Charset.forName( encoding ) );
}
/**
* Generate some test files in C:\temp
*
* @param args not used
*/
public static void main( String[] args ) throws IOException
{
genBat( "IBM850" );
genBat( "IBM437" );
genBat( "windows-1252" );
}
}