From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net Date: Tue, 12 May 2009 09:08:47 +0000 From: prem Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [9fans] stats font problem fixed Topicbox-Message-UUID: f6fa77fa-ead4-11e9-9d60-3106f5b1d025 Hi, I use ttf2subf'ed fonts on my lcd, only program that doesn't obay the current rio font settings is stats. I have added the code below which not only obeys the current rio settings but also addes support for specifying new font with -F switch. --- ../../../../../sys/src/cmd/stats.c 2008-07-01 17:13:36.000000000 +0530 +++ stats.c 2009-05-12 12:03:39.000000000 +0530 @@ -197,7 +197,7 @@ int ylabels = 0; int oldsystem = 0; int sleeptime = 1000; - +char *fontname=nil; char *procnames[NPROC] = {"main", "mouse"}; void @@ -258,9 +258,12 @@ void colinit(void) { - mediumfont = openfont(display, "/lib/font/bit/pelm/ latin1.8.font"); - if(mediumfont == nil) + if(fontname != nil) + mediumfont=openfont(display, fontname); + else if (font) mediumfont = font; + else + mediumfont = openfont(display, "/lib/font/bit/pelm/ latin1.8.font"); /* Peach */ mkcol(0, 0xFFAAAAFF, 0xFFAAAAFF, 0xBB5D5DFF); @@ -1265,6 +1268,9 @@ nargs = 0; ARGBEGIN{ + case 'F': + fontname = EARGF(usage()); + break; case 'T': secs = atof(EARGF(usage())); if(secs > 0) =============== Thanks /Prem