|
|
| version 1.5, 2005/02/13 05:31:26 | version 1.6, 2005/03/26 05:46:29 |
|---|---|
| Line 498 const UINT8 *src; | Line 498 const UINT8 *src; |
| BRESULT fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { | BRESULT fontmng_getsize(void *hdl, const char *string, POINT_T *pt) { |
| FNTMNG fhdl; | FNTMNG fhdl; |
| char buf[4]; | |
| _FNTDAT fdat; | |
| int width; | int width; |
| _FNTDAT fdat; | |
| int leng; | int leng; |
| if ((hdl == NULL) || (string == NULL)) { | if ((hdl == NULL) || (string == NULL)) { |
| Line 509 BRESULT fontmng_getsize(void *hdl, const | Line 508 BRESULT fontmng_getsize(void *hdl, const |
| fhdl = (FNTMNG)hdl; | fhdl = (FNTMNG)hdl; |
| width = 0; | width = 0; |
| buf[2] = '\0'; | |
| while(1) { | while(1) { |
| buf[0] = *string++; | leng = milstr_charsize(string); |
| if ((((buf[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c) { | if (!leng) { |
| buf[1] = *string++; | |
| if (buf[1] == '\0') { | |
| break; | |
| } | |
| leng = 2; | |
| } | |
| else if (buf[0]) { | |
| buf[1] = '\0'; | |
| leng = 1; | |
| } | |
| else { | |
| break; | break; |
| } | } |
| getlength1(fhdl, &fdat, buf, leng); | getlength1((FNTMNG)hdl, &fdat, string, leng); |
| string += leng; | |
| width += fdat.pitch; | width += fdat.pitch; |
| } | } |
| if (pt) { | if (pt) { |
| Line 542 fmgs_exit: | Line 530 fmgs_exit: |
| BRESULT fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt) { | BRESULT fontmng_getdrawsize(void *hdl, const char *string, POINT_T *pt) { |
| FNTMNG fhdl; | FNTMNG fhdl; |
| char buf[4]; | |
| _FNTDAT fdat; | _FNTDAT fdat; |
| int width; | int width; |
| int leng; | |
| int posx; | int posx; |
| int leng; | |
| if ((hdl == NULL) || (string == NULL)) { | if ((hdl == NULL) || (string == NULL)) { |
| goto fmgds_exit; | goto fmgds_exit; |
| Line 555 BRESULT fontmng_getdrawsize(void *hdl, c | Line 542 BRESULT fontmng_getdrawsize(void *hdl, c |
| width = 0; | width = 0; |
| posx = 0; | posx = 0; |
| buf[2] = '\0'; | |
| while(1) { | while(1) { |
| buf[0] = *string++; | leng = milstr_charsize(string); |
| if ((((buf[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c) { | if (!leng) { |
| buf[1] = *string++; | |
| if (buf[1] == '\0') { | |
| break; | |
| } | |
| leng = 2; | |
| } | |
| else if (buf[0]) { | |
| buf[1] = '\0'; | |
| leng = 1; | |
| } | |
| else { | |
| break; | break; |
| } | } |
| getlength1(fhdl, &fdat, buf, leng); | getlength1(fhdl, &fdat, string, leng); |
| string += leng; | |
| width = posx + max(fdat.width, fdat.pitch); | width = posx + max(fdat.width, fdat.pitch); |
| posx += fdat.pitch; | posx += fdat.pitch; |
| } | } |
| Line 590 FNTDAT fontmng_get(void *hdl, const char | Line 566 FNTDAT fontmng_get(void *hdl, const char |
| FNTMNG fhdl; | FNTMNG fhdl; |
| FNTDAT fdat; | FNTDAT fdat; |
| int leng; | |
| if ((hdl == NULL) || (string == NULL)) { | if ((hdl == NULL) || (string == NULL)) { |
| goto fmg_err; | goto fmg_err; |
| Line 598 FNTDAT fontmng_get(void *hdl, const char | Line 573 FNTDAT fontmng_get(void *hdl, const char |
| fhdl = (FNTMNG)hdl; | fhdl = (FNTMNG)hdl; |
| fdat = (FNTDAT)(fhdl + 1); | fdat = (FNTDAT)(fhdl + 1); |
| leng = 1; | getfont1(fhdl, fdat, string, milstr_charsize(string)); |
| if (((((string[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c) && | |
| (string[1] != '\0')) { | |
| leng = 2; | |
| } | |
| getfont1(fhdl, fdat, string, leng); | |
| return(fdat); | return(fdat); |
| fmg_err: | fmg_err: |