fix libdraw cf2subfont bug. depth var was equal to zero, and subfontname function was unable to locate subfont file. to reproduce the bug: scat moon moon .... plot stringwidth: bad character set for rune 0x0000 in /lib/font/bit/lucida/unicode.6.font ... Notes: Sat Jan 22 11:17:42 EST 2005 rsc thanks for including easy-to-test demonstrations of the bug being fixed! russ Reference: /n/sources/patch/applied/libdraw-cf2subfont Date: Sat Jan 22 17:16:17 CET 2005 Reviewed-by: rsc --- /sys/src/libdraw/font.c Sat Jan 22 17:16:17 2005 +++ /sys/src/libdraw/font.c Sat Jan 22 17:16:17 2005 @@ -154,11 +154,9 @@ name = cf->subfontname; if(name == nil){ - depth = 0; - if(f->display){ - if(f->display->screenimage) - depth = f->display->screenimage->depth; - }else + if(f->display && f->display->screenimage) + depth = f->display->screenimage->depth; + else depth = 8; name = subfontname(cf->name, f->name, depth); if(name == nil)