|
|
| version 1.1, 2004/06/06 15:33:09 | version 1.2, 2004/06/10 03:11:47 |
|---|---|
| Line 36 void *fontmng_create(int size, UINT type | Line 36 void *fontmng_create(int size, UINT type |
| int fontheight; | int fontheight; |
| int weight; | int weight; |
| DWORD pitch; | DWORD pitch; |
| int width; | |
| if (size < 0) { | if (size < 0) { |
| size *= -1; | size *= -1; |
| Line 46 void *fontmng_create(int size, UINT type | Line 47 void *fontmng_create(int size, UINT type |
| else if (size > 128) { | else if (size > 128) { |
| size = 128; | size = 128; |
| } | } |
| fontwidth = size; | if (!(type & FDAT_HALFWIDTH)) { |
| fontwidth = size; | |
| } | |
| else { | |
| fontwidth = (size + 1) / 2; | |
| } | |
| fontheight = size; | fontheight = size; |
| if (type & FDAT_BOLD) { | if (type & FDAT_BOLD) { |
| fontwidth++; | fontwidth++; |
| Line 72 void *fontmng_create(int size, UINT type | Line 78 void *fontmng_create(int size, UINT type |
| ret->bmpheight = fontheight; | ret->bmpheight = fontheight; |
| ret->bmpalign = (((ret->bmpwidth + 31) / 8) & ~3); | ret->bmpalign = (((ret->bmpwidth + 31) / 8) & ~3); |
| bi = (BITMAPINFO *)(((BYTE *)(ret + 1)) + fontalign); | bi = (BITMAPINFO *)(((BYTE *)(ret + 1)) + fontalign); |
| bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); | bi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); |
| bi->bmiHeader.biWidth = ret->bmpwidth; | bi->bmiHeader.biWidth = ret->bmpwidth; |
| Line 105 void *fontmng_create(int size, UINT type | Line 110 void *fontmng_create(int size, UINT type |
| if (fontface == NULL) { | if (fontface == NULL) { |
| fontface = (type & FDAT_PROPORTIONAL)?deffontface2:deffontface; | fontface = (type & FDAT_PROPORTIONAL)?deffontface2:deffontface; |
| } | } |
| ret->hfont = CreateFont(size, 0, | |
| width = 0; | |
| if (type & FDAT_HALFWIDTH) { | |
| width = (size + 3) / 4; | |
| } | |
| ret->hfont = CreateFont(size, width, | |
| FW_DONTCARE, FW_DONTCARE, weight, | FW_DONTCARE, FW_DONTCARE, weight, |
| FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, | FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, |
| OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, | OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, |