--- /dev/null
+#include "Font.h"
+#include <iostream>
+#include <string>
+#include "fns.h"
+#include <GL/gl.h>
+using namespace std;
+
+
+Font::Font( FontType t, int s ) : type(t), size(s), count(1){
+ // Load a font
+ fontFile = type==English ? "FreeSans.ttf" : "Japanese.ttf";
+ font = TTF_OpenFont(fontFile.c_str(), size);
+ if(!font)
+ cerr << "TTF_OpenFont() Failed: " << TTF_GetError() << endl;
+}
+
+Font::Font( int s ) : type(English), size(s), count(1){
+ // Load a font
+ fontFile = "FreeSans.ttf";
+ font = TTF_OpenFont(fontFile.c_str(), size);
+
+ if(!font)
+ cerr << "TTF_OpenFont() Failed: " << TTF_GetError() << endl;
+
+}
+
+Font::~Font(){
+ TTF_CloseFont(font);
+}
+
+void Font::setSize(int s){
+ if(s!=size){
+ TTF_CloseFont(font);
+ font = TTF_OpenFont(fontFile.c_str(), s);
+ }
+}
--- /dev/null
+#ifndef __FONT_H__
+#define __FONT_H__
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <SDL/SDL.h>
+#include "SDL_ttf.h"
+#include "fns.h"
+using namespace std;
+
+/**
+ Font for rendering text
+
+ This class is tasked with the following:
+ - Holding and loading a font
+ */
+class Font
+{
+ public:
+ ///The font itself
+ TTF_Font* font;
+ ///Type for the font en, jp, jpw/ruby
+ FontType type;
+ ///Filename of the font
+ string fontFile;
+ ///Font size
+ int size;
+ ///The count of Texts using this font
+ int count;
+ /**
+ Create the font with size s
+ \param s Font size
+ */
+ Font(int s = 24);
+ /**
+ Create the font with size s and type t
+ \param s Font size
+ \param t Type of font
+ */
+ Font(FontType t, int s = 24);
+ ~Font();
+ //closes the font and changes the size
+ void setSize(int s);
+};
+#endif