2019-07-24 07:41:40 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 11.03.2017
|
|
|
|
*
|
|
|
|
* Font system interface.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FCODER_FONT_INTERFACE_H)
|
|
|
|
#define FCODER_FONT_INTERFACE_H
|
|
|
|
|
|
|
|
typedef i32 Texture_Kind;
|
|
|
|
enum{
|
|
|
|
TextureKind_Error,
|
|
|
|
TextureKind_Mono,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef u32 Graphics_Get_Texture_Function(Vec3_i32 dim, Texture_Kind texture_kind);
|
|
|
|
typedef b32 Graphics_Fill_Texture_Function(Texture_Kind texture_kind, u32 texture,
|
|
|
|
Vec3_i32 p, Vec3_i32 dim, void *data);
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
struct Glyph_Bounds{
|
|
|
|
Rect_f32 uv;
|
|
|
|
f32 w;
|
|
|
|
Rect_f32 xy_off;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Face{
|
|
|
|
Face_Description description;
|
2019-07-25 07:17:01 +00:00
|
|
|
Face_ID id;
|
2019-09-02 18:59:36 +00:00
|
|
|
i32 version_number;
|
2019-07-24 07:41:40 +00:00
|
|
|
|
|
|
|
// NOTE(allen): Metrics
|
2019-10-29 04:27:20 +00:00
|
|
|
Face_Metrics metrics;
|
2019-07-24 07:41:40 +00:00
|
|
|
|
|
|
|
// NOTE(allen): Glyph data
|
2019-10-29 04:27:20 +00:00
|
|
|
Face_Advance_Map advance_map;
|
2019-07-24 07:41:40 +00:00
|
|
|
Glyph_Bounds *bounds;
|
|
|
|
Glyph_Bounds white;
|
|
|
|
|
|
|
|
Texture_Kind texture_kind;
|
|
|
|
u32 texture;
|
|
|
|
Vec3_f32 texture_dim;
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////
|
|
|
|
|
|
|
|
// NOTE(allen): Platform layer calls - implemented in a "font provider"
|
2019-09-28 00:49:59 +00:00
|
|
|
typedef Face *Font_Make_Face_Function(Arena *arena, Face_Description *description, f32 scale_factor);
|
2019-07-24 07:41:40 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|
|
|
|
|