#ifndef SWIFT_FONT_ATLAS_H
#define SWIFT_FONT_ATLAS_H
#include <swift/stdlib.h>
#include <swift/maths.h>
#include <swift/data.h>
#include <swift/window.h>
#include <swift/string.h>
#include <swift/unicode.h>
#include <swift/window/api.h>

typedef struct swift_font_t swift_font_t;
typedef struct swift_sym_t swift_sym_t;

//FT_Face
struct swift_font_t {
	swift_tex_t texture;
	swift_vec2f_t hw, xy;
	uint8_t h;
	swift_htable_t *glyphs;
	void *face;
};

struct swift_sym_t {
	swift_uchar_t code;
	float width, height, left, top, x, y, ax, ay;
	uint16_t mheight;
};

SWIFT_WINDOW_API swift_sym_t *swift_search_glyph(swift_font_t *font,
	const swift_uchar_t code);
SWIFT_WINDOW_API swift_sym_t *swift_get_glyph(swift_font_t *font,
	const swift_uchar_t code);
SWIFT_WINDOW_API bool swift_init_fonts(const char *path);
SWIFT_WINDOW_API bool swift_load_font(swift_font_t *font);
SWIFT_WINDOW_API void swift_unload_font(swift_font_t *font);
SWIFT_WINDOW_API void swift_term_fonts(void);
SWIFT_WINDOW_API swift_sym_t swift_sym_resize(swift_sym_t *sym, float size);
#endif /* SWIFT_FONT_ATLAS_H */
