mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 10:26:59 +00:00
checkpoint: BoredWord application
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
// stb_truetype math stubs
|
||||
extern float ksqrtf(float x);
|
||||
extern float kpowf(float b, float e);
|
||||
extern float kfmodf(float x, float y);
|
||||
@@ -24,21 +23,18 @@ extern float kfabsf(float x);
|
||||
|
||||
#define STBTT_assert(x) ((void)0)
|
||||
|
||||
// Memory management
|
||||
#define STBTT_malloc(x,u) kmalloc(x)
|
||||
#define STBTT_free(x,u) kfree(x)
|
||||
|
||||
// String functions
|
||||
#define STBTT_memcpy mem_memcpy
|
||||
#define STBTT_memset mem_memset
|
||||
|
||||
// Data types
|
||||
typedef uint64_t STBTT_ptrsize;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
size_t size;
|
||||
void *info; // stbtt_fontinfo
|
||||
void *info;
|
||||
float scale;
|
||||
float pixel_height;
|
||||
int ascent;
|
||||
@@ -50,6 +46,7 @@ bool font_manager_init(void);
|
||||
ttf_font_t* font_manager_load(const char *path, float size);
|
||||
void font_manager_render_char(ttf_font_t *font, int x, int y, char c, uint32_t color, void (*put_pixel_fn)(int, int, uint32_t));
|
||||
void font_manager_render_char_scaled(ttf_font_t *font, int x, int y, char c, uint32_t color, float scale, void (*put_pixel_fn)(int, int, uint32_t));
|
||||
void font_manager_render_char_sloped(ttf_font_t *font, int x, int y, char c, uint32_t color, float scale, float slope, void (*put_pixel_fn)(int, int, uint32_t));
|
||||
int font_manager_get_string_width(ttf_font_t *font, const char *s);
|
||||
int font_manager_get_string_width_scaled(ttf_font_t *font, const char *s, float scale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user