39 #define MATCH(a,b) ( ( strcmp(a,b) == 0 ) ? 1 : 0 ) 57 void emit_data (
FILE *out ,
char *name ,
unsigned char *data ,
int size );
58 void emit_str (
FILE *out ,
char *name ,
unsigned char *data );
73 void bsetv (
unsigned char *ptr ,
int addr );
74 void bclrv (
unsigned char *ptr ,
int addr );
75 int btestv (
unsigned char *ptr ,
int addr );
76 int bittestxy (
unsigned char *ptr ,
int x ,
int y ,
int w ,
int h );
77 void bitsetxy (
unsigned char *ptr ,
int x ,
int y ,
int w ,
int h );
78 void bitclrxy (
unsigned char *ptr ,
int x ,
int y ,
int width ,
int height );
int ishex(int c)
is a character hex ASCII character
void WriteFontBitsPreview(FILE *out, _font *font, int preview)
Write all Font characters in a font as ASCII character comments.
void FontAdjustSmall(_font *font)
Ajust font to use smallest font bounding box for each font Can be used to converting large fixed font...
void FontPreviewProportional(FILE *out, _font *font, int num)
Write Font Preview as proportional format in ASCII character comments.
void trim_tail(char *str)
Trim White space and control characters from end of string.
int btestv(unsigned char *ptr, int addr)
Test bit in byte array.
void emit_str(FILE *out, char *name, unsigned char *data)
Write Font Structure string.
void line_wrap(char *str, int max)
Line wrap function ASSUMES we write back into the string (replace space or tab with newlines...
void bsetv(unsigned char *ptr, int addr)
bit set in byte array
void WriteFontTable(FILE *out, _font *font)
Write Specification Font Table.
char * get_token(char *str, char *token, int max)
return next token
void InitFonts(_font *font)
Initialize all font structures to reset states.
char * remove_quotes(char *str)
STrip quotes from string and leading spaces.
void AdjustFontTable(_font *font)
Adjust Font X Y offset, renormalize X Y to 0 0 Also readjust font bounding box.
void FontPreviewFull(FILE *out, _font *font, int num)
Write Font Preview as full format in ASCII character comments.
void * db_free(void *p)
free memory
void emit_data(FILE *out, char *name, unsigned char *data, int size)
Write Font Structure element as a uint8_t value.
char * match_token(char *str, char *pat)
Match next token against pattern.
void InitNames(void)
Reset File and Structure names.
int ReadBdf(char *name, _font *font, int lower, int upper)
Read and parse a BDF file for specified font and character set range Fills fonts structures.
void bclrv(unsigned char *ptr, int addr)
bit clear in byte array
MEMSPACE int token(char *str, char *pat)
Search for token in a string matching user pattern.
void WriteFontInfo(FILE *out, _font *font)
Write C Header: Font Information Summary.
void * db_calloc(size_t size)
calloc memory or error exit
void WriteCharacterBits(FILE *out, _font *font, int num)
Write Font bitmap data for one charactre.
char * skip_spaces(char *str)
Skip spaces at start of string.
void Convert_Font2c(FILE *out, _font *font)
Convert font to C structure Writes header information, font specification, font bitmap.
int ishexstr(char *str)
Does a string only contain hex characters ?
char * stralloc(char *str)
Allocate space for string.
_bdffile BDFnames[MAXFONTS]
void FontAdjustFull(_font *font)
Adjust font to full size with no offset.
int bittestxy(unsigned char *ptr, int x, int y, int w, int h)
Test bit in w * h size bit array usng x and y offsets.
void FontPreview(FILE *out, _font *font, int num)
Write Font Preview bit bounding box in ASCII character comments.
int FindFontName(char *str)
Search for a font name.
void emit_number(FILE *out, char *name, int num)
Write Font Structure element as a number.
void WriteFontBits(FILE *out, _font *font)
Write Font bitmap data for all characters in a font.
void AddFontName(_font *font)
Generate the font name for this font This is based on the BDF FAMILY_NAME,WEIGHT_NAME,SLANT keywords.
void bitsetxy(unsigned char *ptr, int x, int y, int w, int h)
Set bit in width * height size bit array usng x and y offsets.
void bitclrxy(unsigned char *ptr, int x, int y, int width, int height)
Clear bit in width * height size bit array usng x and y offsets.
void FreeFont(_font *font)
Free font data.
void FontHeaderInfo(FILE *out, _font *font, char *prog, char *target)
Write Font Header Information Copyright, font family, etc.
void ComputeGapSize(_font *font)
Find a good gap size (inter-character spacing) for any font Currently we searching for the smallest w...