|
|
f63775 |
#ifndef HELI_FONT_H
|
|
|
f63775 |
#define HELI_FONT_H
|
|
|
f63775 |
|
|
|
f63775 |
|
|
|
f63775 |
#include "common.h"
|
|
|
f63775 |
|
|
|
f63775 |
|
|
|
f63775 |
typedef struct _Font *Font;
|
|
|
da4619 |
typedef struct _TextLayout *TextLayout;
|
|
|
f63775 |
|
|
|
f63775 |
|
|
|
f63775 |
typedef enum _HAlign {
|
|
|
f63775 |
HALIGN_LEFT,
|
|
|
f63775 |
HALIGN_CENTER,
|
|
|
f63775 |
HALIGN_RIGHT
|
|
|
f63775 |
} HAlign;
|
|
|
f63775 |
|
|
|
f63775 |
typedef enum _VAlign {
|
|
|
f63775 |
VALIGN_TOP,
|
|
|
f63775 |
VALIGN_CENTER,
|
|
|
f63775 |
VALIGN_BOTTOM
|
|
|
f63775 |
} VAlign;
|
|
|
f63775 |
|
|
|
f63775 |
|
|
|
f63775 |
Font createFont(const char *path);
|
|
|
ca6bde |
Font createFontFromMemory(const void *data, int size);
|
|
|
f63775 |
void fontDestroy(Font font);
|
|
|
f63775 |
void textFont(Font font);
|
|
|
f63775 |
void textFontDefault();
|
|
|
f63775 |
|
|
|
ca6bde |
Font fontClone(Font font);
|
|
|
ca6bde |
|
|
|
5d2371 |
void text(double x, double y, const char *text);
|
|
|
5d2371 |
void textf(double x, double y, const char *format, ...);
|
|
|
f63775 |
void textAlign(HAlign hor, VAlign vert);
|
|
|
f63775 |
void textSize(double size);
|
|
|
f63775 |
|
|
|
5d2371 |
|
|
|
da4619 |
TextLayout createTextLayout(const char *text);
|
|
|
b6ebe9 |
TextLayout createTextLayoutEx(const char *text, int length);
|
|
|
7ebc4f |
TextLayout createTextLayoutf(const char *format, ...);
|
|
|
da4619 |
void textLayoutDestroy(TextLayout layout);
|
|
|
da4619 |
void textLayoutDraw(TextLayout layout, double x, double y);
|
|
|
da4619 |
void textLayoutDrawFrom(TextLayout layout, double x, double y, int start);
|
|
|
da4619 |
void textLayoutDrawSubstr(TextLayout layout, double x, double y, int start, int length);
|
|
|
47ef74 |
double textLayoutGetLeft(TextLayout layout);
|
|
|
47ef74 |
double textLayoutGetTop(TextLayout layout);
|
|
|
da4619 |
double textLayoutGetWidth(TextLayout layout);
|
|
|
da4619 |
double textLayoutGetHeight(TextLayout layout);
|
|
|
47ef74 |
double textLayoutGetTopAscenderLine(TextLayout layout);
|
|
|
47ef74 |
double textLayoutGetTopXLine(TextLayout layout);
|
|
|
47ef74 |
double textLayoutGetBottomBaseline(TextLayout layout);
|
|
|
da4619 |
int textLayoutCursorUp(TextLayout layout, int cursor);
|
|
|
da4619 |
int textLayoutCursorDown(TextLayout layout, int cursor);
|
|
|
da4619 |
double textLayoutCursorGetX(TextLayout layout, int cursor);
|
|
|
da4619 |
double textLayoutCursorGetY(TextLayout layout, int cursor);
|
|
|
da4619 |
double textLayoutCursorGetHeight(TextLayout layout, int cursor);
|
|
|
da4619 |
|
|
|
f63775 |
|
|
|
f63775 |
#endif
|