tAdd -F option. (Lou Kamenov) - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 24d56929770f47314bfbebed9325dd5bcdaa8771
(DIR) parent 0aae8d3d0969e8e593ce39434586c9b3160bf850
(HTM) Author: rsc <devnull@localhost>
Date: Mon, 31 Oct 2005 20:08:05 +0000
Add -F option. (Lou Kamenov)
Diffstat:
M src/cmd/draw/stats.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/src/cmd/draw/stats.c b/src/cmd/draw/stats.c
t@@ -107,6 +107,7 @@ Image *cols[Ncolor][3];
Graph *graph;
Machine *mach;
Font *mediumfont;
+char *fontname;
char *mysysname;
char argchars[] = "bceEfiIlmnsw";
int pids[1024];
t@@ -180,7 +181,10 @@ mkcol(int i, int c0, int c1, int c2)
void
colinit(void)
{
- mediumfont = openfont(display, "/lib/font/bit/pelm/latin1.8.font");
+ if(fontname)
+ mediumfont = openfont(display, fontname);
+ if(mediumfont == nil)
+ mediumfont = openfont(display, "/lib/font/bit/pelm/latin1.8.font");
if(mediumfont == nil)
mediumfont = font;
t@@ -332,7 +336,7 @@ update1(Graph *g, long v, ulong vmax)
void
usage(void)
{
- fprint(2, "usage: stats [-O] [-S scale] [-LY] [-W winsize] [-%s] [machine...]\n", argchars);
+ fprint(2, "usage: stats [-LY] [-F font] [-O] [-S scale] [-W winsize] [-%s] [machine...]\n", argchars);
threadexitsall("usage");
}
t@@ -705,6 +709,9 @@ threadmain(int argc, char *argv[])
case 'L':
logscale++;
break;
+ case 'F':
+ fontname = EARGF(usage());
+ break;
case 'Y':
ylabels++;
break;