aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fontsrv
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2018-11-15 23:52:05 -0500
committerRuss Cox <rsc@swtch.com>2018-11-16 00:03:24 -0500
commit16d00819899260085ee10949012b07bf1c203db6 (patch)
tree540151e0f43ef7e08255d31f5c68b4100c783b93 /src/cmd/fontsrv
parent3ebbb99ce3b13357f4dfb0156877c6e5892de5aa (diff)
downloadplan9port-16d00819899260085ee10949012b07bf1c203db6.tar.gz
plan9port-16d00819899260085ee10949012b07bf1c203db6.tar.bz2
plan9port-16d00819899260085ee10949012b07bf1c203db6.zip
libdraw: redo default font construction to be hidpi-safe
If $font is not set, the default font is constructed from font data linked into every libdraw binary. That process was different from the usual openfont code, and so it was not hidpi-aware, resulting in very tiny fonts out of the box on hidpi systems, until users set $font. Fix this by using openfont to construct the default font, by recognizing the name *default* when looking for font and subfont file contents. Then all the hidpi scaling applies automatically. As a side effect, the concept of a 'default subfont' is gone, as are display->defaultsubfont, getdefont, and memgetdefont.
Diffstat (limited to 'src/cmd/fontsrv')
-rw-r--r--src/cmd/fontsrv/a.h1
-rw-r--r--src/cmd/fontsrv/main.c3
2 files changed, 0 insertions, 4 deletions
diff --git a/src/cmd/fontsrv/a.h b/src/cmd/fontsrv/a.h
index 3344d28e..164b1bd6 100644
--- a/src/cmd/fontsrv/a.h
+++ b/src/cmd/fontsrv/a.h
@@ -30,6 +30,5 @@ Memsubfont* mksubfont(XFont*, char*, int, int, int, int);
extern XFont *xfont;
extern int nxfont;
void *emalloc9p(ulong);
-extern Memsubfont *defont;
void drawpjw(Memimage*, Fontchar*, int, int, int, int);
diff --git a/src/cmd/fontsrv/main.c b/src/cmd/fontsrv/main.c
index b00802d8..37f0da32 100644
--- a/src/cmd/fontsrv/main.c
+++ b/src/cmd/fontsrv/main.c
@@ -13,8 +13,6 @@
#include "a.h"
-Memsubfont *defont;
-
void
usage(void)
{
@@ -526,7 +524,6 @@ main(int argc, char **argv)
fmtinstall('R', Rfmt);
fmtinstall('P', Pfmt);
memimageinit();
- defont = getmemdefont();
loadfonts();
qsort(xfont, nxfont, sizeof xfont[0], fontcmp);