Added in support for font groupings.

This commit is contained in:
Adam Harrison
2021-10-12 23:24:52 -04:00
parent 3e2b0f28c8
commit f2488fdd8d
6 changed files with 115 additions and 54 deletions
+7 -6
View File
@@ -5,6 +5,7 @@
#include <stdint.h>
#include <stdbool.h>
#define FONT_FALLBACK_MAX 4
typedef struct RenFont RenFont;
typedef enum { FONT_HINTING_NONE, FONT_HINTING_SLIGHT, FONT_HINTING_FULL } ERenFontHinting;
typedef enum { FONT_STYLE_BOLD = 1, FONT_STYLE_ITALIC = 2, FONT_STYLE_UNDERLINE = 4 } ERenFontStyle;
@@ -14,12 +15,12 @@ typedef struct { int x, y, width, height; } RenRect;
RenFont* ren_font_load(const char *filename, float size, bool subpixel, unsigned char hinting, unsigned char style);
RenFont* ren_font_copy(RenFont* font, float size);
void ren_font_free(RenFont *font);
void ren_font_set_tab_size(RenFont *font, int n);
int ren_font_get_tab_size(RenFont *font);
float ren_font_get_width(RenFont *font, const char *text);
int ren_font_get_height(RenFont *font);
float ren_font_get_size(RenFont *font);
float ren_draw_text(RenFont *font, const char *text, float x, int y, RenColor color);
int ren_font_group_get_tab_size(RenFont **font);
int ren_font_group_get_height(RenFont **font);
float ren_font_group_get_size(RenFont **font);
void ren_font_group_set_tab_size(RenFont **font, int n);
float ren_font_group_get_width(RenFont **font, const char *text);
float ren_draw_text(RenFont **font, const char *text, float x, int y, RenColor color);
void ren_draw_rect(RenRect rect, RenColor color);