// Path: src/lwjglEngine/render/DisplayManager.java
// public class DisplayManager {
// 
// 	public static final int width = (int) CivGame.WIDTH, height = (int) CivGame.HEIGHT;
// 	public static long window;
// 	public static CivGame main;
// 	
// 	//Store the callbacks in memory
// 	private static GLFWErrorCallback errorCallback;
// 	public static GLFWKeyCallback keyCallback;
// 	private static GLFWCursorPosCallback cursorPosCallback;
// 	public static GLFWMouseButtonCallback mouseButtonCallback;
// 	
// 	public DisplayManager(CivGame m)
// 	{
// 		main = m;
// 	}
// 	
// 	public static void createDisplay()
// 	{
// 		glfwInit();
// 		glfwSetErrorCallback(errorCallback = Callbacks.errorCallbackPrint(System.err));
// 		
// 		glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
// 		glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
// 		glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
// 		glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 
// 		window = glfwCreateWindow(width, height, "", 0, 0);
// 		glfwMakeContextCurrent(window);
// 		GLContext.createFromCurrent();
// 		glfwShowWindow(window);
// 
// 		setCursorPosCallback();
// 		setMouseCallback();
// 		setKeyCallback();
// 		
// 		if (window == 0) {
// 		    throw new RuntimeException("Failed to create window");
// 		}
// 
// 		GL11.glViewport(0, 0, width, height);
// 	}
// 	
// 	public static void setCursorPosCallback()
// 	{
// 		GLFW.glfwSetCursorPosCallback(window, (cursorPosCallback = new GLFWCursorPosCallback() {
// 		    public void invoke(long window, double xpos, double ypos) {
// 		        Mouse.setMouse((float)xpos, (float)ypos);
// 		    }
// 		}));
// 	}
// 	
// 	public static void setMouseCallback()
// 	{
// 		GLFW.glfwSetMouseButtonCallback(DisplayManager.window, (DisplayManager.mouseButtonCallback = new GLFWMouseButtonCallback() {
// 			public void invoke(long window, int button, int action, int mods) {
// 				if (action == GLFW.GLFW_PRESS) {
// 					main.menuSystem.queueMousePass(Mouse.getX(), Mouse.getY()); //includes button == 2 i.e. scroll wheel
// 					if (button == 0) {
// 						main.inputSystem.processLeftMouseClick(Mouse.getX(), Mouse.getY());
// 					} 
// 					else if (button == 1) {
// 						main.inputSystem.processRightMouseClick(Mouse.getX(), Mouse.getY());
// 					}
// 					main.menuSystem.forceUpdate();
// 					//menuSystem.closeMenus();
// 				} 
// 
// 			}
// 		}));
// 	}
// 	
// 	public static void setKeyCallback()
// 	{
// 		GLFW.glfwSetKeyCallback(DisplayManager.window, (DisplayManager.keyCallback = new GLFWKeyCallback() {
// 			public void invoke(long window, int key, int scancode, int action, int mods) {
// 				if (action == GLFW.GLFW_PRESS) {
// 					main.inputSystem.keyPressed(key);
// 					main.menuSystem.forceUpdate();
// 					//menuSystem.closeMenus();
// 				}
// 			}
// 		}));
// 	}
// 	
// 	public static void updateDisplay()
// 	{
// 		for (int i = GLFW.GLFW_KEY_0; i <= GLFW.GLFW_KEY_Z; i++)
// 		{
// 			Keyboard.keys[i] = GLFW.glfwGetKey(window, i) == GLFW.GLFW_PRESS;
// 		}
// 		/*Display.sync(120);
// 		Display.update();*/
// 		glfwPollEvents();
// 		glfwSwapBuffers(window);
// 	}
// 	
// 	public static void closeDisplay() 
// 	{
// 		glfwDestroyWindow(window);
// 	}
// 	
// 	public static boolean requestClose()
// 	{
// 		return glfwWindowShouldClose(DisplayManager.window) == GL_TRUE;
// 	}
// 
// }


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import lwjglEngine.render.DisplayManager;
package lwjglEngine.fontMeshCreator;



/**
 * Provides functionality for getting the values from a font file.
 * 
 * @author Karl
 *
 */
public class MetaFile {

	/*private static final int PAD_TOP = 0;
	private static final int PAD_LEFT = 1;
	private static final int PAD_BOTTOM = 2;
	private static final int PAD_RIGHT = 3;*/
	private static final int PAD_TOP = 3;
	private static final int PAD_LEFT = 3;
	private static final int PAD_BOTTOM = 3;
	private static final int PAD_RIGHT = 3;

	private static final int DESIRED_PADDING = 3;

	private static final String SPLITTER = " ";
	private static final String NUMBER_SEPARATOR = ",";

	private double aspectRatio;

	private double verticalPerPixelSize;
	private double horizontalPerPixelSize;
	private double spaceWidth;
	private int[] padding;
	private int paddingWidth;
	private int paddingHeight;

	private Map<Integer, Character> metaData = new HashMap<Integer, Character>();

	private BufferedReader reader;
	private Map<String, String> values = new HashMap<String, String>();

	/**
	 * Opens a font file in preparation for reading.
	 * 
	 * @param file
	 *            - the font file.
	 */
	protected MetaFile(File file) {
// Path: src/lwjglEngine/render/DisplayManager.java
// public class DisplayManager {
// 
// 	public static final int width = (int) CivGame.WIDTH, height = (int) CivGame.HEIGHT;
// 	public static long window;
// 	public static CivGame main;
// 	
// 	//Store the callbacks in memory
// 	private static GLFWErrorCallback errorCallback;
// 	public static GLFWKeyCallback keyCallback;
// 	private static GLFWCursorPosCallback cursorPosCallback;
// 	public static GLFWMouseButtonCallback mouseButtonCallback;
// 	
// 	public DisplayManager(CivGame m)
// 	{
// 		main = m;
// 	}
// 	
// 	public static void createDisplay()
// 	{
// 		glfwInit();
// 		glfwSetErrorCallback(errorCallback = Callbacks.errorCallbackPrint(System.err));
// 		
// 		glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
// 		glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
// 		glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
// 		glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 
// 		window = glfwCreateWindow(width, height, "", 0, 0);
// 		glfwMakeContextCurrent(window);
// 		GLContext.createFromCurrent();
// 		glfwShowWindow(window);
// 
// 		setCursorPosCallback();
// 		setMouseCallback();
// 		setKeyCallback();
// 		
// 		if (window == 0) {
// 		    throw new RuntimeException("Failed to create window");
// 		}
// 
// 		GL11.glViewport(0, 0, width, height);
// 	}
// 	
// 	public static void setCursorPosCallback()
// 	{
// 		GLFW.glfwSetCursorPosCallback(window, (cursorPosCallback = new GLFWCursorPosCallback() {
// 		    public void invoke(long window, double xpos, double ypos) {
// 		        Mouse.setMouse((float)xpos, (float)ypos);
// 		    }
// 		}));
// 	}
// 	
// 	public static void setMouseCallback()
// 	{
// 		GLFW.glfwSetMouseButtonCallback(DisplayManager.window, (DisplayManager.mouseButtonCallback = new GLFWMouseButtonCallback() {
// 			public void invoke(long window, int button, int action, int mods) {
// 				if (action == GLFW.GLFW_PRESS) {
// 					main.menuSystem.queueMousePass(Mouse.getX(), Mouse.getY()); //includes button == 2 i.e. scroll wheel
// 					if (button == 0) {
// 						main.inputSystem.processLeftMouseClick(Mouse.getX(), Mouse.getY());
// 					} 
// 					else if (button == 1) {
// 						main.inputSystem.processRightMouseClick(Mouse.getX(), Mouse.getY());
// 					}
// 					main.menuSystem.forceUpdate();
// 					//menuSystem.closeMenus();
// 				} 
// 
// 			}
// 		}));
// 	}
// 	
// 	public static void setKeyCallback()
// 	{
// 		GLFW.glfwSetKeyCallback(DisplayManager.window, (DisplayManager.keyCallback = new GLFWKeyCallback() {
// 			public void invoke(long window, int key, int scancode, int action, int mods) {
// 				if (action == GLFW.GLFW_PRESS) {
// 					main.inputSystem.keyPressed(key);
// 					main.menuSystem.forceUpdate();
// 					//menuSystem.closeMenus();
// 				}
// 			}
// 		}));
// 	}
// 	
// 	public static void updateDisplay()
// 	{
// 		for (int i = GLFW.GLFW_KEY_0; i <= GLFW.GLFW_KEY_Z; i++)
// 		{
// 			Keyboard.keys[i] = GLFW.glfwGetKey(window, i) == GLFW.GLFW_PRESS;
// 		}
// 		/*Display.sync(120);
// 		Display.update();*/
// 		glfwPollEvents();
// 		glfwSwapBuffers(window);
// 	}
// 	
// 	public static void closeDisplay() 
// 	{
// 		glfwDestroyWindow(window);
// 	}
// 	
// 	public static boolean requestClose()
// 	{
// 		return glfwWindowShouldClose(DisplayManager.window) == GL_TRUE;
// 	}
// 
// }


// Path: src/lwjglEngine/fontMeshCreator/MetaFile.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import lwjglEngine.render.DisplayManager;

package lwjglEngine.fontMeshCreator;



/**
 * Provides functionality for getting the values from a font file.
 * 
 * @author Karl
 *
 */
public class MetaFile {

	/*private static final int PAD_TOP = 0;
	private static final int PAD_LEFT = 1;
	private static final int PAD_BOTTOM = 2;
	private static final int PAD_RIGHT = 3;*/
	private static final int PAD_TOP = 3;
	private static final int PAD_LEFT = 3;
	private static final int PAD_BOTTOM = 3;
	private static final int PAD_RIGHT = 3;

	private static final int DESIRED_PADDING = 3;

	private static final String SPLITTER = " ";
	private static final String NUMBER_SEPARATOR = ",";

	private double aspectRatio;

	private double verticalPerPixelSize;
	private double horizontalPerPixelSize;
	private double spaceWidth;
	private int[] padding;
	private int paddingWidth;
	private int paddingHeight;

	private Map<Integer, Character> metaData = new HashMap<Integer, Character>();

	private BufferedReader reader;
	private Map<String, String> values = new HashMap<String, String>();

	/**
	 * Opens a font file in preparation for reading.
	 * 
	 * @param file
	 *            - the font file.
	 */
	protected MetaFile(File file) {
		this.aspectRatio = (double) DisplayManager.width / (double) DisplayManager.height;