1
0
Fork 0
LithOS3/lithos_c/lithos3/inc/Lth_font.h

90 lines
1.6 KiB
C
Raw Normal View History

2016-10-18 10:46:06 -07:00
//-----------------------------------------------------------------------------
//
// Copyright © 2016 Project Golan
//
// See "LICENSE" for more information.
//
//-----------------------------------------------------------------------------
//
// Font layout handling.
//
//-----------------------------------------------------------------------------
#ifndef lithos3__Lth_font_h
#define lithos3__Lth_font_h
#define Lth_FontRunBegin() ACS_BeginPrint()
2016-10-18 10:46:06 -07:00
2016-10-18 14:20:32 -07:00
// Type Definitions ----------------------------------------------------------|
2016-10-18 10:46:06 -07:00
struct Lth_Context;
enum
{
Lth_AX_Lef = 1,
Lth_AX_Rig,
Lth_AX_Cen,
Lth_AY_Top = 1,
Lth_AY_Bot,
Lth_AY_Cen
};
//
// Lth_FontCasing
//
typedef enum Lth_FontCasing
{
Lth_Case_Both,
Lth_Case_Uppr,
Lth_Case_Lowr
} Lth_FontCasing;
//
// Lth_GlyphLookupType
//
typedef enum Lth_GlyphLookupType
{
Lth_GT_Chara,
Lth_GT_Codep,
Lth_GT_Digit
} Lth_GlyphLookupType;
2016-10-18 10:46:06 -07:00
//
// Lth_Glyph
//
typedef struct Lth_Glyph
{
Lth_Inherits(Lth_Rect);
__str fname;
_Accum s;
wchar_t ch;
char mb[MB_CUR_MAX + 1];
2016-10-18 10:46:06 -07:00
} Lth_Glyph;
//
// Lth_Font
//
typedef struct Lth_Font
{
Lth_FontCasing casing;
__str baseName;
int spaceWidth;
int height;
__str fnamePref;
__str fnameSuff;
Lth_HashMap glyphs;
Lth_Vector(Lth_Glyph) glyphV;
2016-10-18 10:46:06 -07:00
} Lth_Font;
2016-10-18 14:20:32 -07:00
// Extern Functions ----------------------------------------------------------|
2016-10-18 10:46:06 -07:00
Lth_ScriptCall Lth_Font *Lth_FontNew(char const *fname);
void Lth_FontDestroy(Lth_Font *font);
Lth_OptArgs(2) void Lth_FontRunPlain(struct Lth_Context *ctx, Lth_Font *font, int x, int y, int ax, int ay);
2016-10-18 10:46:06 -07:00
#endif//lithos3__Lth_font_h