//This code is copyright Andrew Story (Kaslai/Aslai) All rights reserved.
//This and derivative works can be distributed as seen fit,
//so long as this notice remains unchanged and present

#pragma once
#include "global/stdinc.h"
#include "engine/media.h"
#include "engine/types.h"
#include "global/classes.h"

struct Font{
    CImage img;
    int frames;
    int w;
    int h;
    int hs, vs;
    unsigned char lookup[256];
    char* id;
    int pos;
    Context* parent;
    void draw( int x, int y, const char* text );
    void drawf( int x, int y, const char* format, ... );

    Font( CImage image, Context* prnt, int framecnt, int wid, int hig, int hspace, int vspace, char* ID, const unsigned char* lookupstring );
    ~Font();
};

extern std::vector<Font*> fonts;
extern std::map<const char*, int, map_char> font_map;

Font* font_add( CImage, Context*, int framecnt, int wid, int hig, int hspace, int vspace, char* ID, const unsigned char* lookupstring );
void font_rem( Font* );
Font* font_get_by_id( char* ID );