--- xmil/font/fontmake.c 2004/08/01 05:31:30 1.1 +++ xmil/font/fontmake.c 2004/08/18 15:42:32 1.3 @@ -1,6 +1,9 @@ #include "compiler.h" #include "parts.h" #include "dosio.h" +#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) +#include "oemtext.h" +#endif #include "fontmng.h" #include "font.h" #include "fontdata.h" @@ -134,12 +137,20 @@ const UINT8 *p; int height; UINT8 bit; int i; +#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) + OEMCHAR oemwork[4]; +#endif ptr += from * 16; work[1] = '\0'; while(from < to) { work[0] = (char)from; +#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) + oemtext_sjis2oem(oemwork, NELEMENTS(oemwork), work, -1); + dat = fontmng_get(fnt, oemwork); +#else dat = fontmng_get(fnt, work); +#endif if (dat) { width = min(dat->width, 8); height = min(dat->height, 16); @@ -176,6 +187,9 @@ static void setjis(UINT8 *ptr, void *fnt const UINT8 *p; UINT bit; int i; +#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) + OEMCHAR oemwork[4]; +#endif work[2] = '\0'; for (h=0x21; h<0x7f; h++) { @@ -200,7 +214,12 @@ const UINT8 *p; sjis = jis2sjis(jis); work[0] = (char)(sjis >> 8); work[1] = (char)sjis; +#if defined(OSLANG_UTF8) || defined(OSLANG_UCS2) + oemtext_sjis2oem(oemwork, NELEMENTS(oemwork), work, -1); + dat = fontmng_get(fnt, oemwork); +#else dat = fontmng_get(fnt, work); +#endif if (dat) { width = min(dat->width, 16); height = min(dat->height, 16); @@ -238,24 +257,27 @@ void makex1font(REG8 loading) { if (work == NULL) { goto mfnt_err2; } - ZeroMemory(work, 0x1000); - setank(work, fnt, 0x20, 0x7f); - setank(work, fnt, 0xa1, 0xe0); - CopyMemory(work + 0x000, defrom_txt, 0x200); - CopyMemory(work + 0x7f0, defrom_txt + 0x200, 0x210); - CopyMemory(work + 0xe00, defrom_txt + 0x410, 0x200); - fh = file_create_c(x1ank2tmp); - if (fh != FILEH_INVALID) { - file_write(fh, work, 0x1000); - file_close(fh); + if (loading & FONTLOAD_ANK) { + ZeroMemory(work, 0x1000); + setank(work, fnt, 0x20, 0x7f); + setank(work, fnt, 0xa1, 0xe0); + CopyMemory(work + 0x000, defrom_txt, 0x200); + CopyMemory(work + 0x7f0, defrom_txt + 0x200, 0x210); + CopyMemory(work + 0xe00, defrom_txt + 0x410, 0x200); + fh = file_create_c(x1ank2tmp); + if (fh != FILEH_INVALID) { + file_write(fh, work, 0x1000); + file_close(fh); + } } - - ZeroMemory(work, 306176); - setjis(work, fnt); - fh = file_create_c(x1knjtmp); - if (fh != FILEH_INVALID) { - file_write(fh, work, 306176); - file_close(fh); + if (loading & (FONT_KNJ1 | FONT_KNJ2)) { + ZeroMemory(work, 306176); + setjis(work, fnt); + fh = file_create_c(x1knjtmp); + if (fh != FILEH_INVALID) { + file_write(fh, work, 306176); + file_close(fh); + } } _MFREE(work);