From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Wheeler Newsgroups: gmane.emacs.devel Subject: Re: [patch] Fix ns-antialias-text in Mac OS for 24.4 Date: Thu, 23 Oct 2014 16:15:40 +0200 Message-ID: References: <2C5AA177-0F30-418C-ACA3-11BFA9E76E73@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_E107D34A-3560-4C2E-AFDA-25541BBDF5EA" X-Trace: ger.gmane.org 1414078073 3471 80.91.229.3 (23 Oct 2014 15:27:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2014 15:27:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 23 17:27:47 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XhKIk-0002uk-8W for ged-emacs-devel@m.gmane.org; Thu, 23 Oct 2014 17:27:46 +0200 Original-Received: from localhost ([::1]:40808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhKIj-0006XE-Pa for ged-emacs-devel@m.gmane.org; Thu, 23 Oct 2014 11:27:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhJB7-0007uk-57 for emacs-devel@gnu.org; Thu, 23 Oct 2014 10:15:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhJB0-0007gQ-RW for emacs-devel@gnu.org; Thu, 23 Oct 2014 10:15:49 -0400 Original-Received: from smtp105.iad3a.emailsrvr.com ([173.203.187.105]:35306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhJB0-0007gJ-Kq for emacs-devel@gnu.org; Thu, 23 Oct 2014 10:15:42 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp14.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 48E802807AE for ; Thu, 23 Oct 2014 10:15:42 -0400 (EDT) X-Virus-Scanned: OK Original-Received: by smtp14.relay.iad3a.emailsrvr.com (Authenticated sender: scott-AT-directededge.com) with ESMTPSA id F06BE2807B5 for ; Thu, 23 Oct 2014 10:15:41 -0400 (EDT) X-Sender-Id: scott@directededge.com Original-Received: from [192.168.0.245] ([UNAVAILABLE]. [91.64.6.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA) by 0.0.0.0:465 (trex/5.2.13); Thu, 23 Oct 2014 14:15:42 GMT In-Reply-To: <2C5AA177-0F30-418C-ACA3-11BFA9E76E73@gmx.de> X-Mailer: Apple Mail (2.1990.1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 173.203.187.105 X-Mailman-Approved-At: Thu, 23 Oct 2014 11:27:14 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175730 Archived-At: --Apple-Mail=_E107D34A-3560-4C2E-AFDA-25541BBDF5EA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Oct 23, 2014, at 3:31 AM, Scott Wheeler wrote: >=20 > In the recent release ns-antialias-text / mac-allow-anti-aliasing were = broken for Mac (they have no effect). [...] >=20 > After using this a bit, it became clear that when disabling antialiased = fonts, turning off synthetic bold is desirable as well. Patch attached = with both changes. -Scott --Apple-Mail=_E107D34A-3560-4C2E-AFDA-25541BBDF5EA Content-Disposition: attachment; filename=emacs-fix-ns-antialias-text-mac.diff Content-Type: application/octet-stream; name="emacs-fix-ns-antialias-text-mac.diff" Content-Transfer-Encoding: 7bit commit c735f7e4af9375bba17e133a0d7b69a79ef604f1 Author: Scott Wheeler Date: Thu Oct 23 15:32:32 2014 +0200 Disable synthetic bold when antialiased fonts are disabled diff --git a/src/macfont.m b/src/macfont.m index ee86d9b..cb2d0be 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -2517,6 +2517,7 @@ macfont_open (struct frame * f, Lisp_Object entity, int pixel_size) && FONT_SLANT_NUMERIC (entity) == FONT_SLANT_SYNTHETIC_ITALIC) macfont_info->synthetic_italic_p = 1; if (!(sym_traits & MAC_FONT_TRAIT_BOLD) + && !NILP (ns_antialias_text) && FONT_WEIGHT_NUMERIC (entity) == FONT_WEIGHT_SYNTHETIC_BOLD) macfont_info->synthetic_bold_p = 1; if (sym_traits & MAC_FONT_TRAIT_MONO_SPACE) commit aded58804f19f286a15b46f87f7835919f9c2efc Author: Scott Wheeler Date: Thu Oct 23 03:13:14 2014 +0200 Check to see if the user has explicitly disabled anti-aliasing diff --git a/src/macfont.m b/src/macfont.m index 69bde9f..ee86d9b 100644 --- a/src/macfont.m +++ b/src/macfont.m @@ -2768,7 +2768,8 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, CGFloat advance_delta = 0; int y_draw = -s->ybase; int no_antialias_p = - (macfont_info->antialias == MACFONT_ANTIALIAS_OFF + (NILP (ns_antialias_text) + || macfont_info->antialias == MACFONT_ANTIALIAS_OFF || (macfont_info->antialias == MACFONT_ANTIALIAS_DEFAULT && font_size <= macfont_antialias_threshold)); --Apple-Mail=_E107D34A-3560-4C2E-AFDA-25541BBDF5EA--