From 2419c9343827a679353a8c0a44fd6e0e3e631a3c Mon Sep 17 00:00:00 2001 From: Xiao-Yong Date: Tue, 13 Nov 2018 22:09:59 -0600 Subject: 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. --- src/cmd/fontsrv/mkfile | 1 + src/cmd/fontsrv/osx.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') 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++) { -- cgit v1.2.3