diff --git a/lithos_c/Makefile b/lithos_c/Makefile index 478dbdb..ff8d7c4 100644 --- a/lithos_c/Makefile +++ b/lithos_c/Makefile @@ -41,6 +41,7 @@ SOURCES= \ $(SRC)/context.c \ $(SRC)/control.c \ $(SRC)/draw.c \ + $(SRC)/font.c \ $(SRC)/main.c \ $(SRC)/stdlib.c \ $(SRC)/window.c @@ -53,6 +54,7 @@ HEADERS= \ $(INC)/Lth_context.h \ $(INC)/Lth_control.h \ $(INC)/Lth_draw.h \ + $(INC)/Lth_font.h \ $(INC)/Lth_hudmessage.h \ $(INC)/Lth_linklist.h \ $(INC)/Lth_stdlib.h \ diff --git a/lithos_c/inc/Lth.h b/lithos_c/inc/Lth.h index 50f9902..c0de7dc 100644 --- a/lithos_c/inc/Lth.h +++ b/lithos_c/inc/Lth.h @@ -19,6 +19,7 @@ #include "Lth_context.h" #include "Lth_control.h" #include "Lth_draw.h" +#include "Lth_font.h" #include "Lth_hudmessage.h" #include "Lth_linklist.h" #include "Lth_stdlib.h" diff --git a/lithos_c/inc/Lth_font.h b/lithos_c/inc/Lth_font.h new file mode 100644 index 0000000..1a25a56 --- /dev/null +++ b/lithos_c/inc/Lth_font.h @@ -0,0 +1,45 @@ +//----------------------------------------------------------------------------- +// +// Copyright © 2016 Project Golan +// +// See "LICENSE" for more information. +// +//----------------------------------------------------------------------------- +// +// Font layout handling. +// +//----------------------------------------------------------------------------- + +#ifndef lithos3__Lth_font_h +#define lithos3__Lth_font_h + + +//----------------------------------------------------------------------------| +// Type Definitions | +// + +// +// Lth_Glyph +// +typedef struct Lth_Glyph +{ + int w, h; +} Lth_Glyph; + +// +// Lth_Font +// +typedef struct Lth_Font +{ + __str name; + Lth_Glyph glyphs[126]; +} Lth_Font; + + +//----------------------------------------------------------------------------| +// Extern Functions | +// + +Lth_Font *Lth_FontNew(char const *name); + +#endif//lithos3__Lth_font_h diff --git a/lithos_c/src/font.c b/lithos_c/src/font.c new file mode 100644 index 0000000..6abbddf --- /dev/null +++ b/lithos_c/src/font.c @@ -0,0 +1,35 @@ +//----------------------------------------------------------------------------- +// +// Copyright © 2016 Project Golan +// +// See "LICENSE" for more information. +// +//----------------------------------------------------------------------------- +// +// Font layout handling. +// +//----------------------------------------------------------------------------- + +#include "Lth.h" + +#include + + +//----------------------------------------------------------------------------| +// Extern Functions | +// + +// +// Lth_FontNew +// +Lth_Font *Lth_FontNew(char const *name) +{ + Lth_Font *font = calloc(1, sizeof(Lth_Font)); + Lth_assert(font != NULL); + + font->name = Lth_strdup_str(name); + + return font; +} + +// EOF