Create Font module.
parent
f8cc0672ba
commit
a93f60355f
|
@ -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 \
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue