37 lines
992 B
C
37 lines
992 B
C
#ifndef _HEXAGRAM_TEXT_H
|
|
#define _HEXAGRAM_TEXT_H
|
|
|
|
#include <sys/types.h>
|
|
#include <cairo.h>
|
|
|
|
#include <hexagram/gauge.h>
|
|
|
|
#define HEXAGRAM_TEXT_FONT_FACE "Muli"
|
|
#define HEXAGRAM_TEXT_FONT_SLANT CAIRO_FONT_SLANT_NORMAL
|
|
#define HEXAGRAM_TEXT_FONT_WEIGHT CAIRO_FONT_WEIGHT_BOLD
|
|
#define HEXAGRAM_TEXT_FONT_SIZE 24
|
|
|
|
typedef enum {
|
|
HEXAGRAM_TEXT_LEFT,
|
|
HEXAGRAM_TEXT_MIDDLE,
|
|
HEXAGRAM_TEXT_RIGHT
|
|
} hexagram_text_align;
|
|
|
|
typedef struct _hexagram_text hexagram_text;
|
|
|
|
typedef ssize_t (hexagram_text_format_callback)(hexagram_text *, char *, size_t);
|
|
|
|
typedef struct _hexagram_text {
|
|
hexagram_gauge gauge;
|
|
hexagram_text_align align;
|
|
hexagram_text_format_callback *format_text;
|
|
char buf[128];
|
|
} hexagram_text;
|
|
|
|
int hexagram_text_init(hexagram_text *text,
|
|
double x,
|
|
double y,
|
|
hexagram_text_align align,
|
|
hexagram_text_format_callback *format_text);
|
|
|
|
#endif /* _HEXAGRAM_TEXT_H */
|