Blob Blame Raw
#ifndef HELI_FONT_H
#define HELI_FONT_H


#include "common.h"


typedef struct _Font *Font;
typedef struct _TextLayout *TextLayout;


typedef enum _HAlign {
	HALIGN_LEFT,
	HALIGN_CENTER,
	HALIGN_RIGHT
} HAlign;

typedef enum _VAlign {
	VALIGN_TOP,
	VALIGN_CENTER,
	VALIGN_BOTTOM
} VAlign;


Font createFont(const char *path);
Font createFontFromMemory(const void *data, int size);
void fontDestroy(Font font);
void textFont(Font font);
void textFontDefault();

Font fontClone(Font font);

void text(double x, double y, const char *text);
void textf(double x, double y, const char *format, ...);
void textAlign(HAlign hor, VAlign vert);
void textSize(double size);


TextLayout createTextLayout(const char *text);
void textLayoutDestroy(TextLayout layout);
void textLayoutDraw(TextLayout layout, double x, double y);
void textLayoutDrawFrom(TextLayout layout, double x, double y, int start);
void textLayoutDrawSubstr(TextLayout layout, double x, double y, int start, int length);
double textLayoutGetWidth(TextLayout layout);
double textLayoutGetHeight(TextLayout layout);
int textLayoutCursorUp(TextLayout layout, int cursor);
int textLayoutCursorDown(TextLayout layout, int cursor);
double textLayoutCursorGetX(TextLayout layout, int cursor);
double textLayoutCursorGetY(TextLayout layout, int cursor);
double textLayoutCursorGetHeight(TextLayout layout, int cursor);


#endif