diff -cr fvwm95-2.0.42ah2/ChangeLog.NHX fvwm95-2.0.42ah3/ChangeLog.NHX *** fvwm95-2.0.42ah2/ChangeLog.NHX Sun Oct 13 20:02:42 1996 --- fvwm95-2.0.42ah3/ChangeLog.NHX Sun Feb 2 02:29:06 1997 *************** *** 9,11 **** --- 9,19 ---- default font(NX_DEFAULTFONT) is assigned very low, so if the same ascent is selected, the font selected by user is preferred. KSC-5601.1992 is fully supported. + + 0.22(97/2/1) + NXRegisterFontByName() function has a return value(fail/succ). + NXDrawString() memory leak problem is solved(XFreeFontInfo()). + (Thanks to Jung-Sik Shin) + Strange behavior of Digital Unix 3.x Korean Environment is solved. + (KSC5601 7-bit start is ESC-$-)). + _NXQueryMatchingFont() can return valid(default) font if error occurred. diff -cr fvwm95-2.0.42ah2/fvwm/builtins.c fvwm95-2.0.42ah3/fvwm/builtins.c *** fvwm95-2.0.42ah2/fvwm/builtins.c Sun Oct 13 20:16:17 1996 --- fvwm95-2.0.42ah3/fvwm/builtins.c Sun Feb 2 01:48:21 1997 *************** *** 1759,1765 **** action = GetNextToken(action,&font); ! NXRegisterFontByName(font); free(font); } --- 1759,1766 ---- action = GetNextToken(action,&font); ! if (NXRegisterFontByName(font)==0) /* font loading error */ ! fvwm_msg(ERR,"LoadHanFont","HanFont '%s' is not found.\n", font); free(font); } diff -cr fvwm95-2.0.42ah2/include/fvwm/nxdraw.h fvwm95-2.0.42ah3/include/fvwm/nxdraw.h *** fvwm95-2.0.42ah2/include/fvwm/nxdraw.h Mon Oct 14 10:13:56 1996 --- fvwm95-2.0.42ah3/include/fvwm/nxdraw.h Sun Feb 2 02:01:08 1997 *************** *** 1,9 **** /* Hangul Drawing routine used in X ! version 0.2 ! 1996.9 Choi Jun-Ho(junker@vishnu.snu.ac.kr) Narae, CS Dept, SNU. */ --- 1,9 ---- /* Hangul Drawing routine used in X ! version 0.22 ! 1997.2.1 Choi Jun-Ho(junker@jazz.snu.ac.kr) Narae, CS Dept, SNU. */ *************** *** 12,17 **** --- 12,21 ---- #include + #ifndef NXLIB + #define NXLIB + #endif + #define MAX_NHFONT 10 #define MAX_LINE 256 *************** *** 19,25 **** /* if your machine is Solaris 2.4 and above, trying this for default font.. */ /*#define NX_DEFAULTFONT "-sun-gothic-medium-r-normal--12-120-75-75-c-120-ksc5601.1987-0"*/ ! /* this works almost all cases... */ #define NX_DEFAULTFONT "-daewoo-gothic-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0" typedef struct _NXFont{ --- 23,30 ---- /* if your machine is Solaris 2.4 and above, trying this for default font.. */ /*#define NX_DEFAULTFONT "-sun-gothic-medium-r-normal--12-120-75-75-c-120-ksc5601.1987-0"*/ ! ! /* this works almost all cases... NX_DEFALUTFONT must exist! */ #define NX_DEFAULTFONT "-daewoo-gothic-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0" typedef struct _NXFont{ *************** *** 33,39 **** extern Display* NX_Display; Display* NXOpenDisplay(); ! void NXRegisterFontByName(); void NXDrawString(); int NXTextWidth(); void NXCloseDisplay(); --- 38,44 ---- extern Display* NX_Display; Display* NXOpenDisplay(); ! int NXRegisterFontByName(); void NXDrawString(); int NXTextWidth(); void NXCloseDisplay(); diff -cr fvwm95-2.0.42ah2/libs/nxdraw.c fvwm95-2.0.42ah3/libs/nxdraw.c *** fvwm95-2.0.42ah2/libs/nxdraw.c Mon Oct 14 10:33:23 1996 --- fvwm95-2.0.42ah3/libs/nxdraw.c Sun Feb 2 01:40:32 1997 *************** *** 1,9 **** /* Hangul Drawing routine used in X ! version 0.2 ! 1996.9 Choi Jun-Ho(junker@vishnu.snu.ac.kr) Narae, CS Dept, SNU. */ --- 1,9 ---- /* Hangul Drawing routine used in X ! version 0.22 ! 1997.2.1 Choi Jun-Ho(junker@jazz.snu.ac.kr) Narae, CS Dept, SNU. */ *************** *** 12,20 **** --- 12,22 ---- #include #include + /* for fvwm95 */ #include "fvwm/nxdraw.h" #define ABS(x) ((x)>0?(x):-(x)) + /* utils */ static int _NXConvEUC_KR7(); static int _EUC_KR2WC(); *************** *** 54,72 **** This call load font using XLoadQueryFont() calls to get ascent metrics. */ ! void NXRegisterFontByName(fontname) char* fontname; { NXFont* backup; if (NX_Display==NULL) return; /* cannot do without display */ /* add font to chain */ backup=hfont; hfont=(NXFont*)malloc(sizeof(NXFont)); hfont->fontname=strdup(fontname); ! hfont->font=XLoadQueryFont(NX_Display, fontname); hfont->ascent=hfont->font->ascent; hfont->fid=hfont->font->fid; hfont->next=backup; --- 56,82 ---- This call load font using XLoadQueryFont() calls to get ascent metrics. + + Return Value: 1 as succeed, 0 as failure */ ! int NXRegisterFontByName(fontname) char* fontname; { NXFont* backup; + XFontStruct* newfont; if (NX_Display==NULL) return; /* cannot do without display */ + /* if specified font is not found, return failure */ + if ((newfont=XLoadQueryFont(NX_Display, fontname))==NULL){ + return 0; + } + /* add font to chain */ backup=hfont; hfont=(NXFont*)malloc(sizeof(NXFont)); hfont->fontname=strdup(fontname); ! hfont->font=newfont; hfont->ascent=hfont->font->ascent; hfont->fid=hfont->font->fid; hfont->next=backup; *************** *** 139,144 **** --- 149,155 ---- /* clean up */ XFreeGC(display, hgc); + XFreeFontInfo(NULL, efont, 1); } /* NXTextWidth() *************** *** 267,273 **** if (string[i]==0x1b){ if (i+4next; } ! /* error */ if (selfont==NULL) ! return NULL; #ifdef DEBUG fprintf(stderr, "Font %s selected\n", selfont->fontname); --- 339,347 ---- curfont=curfont->next; } ! /* error, return default hangul font */ if (selfont==NULL) ! return (&defaultfont)->font; #ifdef DEBUG fprintf(stderr, "Font %s selected\n", selfont->fontname); diff -cr fvwm95-2.0.42ah2/modules/FvwmButtons/parse.c fvwm95-2.0.42ah3/modules/FvwmButtons/parse.c *** fvwm95-2.0.42ah2/modules/FvwmButtons/parse.c Sun Oct 13 20:34:24 1996 --- fvwm95-2.0.42ah3/modules/FvwmButtons/parse.c Sun Feb 2 01:51:47 1997 *************** *** 755,761 **** case 9:/* HanFont */ trimleft(s); trimright(s); ! NXRegisterFontByName(s); break; #endif default: --- 755,762 ---- case 9:/* HanFont */ trimleft(s); trimright(s); ! if (NXRegisterFontByName(s)==0) /* font loading failure */ ! fprintf(stderr,"%s: HanFont '%s' is not found.\n",MyName,s); break; #endif default: diff -cr fvwm95-2.0.42ah2/modules/FvwmIdent/FvwmIdent.c fvwm95-2.0.42ah3/modules/FvwmIdent/FvwmIdent.c *** fvwm95-2.0.42ah2/modules/FvwmIdent/FvwmIdent.c Sun Oct 13 20:38:09 1996 --- fvwm95-2.0.42ah3/modules/FvwmIdent/FvwmIdent.c Sun Feb 2 02:13:13 1997 *************** *** 172,178 **** } #ifdef NXLIB ! NXRegisterFontByName(hanfont_string); #endif if(app_win == 0) --- 172,179 ---- } #ifdef NXLIB ! if (NXRegisterFontByName(hanfont_string)==0) ! fprintf(stderr,"%s: HanFont '%s' is not found.\n", MyName, hanfont_string); #endif if(app_win == 0) diff -cr fvwm95-2.0.42ah2/modules/FvwmTaskBar/FvwmTaskBar.c fvwm95-2.0.42ah3/modules/FvwmTaskBar/FvwmTaskBar.c *** fvwm95-2.0.42ah2/modules/FvwmTaskBar/FvwmTaskBar.c Sun Oct 13 20:44:16 1996 --- fvwm95-2.0.42ah3/modules/FvwmTaskBar/FvwmTaskBar.c Sun Feb 2 02:14:16 1997 *************** *** 1044,1050 **** #ifdef NXLIB if (hanfont_string!=NULL) ! NXRegisterFontByName(hanfont_string); #endif fontheight = SelButtonFont->ascent + SelButtonFont->descent; --- 1044,1051 ---- #ifdef NXLIB if (hanfont_string!=NULL) ! if (NXRegisterFontByName(hanfont_string)==0) ! ConsoleMessage("FvwmTaskBarHanFont '%s' is not found\n", hanfont_string); #endif fontheight = SelButtonFont->ascent + SelButtonFont->descent; diff -cr fvwm95-2.0.42ah2/modules/FvwmTaskBar/Goodies.c fvwm95-2.0.42ah3/modules/FvwmTaskBar/Goodies.c *** fvwm95-2.0.42ah2/modules/FvwmTaskBar/Goodies.c Sun Oct 13 20:42:45 1996 --- fvwm95-2.0.42ah3/modules/FvwmTaskBar/Goodies.c Sun Feb 2 02:14:32 1997 *************** *** 115,121 **** } #ifdef NXLIB if (statushanfont_string!=NULL) ! NXRegisterFontByName(statushanfont_string); #endif fontheight = StatusFont->ascent + StatusFont->descent; --- 115,122 ---- } #ifdef NXLIB if (statushanfont_string!=NULL) ! if (NXRegisterFontByName(statushanfont_string)==0) ! ConsoleMessage("FvwmTaskBarStatusHanFont '%s' is not found\n", statushanfont_string); #endif fontheight = StatusFont->ascent + StatusFont->descent; diff -cr fvwm95-2.0.42ah2/modules/FvwmWinList/FvwmWinList.c fvwm95-2.0.42ah3/modules/FvwmWinList/FvwmWinList.c *** fvwm95-2.0.42ah2/modules/FvwmWinList/FvwmWinList.c Sun Oct 13 20:47:06 1996 --- fvwm95-2.0.42ah3/modules/FvwmWinList/FvwmWinList.c Sun Feb 2 02:17:52 1997 *************** *** 183,189 **** #ifdef NXLIB /* Hangul Font Setup */ if (hanfont!=NULL) ! NXRegisterFontByName(hanfont); #endif XSetErrorHandler((XErrorHandler) ErrorHandler); --- 183,192 ---- #ifdef NXLIB /* Hangul Font Setup */ if (hanfont!=NULL) ! if (NXRegisterFontByName(hanfont)==0){ ! fprintf(stderr,"%s: HanFont '%s' is not found.\n", Module, hanfont); ! ConsoleMessage("%s: HanFont '%s' is not found.\n", Module, hanfont); ! } #endif XSetErrorHandler((XErrorHandler) ErrorHandler);