Blame src/font.h

Ivan Mahonin f63775
#ifndef HELI_FONT_H
Ivan Mahonin f63775
#define HELI_FONT_H
Ivan Mahonin f63775
Ivan Mahonin f63775
Ivan Mahonin f63775
#include "common.h"
Ivan Mahonin f63775
Ivan Mahonin f63775
Ivan Mahonin f63775
typedef struct _Font *Font;
Ivan Mahonin da4619
typedef struct _TextLayout *TextLayout;
Ivan Mahonin f63775
Ivan Mahonin f63775
Ivan Mahonin f63775
typedef enum _HAlign {
Ivan Mahonin f63775
	HALIGN_LEFT,
Ivan Mahonin f63775
	HALIGN_CENTER,
Ivan Mahonin f63775
	HALIGN_RIGHT
Ivan Mahonin f63775
} HAlign;
Ivan Mahonin f63775
Ivan Mahonin f63775
typedef enum _VAlign {
Ivan Mahonin f63775
	VALIGN_TOP,
Ivan Mahonin f63775
	VALIGN_CENTER,
Ivan Mahonin f63775
	VALIGN_BOTTOM
Ivan Mahonin f63775
} VAlign;
Ivan Mahonin f63775
Ivan Mahonin f63775
Ivan Mahonin f63775
Font createFont(const char *path);
Ivan Mahonin ca6bde
Font createFontFromMemory(const void *data, int size);
Ivan Mahonin f63775
void fontDestroy(Font font);
Ivan Mahonin f63775
void textFont(Font font);
Ivan Mahonin f63775
void textFontDefault();
Ivan Mahonin f63775
Ivan Mahonin ca6bde
Font fontClone(Font font);
Ivan Mahonin ca6bde
Ivan Mahonin f63775
void text(const char *text, double x, double y);
Ivan Mahonin f63775
void textAlign(HAlign hor, VAlign vert);
Ivan Mahonin f63775
void textSize(double size);
Ivan Mahonin f63775
Ivan Mahonin da4619
TextLayout createTextLayout(const char *text);
Ivan Mahonin da4619
void textLayoutDestroy(TextLayout layout);
Ivan Mahonin da4619
void textLayoutDraw(TextLayout layout, double x, double y);
Ivan Mahonin da4619
void textLayoutDrawFrom(TextLayout layout, double x, double y, int start);
Ivan Mahonin da4619
void textLayoutDrawSubstr(TextLayout layout, double x, double y, int start, int length);
Ivan Mahonin da4619
double textLayoutGetWidth(TextLayout layout);
Ivan Mahonin da4619
double textLayoutGetHeight(TextLayout layout);
Ivan Mahonin da4619
int textLayoutCursorUp(TextLayout layout, int cursor);
Ivan Mahonin da4619
int textLayoutCursorDown(TextLayout layout, int cursor);
Ivan Mahonin da4619
double textLayoutCursorGetX(TextLayout layout, int cursor);
Ivan Mahonin da4619
double textLayoutCursorGetY(TextLayout layout, int cursor);
Ivan Mahonin da4619
double textLayoutCursorGetHeight(TextLayout layout, int cursor);
Ivan Mahonin da4619
Ivan Mahonin f63775
Ivan Mahonin f63775
#endif