acme: add font control message

This commit is contained in:
Russ Cox 2020-07-18 19:52:58 -04:00
parent 951446a774
commit 057d8a76a9
2 changed files with 24 additions and 1 deletions

View file

@ -20,7 +20,7 @@ serves a variety of files for reading, writing, and controlling
windows.
Some of them are virtual versions of system files for dealing
with the virtual console; others control operations
of
of
.I acme
itself.
When a command is run under
@ -234,6 +234,11 @@ Equivalent to the
.B Get
interactive command with no arguments; accepts no arguments.
.TP
.BI font " path
Equivalent to the
.B Font
interactive command with a single (required) argument.
.TP
.B limit=addr
When the
.B ctl

View file

@ -701,6 +701,24 @@ out:
winsetname(w, r, nr);
m += (q+1) - pp;
}else
if(strncmp(p, "font ", 5) == 0){ /* execute font command */
pp = p+5;
m = 5;
q = memchr(pp, '\n', e-pp);
if(q==nil || q==pp){
err = Ebadctl;
break;
}
*q = 0;
nulls = FALSE;
cvttorunes(pp, q-pp, r, &nb, &nr, &nulls);
if(nulls){
err = "nulls in font string";
break;
}
fontx(&w->body, nil, nil, FALSE, XXX, r, nr);
m += (q+1) - pp;
}else
if(strncmp(p, "dump ", 5) == 0){ /* set dump string */
pp = p+5;
m = 5;