1
0
Fork 0

Create Font module.

master
Marrub 2016-10-18 13:46:06 -04:00
parent f8cc0672ba
commit a93f60355f
4 changed files with 83 additions and 0 deletions

View File

@ -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 \

View File

@ -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"

45
lithos_c/inc/Lth_font.h Normal file
View File

@ -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

35
lithos_c/src/font.c Normal file
View File

@ -0,0 +1,35 @@
//-----------------------------------------------------------------------------
//
// Copyright © 2016 Project Golan
//
// See "LICENSE" for more information.
//
//-----------------------------------------------------------------------------
//
// Font layout handling.
//
//-----------------------------------------------------------------------------
#include "Lth.h"
#include <stdlib.h>
//----------------------------------------------------------------------------|
// 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