package de.nplusc.izc.tools.UiToolz;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author LH
 */
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
//dimport javax.swing.ImageIcon;
public class FontEngine
{
    public static final int[] FONT_LAUNCHPAD = new int[]{0,1,1};
    public static final int[] FONT_SEVENSINS = new int[]{1,1,1};
    public static final int[] FONT_TIE_WING = new int[]{2,1,1};
    public static final int[] FONT_TF = new int[]{3,1,1};
    public static final int[] FONT_TRON = new int[]{4,2,2};
    public static final int[] FONT_TYPEWRITER = new int[]{6,1,1};
    public static final int[] FONT_28_DAYS_LATER = new int[]{7,1,1};
    public static final int[] FONT_ALIEN_ENCOUNTER = new int[]{8,1,1};
    public static final int[] FONT_AR_DESTINE = new int[]{9,1,1};
    public static final int[] FONT_SW_GLYPHS = new int[]{10,2,1};
    public static final int[] FONT_BATMAN_FOREVER = new int[]{12,1,1};
    public static final int[] FONT_BATTLESTAR = new int[]{13,1,1};
    public static final int[] FONT_BLADERUNNER = new int[]{14,1,1};
    public static final int[] FONT_DECEPTICON_GRAFFITTI = new int[]{15,1,1};
    public static final int[] FONT_DIGITAL_7SEG = new int[]{16,1,1};
    public static final int[] FONT_ENGLI_BESH = new int[]{17,1,1};
    public static final int[] FONT_GALACTIC_MINI = new int[]{18,2,1};
    public static final int[] FONT_INVDUCTION = new int[]{19,2,1};
    public static final int[] FONT_INVISIBLE_KILLER = new int[]{20,1,1};
    public static int LETTER_A=1;
    public static int LETTER_B=2;
    public static int LETTER_C=3;
    public static int LETTER_D=4;
    public static int LETTER_E=5;
    public static int LETTER_F=6;
    public static int LETTER_G=7;
    public static int LETTER_H=8;
    public static int LETTER_I=9;
    public static int LETTER_J=10;
    public static int LETTER_K=11;
    public static int LETTER_L=12;
    public static int LETTER_M=13;
    public static int LETTER_N=14;
    public static int LETTER_O=15;
    public static int LETTER_P=16;
    public static int LETTER_Q=17;
    public static int LETTER_R=18;
    public static int LETTER_S=19;
    public static int LETTER_T=20;
    public static int LETTER_U=21;
    public static int LETTER_V=22;
    public static int LETTER_W=23;
    public static int LETTER_X=24;
    public static int LETTER_Y=25;
    public static int LETTER_Z=26;
    
    protected FontEngine()
    {
        
    }
    
    
    //font:{offset,kacheln-x,kacheln-y}//normal={?,1,1}
    @SuppressWarnings("CallToThreadDumpStack")
     public static Image getLetter(int[]font,int letter)
     {
         boolean load = false;
         BufferedImage bI = null;
        try
        {
            
            bI = ImageIO.read(de.nplusc.izc.tools.UIToolz.rsrc.UIFile.class.getResource("rsrc/FontPage1.png"));//new File("C:/users/LH/Desktop/jp/Fontpage1.png"));
            load=true;
            //BufferedImage i=new BufferedImage(1366,768, BufferedImage.TYPE_4BYTE_ABGR);
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
        if(load)
        {
                                      //HACK da Konstanten ale um eins zu hoch
            int letterBaseX = letter*40-40;//Grundraster:2Kacheln breit
            int letterBaseY=(font[0])*20;
            int sizeX=font[1]*20;
            int sizeY=font[2]*20;
            return bI.getSubimage(letterBaseX, letterBaseY, sizeX, sizeY);
        }
        return null;
     }

}
