aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatheuristic <matheuristic@users.noreply.github.com>2023-09-04 13:47:37 -0400
committerDan Cross <crossd@gmail.com>2023-09-05 12:55:40 -0400
commitdfbafb68e22de866ab0a708862230acbac50910a (patch)
treecf5fca6b8bd3f6049cc4650fc7a6681a1786b506
parent65c090346a38a8c30cb242d345aa71060116340c (diff)
acme: have Dump save both low and high DPI fontnames
Instead of only saving a window's currently displayed font's name to the dump file, have Acme's Dump command save that window's combined low DPI and high DPI font names when both are available. See 9fans/plan9port#630
-rw-r--r--src/cmd/acme/rows.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
index 7a64fabf..8aee340f 100644
--- a/src/cmd/acme/rows.c
+++ b/src/cmd/acme/rows.c
@@ -319,7 +319,7 @@ rowdump(Row *row, char *file)
int i, j, fd, m, n, start, dumped;
uint q0, q1;
Biobuf *b;
- char *buf, *a, *fontname;
+ char *buf, *a, *fontname, *fontfmt, *fontnamelo, *fontnamehi;
Rune *r;
Column *c;
Window *w, *w1;
@@ -394,9 +394,17 @@ rowdump(Row *row, char *file)
if(w1->nopen[QWevent])
goto Continue2;
}
- fontname = "";
- if(t->reffont->f != font)
- fontname = t->reffont->f->name;
+ fontfmt = "%s";
+ fontnamelo = "";
+ fontnamehi = nil;
+ if(t->reffont->f != font){
+ fontnamelo = t->reffont->f->lodpi->name;
+ if(t->reffont->f->hidpi != nil){
+ fontfmt = "%s,%s";
+ fontnamehi = t->reffont->f->hidpi->name;
+ }
+ }
+ fontname = smprint(fontfmt, fontnamelo, fontnamehi);
if(t->file->nname)
a = runetobyte(t->file->name, t->file->nname);
else
@@ -428,6 +436,7 @@ rowdump(Row *row, char *file)
100.0*(w->r.min.y-c->r.min.y)/Dy(c->r),
w->body.file->b.nc, fontname);
}
+ free(fontname);
free(a);
winctlprint(w, buf, 0);
Bwrite(b, buf, strlen(buf));