#ifndef _AO_DRAW_H_
#define _AO_DRAW_H_
+#include <stdint.h>
+#include <stdbool.h>
+#include "ao_font.h"
+
struct ao_bitmap {
uint32_t *base;
int16_t stride; /* in units */
uint8_t pattern[8];
};
+struct ao_glyph_metrics {
+ int8_t width;
+ int8_t height;
+ int8_t x_off;
+ int8_t y_off;
+ int8_t advance;
+};
+
+struct ao_font {
+ const uint8_t *bytes;
+ const uint16_t *pos;
+ const struct ao_glyph_metrics *metrics;
+ int max_width;
+ int max_height;
+ int ascent;
+};
+
void
ao_copy(const struct ao_bitmap *dst,
int16_t dst_x,
void
ao_text(const struct ao_bitmap *dst,
+ const struct ao_font *font,
int16_t x,
int16_t y,
char *string,
uint32_t fill,
uint8_t rop);
-struct ao_font {
- int width;
- int height;
- int ascent;
- int descent;
-};
-
-extern const struct ao_font ao_font;
+extern const struct ao_font FrutigerLT_Roman_50_font;
#define AO_SHIFT 5
#define AO_UNIT (1 << AO_SHIFT)