1234567891011121314151617181920212223242526272829303132333435363738 |
- /* See LICENSE file for copyright and license details. */
- typedef int32_t dt_error;
- typedef struct {
- FT_Library ft_lib;
- XRenderPictFormat *win_format;
- XRenderPictFormat *argb32_format;
- Display *dpy;
- Picture pic;
- Picture fill;
- } dt_context;
- typedef struct {
- FT_Face face;
- GlyphSet gs;
- uint8_t loaded[256];
- } dt_font;
- typedef struct {
- uint8_t red;
- uint8_t green;
- uint8_t blue;
- uint8_t alpha; // 0 means opaque
- } dt_style;
- dt_error dt_init(dt_context **ctx, Display *dpy, Window win);
- dt_error dt_quit(dt_context *ctx);
- dt_error dt_load(dt_context *ctx, dt_font **fnt,
- uint8_t size, char const *name);
- dt_error dt_free(dt_context *ctx, dt_font *fnt);
- dt_error dt_draw(dt_context *ctx, dt_font *fnt, dt_style const *style,
- uint32_t x, uint32_t y, char const *txt);
|