#include <stdint.h>

#include "SDL.h"
#include "SDL_ttf.h"

#include <string>
using namespace std;

#include "GraphicFont.h"

GraphicFont :: GraphicFont ()
{
  refCount = 0;
  font = NULL;
  fontSize=0;
  spacing=16;
}

GraphicFont :: ~GraphicFont ()
{

}

uint16_t GraphicFont :: getFontSize ()
{
  return fontSize;
}

void GraphicFont :: setFontSize (int siz)
{
  fontSize = (uint16_t)siz;
}

TTF_Font * GraphicFont :: getFont ()
{
  return font;
}

void GraphicFont :: setFont (TTF_Font * funt)
{
  font=funt;
}

//This adjusts the spacing when you need to wrap the text, or handle deadspace in the TTF rendering. It's out of 16ths.
uint16_t GraphicFont::getSpacing()
{
  return spacing;
}

void GraphicFont::setSpacing(uint16_t spac)
{
  spacing=spac;
}

void GraphicFont :: incRefCount ()
{
  if (refCount < 2 ^ 32)
    refCount ++;
}

void GraphicFont :: decRefCount ()
{
  if (refCount > 0)
    refCount --;
}

uint32_t GraphicFont :: getRefCount ()
{
  return refCount;
}
