/* csf1.h */
/* Programed by AZO */
/* This code is free. At Your Own Risk. */

/*
****  FREE-WARE (free to copy,change...) 1992 2004  Saka.N  
****  E-Mail : Saka.N.06@b3.mnx.ne.jp            Proj.KST32B_2    

****  Font_format(=CSF1:CompactStrokeFont/1): 
****    20(Hex)     : Terminator 
****    21-26,28-3F : Move to X=0--29 
****    40-5B,5E-5F : Draw to X=0--29 
****    60-7D       : Next X to 0--29 
****    7E,A1-BF    : Move to Y=0--31 
****    C0-DF       : Draw to Y=0--31 
****    27,5C,5D    : Reserved(else=Term);Init=(0,0) 
****  Record_format<+Column#>: 
****  < 1..4 6.........max=155 > 
****    9999 (font-def) : 9999=HexAddr, (font-def)=CSF1 
*/

#ifndef _CSF1_H_
#define _CSF1_H_

#include <stdio.h>
#include <string.h>

typedef enum {
	CSF1_INIT = 0,
	CSF1_MOVE_X,
	CSF1_DRAW_X,
	CSF1_NEXT_X,
	CSF1_MOVE_Y,
	CSF1_DRAW_Y,
	CSF1_TERM
} CSF1_Action_t;

typedef struct CSF1_Item {
	CSF1_Action_t Action;
	unsigned int Val;
} CSF1_Item_t;

typedef struct CSF1_Glyph {
	unsigned int JIS;
	unsigned int ItemCount;
	CSF1_Item_t Items[155];
} CSF1_Glyph_t;

typedef struct CSF1_GlyphsData {
	unsigned int GlyphsCount;
	CSF1_Glyph_t Glyphs[10000];
} CSF1_GlyphsData_t;

extern void CSF1CharToItem(CSF1_Item_t* o_ptItem, const unsigned char i_ucChar);
extern void CSF1LineToGlyph(CSF1_Glyph_t* o_ptGlyph, const char i_strLine[]);
extern void LoadKST32B(CSF1_GlyphsData_t* o_ptGlyphsData);
extern void PrintCSF1Glyphs(const CSF1_GlyphsData_t* i_ptGlyphsData);

#endif /* _CSF1_H_ */

