aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/fontsrv
diff options
context:
space:
mode:
authorXiao-Yong <jinxiaoyong@gmail.com>2018-11-13 22:09:59 -0600
committerRuss Cox <rsc@golang.org>2018-11-13 23:09:59 -0500
commit2419c9343827a679353a8c0a44fd6e0e3e631a3c (patch)
tree4bcdd0a65e3dfde314290766e9fdbc2b69b58d74 /src/cmd/fontsrv
parent014fd65a5ca780823c0e75787f193d3c6597de8f (diff)
downloadplan9port-2419c9343827a679353a8c0a44fd6e0e3e631a3c.tar.gz
plan9port-2419c9343827a679353a8c0a44fd6e0e3e631a3c.tar.bz2
plan9port-2419c9343827a679353a8c0a44fd6e0e3e631a3c.zip
fontsrv: disable font smoothing on osx (#196)
macOS Mojave version 10.14 starts to disable font smoothing. We disable font smoothing for OSX_VERSION >= 101400 to match the system default font rendering. It also makes the font rendering on macOS similar to that on X11.
Diffstat (limited to 'src/cmd/fontsrv')
-rw-r--r--src/cmd/fontsrv/mkfile1
-rw-r--r--src/cmd/fontsrv/osx.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/fontsrv/mkfile b/src/cmd/fontsrv/mkfile
index eed0355a..8ad99dbc 100644
--- a/src/cmd/fontsrv/mkfile
+++ b/src/cmd/fontsrv/mkfile
@@ -1,4 +1,5 @@
<$PLAN9/src/mkhdr
+<|osxvers
<|sh ../devdraw/mkwsysrules.sh
<|sh freetyperules.sh $WSYSTYPE $X11H
diff --git a/src/cmd/fontsrv/osx.c b/src/cmd/fontsrv/osx.c
index b28ee252..c01ae6ce 100644
--- a/src/cmd/fontsrv/osx.c
+++ b/src/cmd/fontsrv/osx.c
@@ -277,6 +277,9 @@ mksubfont(XFont *f, char *name, int lo, int hi, int size, int antialias)
CGContextSetAllowsAntialiasing(ctxt, antialias);
CGContextSetTextPosition(ctxt, 0, 0); // XXX
+#if OSX_VERSION >= 101400
+ CGContextSetAllowsFontSmoothing(ctxt, false);
+#endif
x = 0;
for(i=lo; i<=hi; i++, fc++) {