From 711336c348ac9b98cd22464496e6b7e9a109c3a9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 19 Jun 2017 09:58:25 -0400 Subject: fontsrv: avoid quote mapping on fonts with indistinguishable quotes Fixes #86. Change-Id: Id487219a0fcfdb68133fc81b11383365a1431c1c Reviewed-on: https://plan9port-review.googlesource.com/2922 Reviewed-by: Russ Cox --- src/cmd/fontsrv/osx.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cmd/fontsrv/osx.c b/src/cmd/fontsrv/osx.c index d1a31837..f48f5b49 100644 --- a/src/cmd/fontsrv/osx.c +++ b/src/cmd/fontsrv/osx.c @@ -17,17 +17,31 @@ extern void CGFontGetGlyphsForUnichars(CGFontRef, const UniChar[], const CGGlyph[], size_t); +// In these fonts, it's too hard to distinguish U+2018 and U+2019, +// so don't map the ASCII quotes there. +// See https://github.com/9fans/plan9port/issues/86 +static char *skipquotemap[] = { + "Courier", + "Osaka", +}; + int -mapUnicode(int i) +mapUnicode(char *name, int i) { + int j; + + if(0xd800 <= i && i < 0xe0000) // surrogate pairs, will crash OS X libraries! + return 0xfffd; + for(j=0; jwidth = 0; fc->left = 0; if(i == 0) { -- cgit v1.2.3