|
|
| version 1.1.1.1, 2003/10/16 17:59:33 | version 1.6, 2005/02/09 20:11:37 |
|---|---|
| Line 6 | Line 6 |
| #if defined(FONTMNG_CACHE) | #if defined(FONTMNG_CACHE) |
| typedef struct { | typedef struct { |
| WORD str; | UINT16 str; |
| WORD next; | UINT16 next; |
| } FNTCTBL; | } FNTCTBL; |
| #endif | #endif |
| Line 29 typedef struct { | Line 29 typedef struct { |
| int bmpalign; | int bmpalign; |
| #if defined(FONTMNG_CACHE) | #if defined(FONTMNG_CACHE) |
| DWORD caches; | UINT caches; |
| DWORD cachehead; | UINT cachehead; |
| FNTCTBL cache[FONTMNG_CACHE]; | FNTCTBL cache[FONTMNG_CACHE]; |
| #endif | #endif |
| } _FNTMNG, *FNTMNG; | } _FNTMNG, *FNTMNG; |
| Line 188 void *fontmng_create(int size, UINT type | Line 188 void *fontmng_create(int size, UINT type |
| return(ret); | return(ret); |
| } | } |
| void fontmng_destroy(void *hdl) { | void fontmng_destroy(void *hdl) { |
| FNTMNG fhdl; | FNTMNG fhdl; |
| Line 202 void fontmng_destroy(void *hdl) { | Line 201 void fontmng_destroy(void *hdl) { |
| } | } |
| } | } |
| int fontmng_getpoint(void *hdl) { | |
| #ifdef _WIN32_WCE | if (hdl) { |
| } | |
| return(0); | |
| } | |
| #ifdef UNICODE | |
| static void getlength1(FNTMNG fhdl, FNTDAT fdat, LPCTSTR string, | static void getlength1(FNTMNG fhdl, FNTDAT fdat, LPCTSTR string, |
| int tleng, int length) { | int tleng, int length) { |
| Line 218 static void getlength1(FNTMNG fhdl, FNTD | Line 223 static void getlength1(FNTMNG fhdl, FNTD |
| fdat->height = fhdl->bmpheight >> 1; | fdat->height = fhdl->bmpheight >> 1; |
| } | } |
| else { | else { |
| fntsize.cx = min(fntsize.cx, fhdl->bmpwidth); | #if 1 // PocketPCのみ戻り値が変らしい? |
| fdat->width = fntsize.cx; | fdat->width = min(fntsize.cx, fhdl->bmpwidth); |
| fdat->pitch = fntsize.cx; | #else |
| fdat->width = min(fntsize.cx + 1, fhdl->bmpwidth); | |
| #endif | |
| fdat->pitch = min(fntsize.cx, fhdl->bmpwidth); | |
| fdat->height = fhdl->bmpheight; | fdat->height = fhdl->bmpheight; |
| } | } |
| } | } |
| Line 258 static void fontmng_getchar(FNTMNG fhdl, | Line 266 static void fontmng_getchar(FNTMNG fhdl, |
| getlength1(fhdl, fdat, txtwork, len, leng); | getlength1(fhdl, fdat, txtwork, len, leng); |
| } | } |
| BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { | BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { |
| TCHAR txtwork[4]; | TCHAR txtwork[4]; |
| Line 268 BOOL fontmng_getsize(void *hdl, const ch | Line 275 BOOL fontmng_getsize(void *hdl, const ch |
| DWORD len; | DWORD len; |
| int leng; | int leng; |
| width = 0; | |
| if ((hdl == NULL) || (string == NULL)) { | if ((hdl == NULL) || (string == NULL)) { |
| goto fmgs_exit; | goto fmgs_exit; |
| } | } |
| width = 0; | |
| buf[2] = '\0'; | buf[2] = '\0'; |
| do { | do { |
| buf[0] = *string++; | buf[0] = *string++; |
| Line 306 fmgs_exit: | Line 312 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) { |
| TCHAR txtwork[4]; | TCHAR txtwork[4]; |
| Line 357 fmgds_exit: | Line 362 fmgds_exit: |
| return(FAILURE); | return(FAILURE); |
| } | } |
| #else | #else |
| static void getlength1(FNTMNG fhdl, FNTDAT fdat, | static void getlength1(FNTMNG fhdl, FNTDAT fdat, |
| Line 398 static void getlength1(FNTMNG fhdl, FNTD | Line 402 static void getlength1(FNTMNG fhdl, FNTD |
| } | } |
| } | } |
| static void fontmng_getchar(FNTMNG fhdl, FNTDAT fdat, const char *string) { | static void fontmng_getchar(FNTMNG fhdl, FNTDAT fdat, const char *string) { |
| int leng; | int leng; |
| Line 410 static void fontmng_getchar(FNTMNG fhdl, | Line 413 static void fontmng_getchar(FNTMNG fhdl, |
| getlength1(fhdl, fdat, string, leng); | getlength1(fhdl, fdat, string, leng); |
| } | } |
| BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { | BOOL fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { |
| char buf[4]; | char buf[4]; |
| Line 454 fmgs_exit: | Line 456 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 502 fmgds_exit: | Line 503 fmgds_exit: |
| } | } |
| #endif | #endif |
| static void fontmng_setpat(FNTMNG fhdl, FNTDAT fdat) { | static void fontmng_setpat(FNTMNG fhdl, FNTDAT fdat) { |
| DWORD remx; | DWORD remx; |
| Line 586 fmsp_end: | Line 586 fmsp_end: |
| return; | return; |
| } | } |
| FNTDAT fontmng_get(void *hdl, const char *string) { | FNTDAT fontmng_get(void *hdl, const char *string) { |
| FNTMNG fhdl; | FNTMNG fhdl; |
| Line 620 FNTDAT fontmng_get(void *hdl, const char | Line 619 FNTDAT fontmng_get(void *hdl, const char |
| } | } |
| if (prev < FONTMNG_CACHE) { | if (prev < FONTMNG_CACHE) { |
| fct[prev].next = fct[pos].next; | fct[prev].next = fct[pos].next; |
| fct[pos].next = (WORD)fhdl->cachehead; | fct[pos].next = (UINT16)fhdl->cachehead; |
| fhdl->cachehead = pos; | fhdl->cachehead = pos; |
| } | } |
| return((FNTDAT)(((BYTE *)(fhdl + 1)) + (pos * fhdl->fontalign))); | return((FNTDAT)(((BYTE *)(fhdl + 1)) + (pos * fhdl->fontalign))); |
| Line 629 FNTDAT fontmng_get(void *hdl, const char | Line 628 FNTDAT fontmng_get(void *hdl, const char |
| prev = fhdl->caches; | prev = fhdl->caches; |
| fhdl->caches++; | fhdl->caches++; |
| } | } |
| fct[prev].str = (WORD)str; | fct[prev].str = (UINT16)str; |
| fct[prev].next = (WORD)fhdl->cachehead; | fct[prev].next = (UINT16)fhdl->cachehead; |
| fhdl->cachehead = prev; | fhdl->cachehead = prev; |
| fdat = (FNTDAT)(((BYTE *)(fhdl + 1)) + (prev * fhdl->fontalign)); | fdat = (FNTDAT)(((BYTE *)(fhdl + 1)) + (prev * fhdl->fontalign)); |
| } | } |