2017-11-16 23:03:36 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 16.11.2017
|
|
|
|
*
|
|
|
|
* Data types for the freetype font provider.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FCODER_FONT_PROVIDER_FREETYPE_H)
|
|
|
|
#define FCODER_FONT_PROVIDER_FREETYPE_H
|
|
|
|
|
2017-11-17 19:22:12 +00:00
|
|
|
// NOTE(allen): Implemented by the freetype font provider.
|
2017-11-16 23:03:36 +00:00
|
|
|
struct Font_Slot{
|
|
|
|
b32 is_active;
|
|
|
|
Font_Settings settings;
|
|
|
|
Font_Metrics metrics;
|
|
|
|
Font_Page_Storage pages;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Font_Vars{
|
|
|
|
Font_Slot slots[32];
|
2017-11-17 19:22:12 +00:00
|
|
|
i32 count;
|
|
|
|
|
|
|
|
Font_Loadable_Description loadables[4096];
|
|
|
|
i32 loadable_count;
|
|
|
|
|
|
|
|
u32 pt_size;
|
|
|
|
b32 use_hinting;
|
2017-11-16 23:03:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
global Font_Vars fontvars = {0};
|
|
|
|
|
|
|
|
struct Font_Setup{
|
2017-11-17 19:22:12 +00:00
|
|
|
Font_Setup *next;
|
2017-11-16 23:03:36 +00:00
|
|
|
Font_Loadable_Stub stub;
|
2017-11-17 21:20:25 +00:00
|
|
|
|
|
|
|
b32 has_display_name;
|
|
|
|
i32 len;
|
|
|
|
char name[64];
|
2017-11-16 23:03:36 +00:00
|
|
|
};
|
|
|
|
|
2017-11-17 19:22:12 +00:00
|
|
|
struct Font_Setup_List{
|
|
|
|
Font_Setup *first;
|
|
|
|
Font_Setup *last;
|
|
|
|
};
|
|
|
|
|
|
|
|
// NOTE(allen): Procedures to be implemented per-OS for the freetype font provider.
|
|
|
|
struct Font_Raw_Data{
|
|
|
|
Temp_Memory temp;
|
|
|
|
u8 *data;
|
|
|
|
i32 size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define Sys_Font_Data(name) Font_Raw_Data system_font_data(char *name)
|
|
|
|
internal Sys_Font_Data(name);
|
|
|
|
|
2017-11-17 20:26:29 +00:00
|
|
|
#define Sys_Font_Data_Not_Used \
|
2017-11-17 21:20:25 +00:00
|
|
|
internal Sys_Font_Data(name){Font_Raw_Data data = {0}; LOG("there is no font data retrieval procedure available\n"); return(data);}
|
2017-11-17 19:22:12 +00:00
|
|
|
|
2017-11-16 23:03:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|