PatchworkOS
Loading...
Searching...
No Matches
font.h
Go to the documentation of this file.
1#ifndef PATCHWORK_FONT_H
2#define PATCHWORK_FONT_H 1
3
4#include "display.h"
5
6#include <stdint.h>
7
8#if defined(__cplusplus)
9extern "C"
10{
11#endif
12
13// Note: rendering is using our custom format .grf (refer to the README).
14
15typedef struct font font_t;
16
18
19font_t* font_new(display_t* disp, const char* family, const char* weight, uint64_t size);
20
21void font_free(font_t* font);
22
23int16_t font_kerning_offset(const font_t* font, char firstChar, char secondChar);
24
25uint64_t font_width(const font_t* font, const char* string, uint64_t length);
26
27uint64_t font_height(const font_t* font);
28
29#if defined(__cplusplus)
30}
31#endif
32
33#endif
uint64_t font_width(const font_t *font, const char *string, uint64_t length)
Definition font.c:130
int16_t font_kerning_offset(const font_t *font, char firstChar, char secondChar)
Definition font.c:99
void font_free(font_t *font)
Definition font.c:91
font_t * font_new(display_t *disp, const char *family, const char *weight, uint64_t size)
Definition font.c:17
uint64_t font_height(const font_t *font)
Definition font.c:158
font_t * font_default(display_t *disp)
Definition font.c:7
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__INT16_TYPE__ int16_t
Definition stdint.h:12
Opaque display structure.
Definition internal.h:61