|
|
| version 1.1, 2004/08/01 05:31:31 | version 1.2, 2004/08/03 12:50:54 |
|---|---|
| Line 20 typedef struct { | Line 20 typedef struct { |
| } _FNTMNG, *FNTMNG; | } _FNTMNG, *FNTMNG; |
| static const TCHAR deffontface[] = "£Í£Ó ¥´¥·¥Ã¥¯"; | static const OEMCHAR deffontface[] = OEMTEXT("£Í£Ó ¥´¥·¥Ã¥¯"); |
| static const TCHAR deffontface2[] = "£Í£Ó £Ð¥´¥·¥Ã¥¯"; | static const OEMCHAR deffontface2[] = OEMTEXT("£Í£Ó £Ð¥´¥·¥Ã¥¯"); |
| void *fontmng_create(int size, UINT type, const TCHAR *fontface) { | void *fontmng_create(int size, UINT type, const OEMCHAR *fontface) { |
| int i; | int i; |
| int fontalign; | int fontalign; |
| Line 132 void fontmng_destroy(void *hdl) { | Line 132 void fontmng_destroy(void *hdl) { |
| } | } |
| #if !defined(UNICODE) | |
| static void getlength1(FNTMNG fhdl, FNTDAT fdat, | static void getlength1(FNTMNG fhdl, FNTDAT fdat, |
| const char *string, int length) { | const char *string, int length) { |
| Line 154 static void getlength1(FNTMNG fhdl, FNTD | Line 155 static void getlength1(FNTMNG fhdl, FNTD |
| fdat->height = fhdl->fontheight; | fdat->height = fhdl->fontheight; |
| } | } |
| static void fontmng_getchar(FNTMNG fhdl, FNTDAT fdat, const char *string) { | |
| int leng; | |
| FillRect(fhdl->hdcimage, &fhdl->rect, | |
| (HBRUSH)GetStockObject(BLACK_BRUSH)); | |
| leng = strlen(string); | |
| TextOut(fhdl->hdcimage, 0, 0, string, leng); | |
| getlength1(fhdl, fdat, string, leng); | |
| } | |
| #else | |
| static void getlength1(FNTMNG fhdl, FNTDAT fdat, | |
| const char *string, int length) { | |
| TCHAR work[4]; | |
| int leng; | |
| SIZE fntsize; | |
| if (fhdl->fonttype & FDAT_PROPORTIONAL) { | |
| leng = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, string, -1, | |
| work, NELEMENTS(work)) - 1; | |
| GetTextExtentPoint32(fhdl->hdcimage, work, leng, &fntsize); | |
| fntsize.cx = min(fntsize.cx, fhdl->bmpwidth); | |
| fdat->width = fntsize.cx; | |
| fdat->pitch = fntsize.cx; | |
| } | |
| else if (length < 2) { | |
| fdat->width = fhdl->fontwidth; | |
| fdat->pitch = (fhdl->fontsize + 1) >> 1; | |
| } | |
| else { | |
| fdat->width = fhdl->fontwidth; | |
| fdat->pitch = fhdl->fontsize; | |
| } | |
| fdat->height = fhdl->fontheight; | |
| } | |
| static void fontmng_getchar(FNTMNG fhdl, FNTDAT fdat, const char *string) { | |
| TCHAR work[4]; | |
| int leng; | |
| FillRect(fhdl->hdcimage, &fhdl->rect, | |
| (HBRUSH)GetStockObject(BLACK_BRUSH)); | |
| leng = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, string, -1, | |
| work, NELEMENTS(work)) - 1; | |
| TextOut(fhdl->hdcimage, 0, 0, work, leng); | |
| getlength1(fhdl, fdat, string, leng); | |
| } | |
| #endif | |
| BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { | BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { |
| Line 198 fmgs_exit: | Line 250 fmgs_exit: |
| return(FAILURE); | return(FAILURE); |
| } | } |
| BOOL fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt) { | BOOL fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt) { |
| char buf[4]; | char buf[4]; |
| Line 245 fmgds_exit: | Line 296 fmgds_exit: |
| return(FAILURE); | return(FAILURE); |
| } | } |
| static void fontmng_getchar(FNTMNG fhdl, FNTDAT fdat, const char *string) { | |
| int leng; | |
| FillRect(fhdl->hdcimage, &fhdl->rect, | |
| (HBRUSH)GetStockObject(BLACK_BRUSH)); | |
| leng = strlen(string); | |
| TextOut(fhdl->hdcimage, 0, 0, string, leng); | |
| getlength1(fhdl, fdat, string, leng); | |
| } | |
| static void fontmng_setpat(FNTMNG fhdl, FNTDAT fdat) { | static void fontmng_setpat(FNTMNG fhdl, FNTDAT fdat) { |
| DWORD remx; | DWORD remx; |