*** xc/lib/font/FreeType/ftfuncs.c.1.1b	2003-12-19 13:45:34.000000000 +0900
--- xc/lib/font/FreeType/ftfuncs.c	2003-12-21 00:33:45.000000000 +0900
***************
*** 89,94 ****
--- 89,96 ----
  
  /* Does the X accept noSuchChar? */
  #define X_ACCEPTS_NO_SUCH_CHAR
+ /* Does the XAA accept NULL noSuchChar.bits?(dangerous) */
+ /* #define XAA_ACCEPTS_NULL_BITS */
  
  #ifdef X_ACCEPTS_NO_SUCH_CHAR
  static CharInfoRec noSuchChar = { /* metrics */{0,0,0,0,0,0},
***************
*** 611,616 ****
--- 613,625 ----
      xrc = FreeTypeRasteriseGlyph(idx, flags, 
  				 &(*glyphs)[segment][offset], instance, 
  				 (*available)[segment][offset] >= FT_AVAILABLE_METRICS);
+     if(xrc != Successful && (*available)[segment][offset] >= FT_AVAILABLE_METRICS) {
+ 	fprintf(stderr,"Warning: FreeTypeRasteriseGlyph() returns an error,\n");
+ 	fprintf(stderr,"         so the backend tries to set a white space.\n");
+ 	xrc = FreeTypeRasteriseGlyph(idx, flags | FT_GET_DUMMY,
+ 				     &(*glyphs)[segment][offset], instance,
+ 				     (*available)[segment][offset] >= FT_AVAILABLE_METRICS);
+     }
      if(xrc == Successful) {
          (*available)[segment][offset] = FT_AVAILABLE_RASTERISED;
  	/* return the glyph */
***************
*** 1276,1281 ****
--- 1285,1292 ----
      FreeTypeFreeInstance(font->instance);
      if(font->ranges)
          xfree(font->ranges);
+     if(font->dummy_char.bits)
+ 	xfree(font->dummy_char.bits);
      xfree(font);
  }
  
***************
*** 3454,3460 ****
              *gp++ = g;
          }
  #ifdef X_ACCEPTS_NO_SUCH_CHAR
! 	else *gp++ = &noSuchChar;
  #endif
      }
      
--- 3465,3497 ----
              *gp++ = g;
          }
  #ifdef X_ACCEPTS_NO_SUCH_CHAR
! 	else {
! #ifdef XAA_ACCEPTS_NULL_BITS
! 	    *gp++ = &noSuchChar;
! #else
! 	    if ( tf->dummy_char.bits ) {
! 		*gp++ = &tf->dummy_char;
! 	    }
! 	    else {
! 		char *raster = NULL;
! 		int wd_actual, ht_actual, wd, ht, bpr;
! 		wd_actual = tf->info->maxbounds.rightSideBearing - tf->info->maxbounds.leftSideBearing;
! 		ht_actual = tf->info->maxbounds.ascent + tf->info->maxbounds.descent;
! 		if(wd_actual <= 0) wd = 1;
! 		else wd=wd_actual;
! 		if(ht_actual <= 0) ht = 1;
! 		else ht=ht_actual;
! 		bpr = (((wd + (tf->instance->bmfmt.glyph<<3) - 1) >> 3) & 
! 		       -tf->instance->bmfmt.glyph);
! 		raster = (char*)xalloc(ht * bpr);
! 		if( raster ) {
! 		    memset(raster, 0, ht * bpr);
! 		    tf->dummy_char.bits = raster;
! 		    *gp++ = &tf->dummy_char;
! 		}
! 	    }
! #endif
! 	}
  #endif
      }
      
*** xc/lib/font/FreeType/ftfuncs.h.1.1b	2003-11-02 13:43:24.000000000 +0900
--- xc/lib/font/FreeType/ftfuncs.h	2003-12-20 23:18:19.000000000 +0900
***************
*** 147,152 ****
--- 147,153 ----
      unsigned zero_idx;
      FontInfoPtr info;
      int nranges;
+     CharInfoRec dummy_char;
      fsRange *ranges;
  } FTFontRec, *FTFontPtr;
  
*** xc/lib/font/FreeType/ftfuncs.c.1.1c	2003-12-21 00:33:45.000000000 +0900
--- xc/lib/font/FreeType/ftfuncs.c	2003-12-22 19:49:53.000000000 +0900
***************
*** 2971,2980 ****
  	    tmp_rsb = face->face->bbox.xMax;
  	    if ( tmp_rsb < face->face->max_advance_width ) tmp_rsb = face->face->max_advance_width;
  	    /* apply scaleBBoxWidth */
! 	    /* we should not ...???
  	    tmp_lsb *= ins_ttcap->scaleBBoxWidth;
  	    tmp_rsb *= ins_ttcap->scaleBBoxWidth;
- 	    */
  	    /* transform and rescale */
  	    compute_new_extents( vals, scale, tmp_lsb, tmp_rsb, tmp_des, tmp_asc,
  				 &minLsb, &maxRsb, &descent, &ascent );
--- 2971,2979 ----
  	    tmp_rsb = face->face->bbox.xMax;
  	    if ( tmp_rsb < face->face->max_advance_width ) tmp_rsb = face->face->max_advance_width;
  	    /* apply scaleBBoxWidth */
! 	    /* we should not ...??? */
  	    tmp_lsb *= ins_ttcap->scaleBBoxWidth;
  	    tmp_rsb *= ins_ttcap->scaleBBoxWidth;
  	    /* transform and rescale */
  	    compute_new_extents( vals, scale, tmp_lsb, tmp_rsb, tmp_des, tmp_asc,
  				 &minLsb, &maxRsb, &descent, &ascent );
*** xc/fonts/encodings/large/jisx0208.1990-0.enc.orig	2003-11-02 17:27:31.000000000 +0900
--- xc/fonts/encodings/large/jisx0208.1990-0.enc	2003-12-22 19:54:47.000000000 +0900
***************
*** 379,385 ****
  0x2471  0x3091
  0x2472  0x3092
  0x2473  0x3093
! 0x2474  0x3000
  0x2475  0x3000
  0x2476  0x3000
  0x2477  0x3000
--- 379,385 ----
  0x2471  0x3091
  0x2472  0x3092
  0x2473  0x3093
! 0x2474  0x3094
  0x2475  0x3000
  0x2476  0x3000
  0x2477  0x3000
