// http://neil.franklin.ch/Projects/VirtexTools/vtlogo.java
//   - source to compile vtlogo.bit for rendering by vv into vtlogo.png
// author Neil Franklin, last modification 2002.10.06


// ------ prerequisites section

// to really understand this code you should
//   have an understanding of the basics of
//     how LUTs are stored in Virtex FPGAs, and how vv outputs them
//   have read the specifics from the
//     Xilinx Virtex data sheet http://www.xilinx.com/partinfo/ds003.pdf

// ------ Java import section

import java.lang.*;
import java.io.*;
import java.util.*;
import java.text.*;

import com.xilinx.JBits.Virtex.Bitstream;
import com.xilinx.JBits.Virtex.JBits;
import com.xilinx.JBits.Virtex.Devices;
import com.xilinx.JBits.Virtex.ConfigurationException;

import com.xilinx.JBits.Virtex.Bits.LUT;

import com.xilinx.JBits.Virtex.Util;


// ------ vtlogo design implementation sections from here on

public class vtlogo {

  public static void main(String args[]) {


// ------ set up compilation configuration section

    // device being used
    final String DeviceName = "XCV300";
    final int DeviceRows = 32, DeviceCols = 48;
    final String DeviceNullbitfile =
      "/usr/local/JBits/data/Bitstream/XCV300/null300.bit";

    // files being used
    final String OutFileName = "vtlogo.bit";


// ----- get ready to do the actual work section

    // this is standard stuff to do

    initfpga(DeviceName, DeviceRows, DeviceCols);
    readbitstream(DeviceNullbitfile);


// ------ draw the stuff we want to see section

    if (false) {

      // test print out of full ASCII table from LutFont[]

      for (int Column = 0; Column < 128; Column+=16) {
        // announce what we are doing and where we are
        System.out.print("Drawing " + Column + ": data " + pos());

        for (int Char = Column+15; Char >= Column; Char--) {
          lutchar(Char);
          nextlut(); }

        System.out.println(", unused " + pos());

        // reserve space for this sections logic and restart row/LUT allocation
        nextsli(); } }


    // large text VirtexTools, 11 chars @ 5x7 pixel, on 6x8 space, 3x4 CLBs

    // starting point
    int BRow = 1; int BCol = 1;

    Col = BCol+0; Sli = 1; Row = BRow+3; Lut = 0; lutchar('V');
    Col = BCol+0; Sli = 1; Row = BRow+2; Lut = 1; lutchar('V');
    Col = BCol+0; Sli = 1; Row = BRow+2; Lut = 0; lutchar('V');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 1; lutchar('V');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 0; lutchar('V');

    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 1; lutchar('V');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('V');

    Col = BCol+2; Sli = 1; Row = BRow+3; Lut = 0; lutchar('V');
    Col = BCol+2; Sli = 1; Row = BRow+2; Lut = 1; lutchar('V');
    Col = BCol+2; Sli = 1; Row = BRow+2; Lut = 0; lutchar('V');
    Col = BCol+1; Sli = 0; Row = BRow+1; Lut = 1; lutchar('V');
    Col = BCol+1; Sli = 0; Row = BRow+1; Lut = 0; lutchar('V');

    BCol += 3;

    Col = BCol+1; Sli = 1; Row = BRow+3; Lut = 0; lutchar('i');

    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('i');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('i');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 1; lutchar('i');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('i');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 1; lutchar('i');

    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('i');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('i');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('i');

    BCol += 3;

    Col = BCol+0; Sli = 1; Row = BRow+2; Lut = 0; lutchar('r');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 1; lutchar('r');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 0; lutchar('r');
    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 1; lutchar('r');
    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 0; lutchar('r');

    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 1; lutchar('r');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('r');
    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('r');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 1; lutchar('r');

    BCol += 3;

    Col = BCol+0; Sli = 0; Row = BRow+3; Lut = 0; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 1; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 1; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 0; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 1; lutchar('t');

    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('t');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('t');

    Col = BCol+2; Sli = 1; Row = BRow+0; Lut = 1; lutchar('t');

    Col = BCol+0; Sli = 1; Row = BRow+2; Lut = 0; lutchar('t');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('t');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('t');
    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('t');

    BCol += 3;

    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 0; lutchar('e');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 0; lutchar('e');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('e');
    Col = BCol+1; Sli = 0; Row = BRow+1; Lut = 0; lutchar('e');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 0; lutchar('e');

    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 1; lutchar('e');
    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('e');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('e');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('e');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 1; lutchar('e');

    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 1; lutchar('e');
    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('e');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('e');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('e');

    BCol += 3;

    Col = BCol+0; Sli = 1; Row = BRow+2; Lut = 0; lutchar('x');
    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 1; lutchar('x');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('x');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 1; lutchar('x');
    Col = BCol+2; Sli = 1; Row = BRow+0; Lut = 0; lutchar('x');

    Col = BCol+2; Sli = 1; Row = BRow+2; Lut = 0; lutchar('x');
    Col = BCol+1; Sli = 0; Row = BRow+1; Lut = 1; lutchar('x');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('x');
    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 1; lutchar('x');
    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 0; lutchar('x');

    BCol += 3;

    Col = BCol+2; Sli = 1; Row = BRow+3; Lut = 0; lutchar('T');
    Col = BCol+1; Sli = 0; Row = BRow+3; Lut = 0; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+3; Lut = 0; lutchar('T');
    Col = BCol+0; Sli = 0; Row = BRow+3; Lut = 0; lutchar('T');
    Col = BCol+0; Sli = 1; Row = BRow+3; Lut = 0; lutchar('T');

    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 1; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 1; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 1; lutchar('T');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('T');

    BCol += 3;

    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 1; lutchar('o');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 0; lutchar('o');
    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 1; lutchar('o');

    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('o');

    Col = BCol+2; Sli = 1; Row = BRow+0; Lut = 1; lutchar('o');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 0; lutchar('o');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 1; lutchar('o');

    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('o');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('o');

    BCol += 3;

    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 1; lutchar('o');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 0; lutchar('o');
    Col = BCol+0; Sli = 1; Row = BRow+0; Lut = 1; lutchar('o');

    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('o');

    Col = BCol+2; Sli = 1; Row = BRow+0; Lut = 1; lutchar('o');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 0; lutchar('o');
    Col = BCol+2; Sli = 1; Row = BRow+1; Lut = 1; lutchar('o');

    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('o');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('o');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('o');

    BCol += 3;

    Col = BCol+0; Sli = 0; Row = BRow+3; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+3; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 1; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 1; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 1; lutchar('l');

    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('l');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('l');

    BCol += 3;

    Col = BCol+1; Sli = 0; Row = BRow+2; Lut = 0; lutchar('s');
    Col = BCol+1; Sli = 1; Row = BRow+2; Lut = 0; lutchar('s');
    Col = BCol+0; Sli = 0; Row = BRow+2; Lut = 0; lutchar('s');
    Col = BCol+0; Sli = 1; Row = BRow+1; Lut = 1; lutchar('s');

    Col = BCol+0; Sli = 0; Row = BRow+1; Lut = 0; lutchar('s');
    Col = BCol+1; Sli = 1; Row = BRow+1; Lut = 0; lutchar('s');
    Col = BCol+1; Sli = 0; Row = BRow+1; Lut = 0; lutchar('s');

    Col = BCol+2; Sli = 1; Row = BRow+0; Lut = 1; lutchar('s');
    Col = BCol+1; Sli = 0; Row = BRow+0; Lut = 0; lutchar('s');
    Col = BCol+1; Sli = 1; Row = BRow+0; Lut = 0; lutchar('s');
    Col = BCol+0; Sli = 0; Row = BRow+0; Lut = 0; lutchar('s');


// ------ revision text in chip section

    // place text for revision info, visible in BoardScope or VirtexView

    // place revision text in the last/right column:slice of the FPGA
    lastsli();

    System.out.print("Revision Text: " + pos());

    // get date for revision info text
    Date TextDate = new Date();
    SimpleDateFormat TextDateform = new SimpleDateFormat("yyyy.MM.dd");
    String TextDateString = TextDateform.format(TextDate);

    // generate revision info text
    String TextRev = OutFileName + " - " + "Neil Franklin" +
      " - " + TextDateString + " - " + DeviceName;

    for (int Char = 0; Char < TextRev.length(); Char++) {
      lutchar(TextRev.charAt(Char));
      nextlut(); }

    System.out.println(", unused " + pos());


// ------ shut down after doing the actual work section

    // this is standard stuff to do

    writebitstream(OutFileName); }


// ------ ------ only auxillary code sections from here on

  // all this "auxillary code for xxx section" stuff is not PDP-10 specific
  //   they are just code to abstract from the JBits library
  //   comfort stuff to simplify the actual PDP-10 (or anything else) code

  // they really belong into some form of include file or library, to hide them
  //   but dumb Java too is stupid and does not know of either of these
  // the nearest thing would be an class, requiring here instantiation
  //   and object name in every function and constant, part-destroying gains
  // so they have been included here at the end, *** you best ignore them ***
  //   only if you want to understand in terms of JBits is the rest worth read

  // to really understand this code you should have read the specifics from the
  //   Xilinx JBits docs (with the software, to get both mail jbits@xilinx.com)


// ------ auxillary code for initialising JBits section

  // hide all the messy stuff about setting JBits to the Chip being used

  // these are accessed in multiple functions that do actual modification
  public static JBits Fpga;

  // *** would be nice if sizes were automatically derived from chip size

  public static void initfpga(String DeviceName,
    int DeviceRows, int DeviceCols) {
    // get the device type
    int DeviceType = Devices.getDeviceType(DeviceName);
    if (DeviceType == Devices.UNKNOWN_DEVICE) {
      System.out.println("Did not recognize device type " + DeviceName);
      System.exit(-2); }
    // test if the device is supported
    if (Devices.isSupported(DeviceType) == false) {
      System.out.println("Unsupported device type. Exiting");
      System.exit(-3); }

    // initialise device storage
    Fpga = new JBits(DeviceType);

    placersize(DeviceRows, DeviceCols); }


// ------ auxillary code for reading and writing bitstream section

  // hide all the messy stuff about bitstream handling and errors

  // *** would be nice if InFileName were automatically derived from chip size

  public static void readbitstream(String InFileName) {
    System.out.println("reading bitstream " + InFileName + " ...");
    try {
      Fpga.read(InFileName); }
    catch (FileNotFoundException Fe) {
      System.out.println("File " + InFileName + " not found");
      System.out.println(Fe); }
    catch (IOException Io) {
      System.out.println("IO exception reading bitstream file");
      System.out.println(Io); }
    catch (ConfigurationException Ce) {
      System.out.println("Configuration exception while reading bitstream");
      System.out.println(Ce); } }

  public static void writebitstream(String OutFileName) {
    System.out.println("writing bitstream " + OutFileName + " ...");
    try {
      Fpga.write(OutFileName); }
    catch (IOException Io) {
      System.out.println("IO exception writing bitstream file");
      System.out.println(Io); } }


// ------ auxillary code for placing algorithm section

  // start allocation of columns/slices/rows/LUTs for placing of logic
  //   each section reserves space by incrementing, protecting used resources

  // placing starts at bottom/left point of FPGA
  //   Col: 0 is left and growing right, as going from left rightwards start 0
  //   Sli: 1 is left and 0 is right, as going from left rightwards start 1
  //   Row: 0 is bottom and growing up, as going from bottom up start 0
  //   Lut: 0 is F and 1 is G, as going from bottom up start 0

  // constants for chip size of chosen chip
  public static int DeviceMaxRow, DeviceMaxCol;

  public static void placersize(int DeviceRows, int DeviceCols) {
    DeviceMaxRow = DeviceRows-1;
    DeviceMaxCol = DeviceCols-1; }


  // variables for present placing position
  public static int Col = 0, Sli = 1, Row = 0, Lut = 0;


  // LUT (Lut and Row) placing position stepping functions

  public static void nextlut() {
    Lut = 1-Lut; if (Lut == 0) Row++; }

  public static void lastlut() {
    Row = DeviceMaxRow; Lut = 1; }


  // slice (Sli and Col) placing position stepping functions

  public static void nextsli() {
    Row = 0; Lut = 0;
    Sli = 1-Sli; if (Sli == 1) Col++; }

  public static void lastsli() {
    Row = 0; Lut = 0;
    Col = DeviceMaxCol; Sli = 0; }


  // return formatted string showing present position in format cccS/rrrL
  public static String pos() {
    // Col and Row front-fill with zeros to 3 places
    String ColFilled = "000"+Integer.toString(Col);
    ColFilled = ColFilled.substring(
      ColFilled.length()-3, ColFilled.length());
    String RowFilled = "000"+Integer.toString(Row);
    RowFilled = RowFilled.substring(
      RowFilled.length()-3, RowFilled.length());
    // Sli and Lut convert to symbolic constants
    String SliLR = (Sli == 1) ? "L" : "R";
    String LutFG = (Lut == 0) ? "F" : "G";
    // merge all to X/Y format position string
    return (ColFilled + SliLR + "/" + RowFilled + LutFG); }


// ------ auxillary code for 0/1 slice and F/G LUT independant const section

  // constants that allow writing code that can set any of the 4 LUTs in a CLB
  //   without being 0/1 slice or F/G LUT position dependant
  // get rid of if-s and duplicated code with just diff sets of constants in it

  // this is the worst to read of all the auxillary code sections
  // ** you do NOT need to understand this section to comprehend the design **


  // config bit constants for Fpga.set(Row, Col, SetLUT[Sli][Lut], function);

  final public static int LutFunction[][][][] =
    { { LUT.SLICE0_F, LUT.SLICE0_G },
      { LUT.SLICE1_F, LUT.SLICE1_G } };


// ------ auxillary code for LUT function generator setting section

  // allow setting LUTs faster than com.xilinx.JBits.Virtex.Expr
  //   and no run time parsing, no run time parse errors to test and trap for
  //   and also not F/G LUT dependant, as an additional advantage

  // bit patterns for out = f(I1..I4), use Java ~ & | and ^ to combine them
  final public static int I1 = 0xAAAA, I2 = 0xCCCC, I3 = 0xF0F0, I4 = 0xFF00;

  // routine to hide the use of Col:Sli|Row:Lut when setting LUT function
  //   also hides use of Util.InvertIntArray and Util.IntToIntArray
  // as side effect writes out this LUTs position/value/name into an listfile

  public static void lut(int Function) {
    try {
      Fpga.set(Row, Col, LutFunction[Sli][Lut],
        Util.InvertIntArray(Util.IntToIntArray(Function, 16))); }
    catch (ConfigurationException Ce) {
      System.out.println("Configuration exeption in lut() at " + pos());
      System.out.println(Ce); } }


// ------ auxillary code for LUT comment writing section

  // allow putting text bit patterns into LUTs
  //   for layout display in BoardScope or VirtexView
  // uses LUT 16 bits displayed 0123/4567/89AB/CDEF as 4x4 pixel font

  // 4x4 pixel bit patterns, 0xabcd a=bottom d=top line, 1=left 8=right column

  final public static int LutFont[] = {
    // all 32 control characters, as full boxes
    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
    0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
    // space !      "       #       $       %       &       '
    0x0000, 0x6066, 0x00AA, 0x6FF6, 0x7E5E, 0x9249, 0xE526, 0x0024,
    // (    )       *       +       ,       -       .       /
    0x4224, 0x2442, 0x4EE4, 0x04E4, 0x2400, 0x0F00, 0x4000, 0x1248,
    // 0    1       2       3       4       5       6       7
    0x6996, 0xE464, 0xF687, 0x786F, 0x4F51, 0x787F, 0x6972, 0x248F,
    // 8    9       :       ;       <       =       >       ?
    0x69F6, 0x4E96, 0x0404, 0x2404, 0x2124, 0xF0F0, 0x2484, 0x4496,
    // @    A       B       C       D       E       F       G
    0x6FFE, 0x9F96, 0x79F7, 0xE11E, 0x7997, 0xF17F, 0x171F, 0xE91E,
    // H    I       J       K       L       M       N       O
    0x99F9, 0xE44E, 0x344E, 0x9759, 0xF111, 0x9BF9, 0x9DB9, 0x6996,
    // P    Q       R       S       T       U       V       W
    0x1797, 0x6D96, 0x9797, 0x7C3E, 0x222F, 0x6999, 0x2699, 0x6BB9,
    // X    Y       Z       [       \       ]       ^       _
    0x9669, 0x1269, 0xF24F, 0x6226, 0x8421, 0x6446, 0x00A4, 0xF000,
    // `    a       b       c       d       e       f       g
    0x0042, 0xA560, 0x7971, 0x6160, 0x7971, 0x6F60, 0x272C, 0x6E9E,
    // h    i       j       k       l       m       n       o
    0x9971, 0x4604, 0x6404, 0x9791, 0xE446, 0xBB50, 0x9970, 0x6960,
    // p    q       r       s       t       u       v       w
    0x1797, 0x8E9E, 0x2A60, 0x7FE0, 0xC272, 0xE990, 0x2690, 0x6BB0,
    // x    y       z       {       |       }       ~       DEL (full box)
    0x9690, 0x2469, 0xF6F0, 0x6236, 0x4444, 0x64C6, 0x005A, 0xFFFF };

  // simple routine to hide implementation

  public static void lutchar(int Char) {
    lut(LutFont[Char]); } }

