aboutsummaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/draw.h4
-rw-r--r--include/memdraw.h1
2 files changed, 0 insertions, 5 deletions
diff --git a/include/draw.h b/include/draw.h
index 2f283bdf..926cc748 100644
--- a/include/draw.h
+++ b/include/draw.h
@@ -199,7 +199,6 @@ struct Display
int obufsize;
uchar *obufp;
Font *defaultfont;
- Subfont *defaultsubfont;
Image *windows;
Image *screenimage;
int _isnewdisplay;
@@ -498,7 +497,6 @@ extern Point strsubfontwidth(Subfont*, char*);
extern int loadchar(Font*, Rune, Cacheinfo*, int, int, char**);
extern char* subfontname(char*, char*, int);
extern Subfont* _getsubfont(Display*, char*);
-extern Subfont* getdefont(Display*);
extern void lockdisplay(Display*);
extern void unlockdisplay(Display*);
extern int drawlsetrefresh(u32int, int, void*, void*);
@@ -508,8 +506,6 @@ extern void swapfont(Font*, Font**, Font**);
/*
* Predefined
*/
-extern uchar defontdata[];
-extern int sizeofdefont;
extern Point ZP;
extern Rectangle ZR;
diff --git a/include/memdraw.h b/include/memdraw.h
index b1495ed8..a22dbe2b 100644
--- a/include/memdraw.h
+++ b/include/memdraw.h
@@ -178,7 +178,6 @@ extern Memsubfont* allocmemsubfont(char*, int, int, int, Fontchar*, Memimage*);
extern Memsubfont* openmemsubfont(char*);
extern void freememsubfont(Memsubfont*);
extern Point memsubfontwidth(Memsubfont*, char*);
-extern Memsubfont* getmemdefont(void);
/*
* Predefined