tacme: add font control message - 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 057d8a76a9d840994edf453f97245efb295d9582 (DIR) parent 951446a77417743b8ed900cb1b5a1ae08522840e (HTM) Author: Russ Cox <rsc@swtch.com> Date: Sat, 18 Jul 2020 19:52:58 -0400 acme: add font control message Diffstat: M man/man4/acme.4 | 7 ++++++- M src/cmd/acme/xfid.c | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) --- (DIR) diff --git a/man/man4/acme.4 b/man/man4/acme.4 t@@ -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 t@@ -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 (DIR) diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c t@@ -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;