123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- #ifndef _BMF_H
- #define _BMF_H
- #define FONT_COUNT 7
- #define FONT_FILE_DEFAULT "text.bmf"
- #define FONT_FILE_ITALIC "texti.bmf"
- #define FONT_FILE_TITLE "title.bmf"
- #define FONT_FILE_SUBTITLE "subtitle.bmf"
- #define FONT_FILE_DEFAULT_ALL "textall.bmf"
- #define FONT_FILE_TITLE_ALL "titleall.bmf"
- #define FONT_FILE_SUBTITLE_ALL "subtlall.bmf"
- #ifdef WIKIPCF
- #define openfile open
- #define seekfile lseek
- #define readfile read
- #define closefile close
- #else
- #define openfile wl_open
- #define seekfile wl_seek
- #define readfile wl_read
- #define closefile wl_close
- #endif
- #include <inttypes.h>
- typedef unsigned char bmf_bm_t;
- typedef unsigned int ucs4_t;
- #define bzero(b,n) (memset((b),0,(n)))
- typedef unsigned char_bm_t;
- struct fontmetric {
- int ptsz;
- int Xres;
- int Yres;
- int ascent;
- int descent;
- int linespace;
- int firstchar;
- int firstCol;
- int lastCol;
- int lastchar;
- int default_char;
- };
- struct charmetric {
- int width;
- int height;
- int widthBits;
- int widthBytes;
- int ascent;
- int descent;
- int LSBearing;
- int RSBearing;
- int origin_xoff;
- };
- struct scaled_charmetric {
- double width;
- double height;
- double widthBits;
- double ascent;
- double descent;
- double origin_xoff;
- };
- typedef struct charmetric_bmf{
- int8_t width;
- int8_t height;
- int8_t widthBytes;
- int8_t widthBits;
- int8_t ascent;
- int8_t descent;
- int8_t LSBearing;
- int8_t widthDevice;
- char bitmap[48];
- }charmetric_bmf;
- typedef struct charmetric_bmf_header{
- int8_t width;
- int8_t height;
- int8_t widthBytes;
- int8_t widthBits;
- int8_t ascent;
- int8_t descent;
- int8_t LSBearing;
- int8_t RSBearing;
- int32_t pos;
- }charmetric_bmf_header;
- typedef struct font_bmf_header{
- int8_t linespace;
- int8_t ascent;
- int8_t descent;
- int8_t bmp_buffer_len;
- int32_t default_char;
- }font_bmf_header;
- typedef struct fontmetric pcf_fontmet_t;
- struct pcffont_bmf {
- char *file;
- int fd;
- pcf_fontmet_t Fmetrics;
- int bPartialFont;
- struct pcffont_bmf *supplement_font;
- char *charmetric;
- int file_size;
- int bmp_buffer_len;
- };
- typedef struct pcffont_bmf pcffont_bmf_t;
- int load_bmf(pcffont_bmf_t *font);
- int pres_bmfbm(ucs4_t val, pcffont_bmf_t *font, bmf_bm_t **bitmap,charmetric_bmf *Cmetrics);
- unsigned long * Xalloc(int);
- #endif
|