From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Patch for Mac OS X Text Drawing Date: Sat, 15 Jan 2005 16:39:19 -0800 Message-ID: <0F0CEC8B-6757-11D9-9ECE-000D93B67DC4@mac.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105837023 2781 80.91.229.6 (16 Jan 2005 00:57:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Jan 2005 00:57:03 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 16 01:56:53 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cpyir-0006UY-00 for ; Sun, 16 Jan 2005 01:56:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CpyrH-0003ZA-7M for ged-emacs-devel@m.gmane.org; Sat, 15 Jan 2005 20:05:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CpyqQ-0003MU-HT for emacs-devel@gnu.org; Sat, 15 Jan 2005 20:04:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CpyqL-0003In-9H for emacs-devel@gnu.org; Sat, 15 Jan 2005 20:04:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CpyqJ-0003Bm-Vk for emacs-devel@gnu.org; Sat, 15 Jan 2005 20:04:36 -0500 Original-Received: from [17.250.248.85] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CpyRv-0007Ig-PG for emacs-devel@gnu.org; Sat, 15 Jan 2005 19:39:24 -0500 Original-Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id j0G0dM6B028551; Sat, 15 Jan 2005 16:39:22 -0800 (PST) Original-Received: from [10.0.1.201] (c-24-4-203-197.client.comcast.net [24.4.203.197]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 4.0) with ESMTP id j0G0dKlS007357; Sat, 15 Jan 2005 16:39:21 -0800 (PST) In-Reply-To: Original-To: arthurschuster@eircom.net (Arthur G.P. Schuster) X-Mailer: Apple Mail (2.619) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:32256 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32256 I've checked in a change that allows for anti-aliasing, but makes it optional (personally I only use it for large fonts). I added the variable: mac-allow-anti-aliasing This is defaulted to nil, meaning don't use core graphics to render text. When set to non-nil, (setq mac-use-core-graphics t), it will enable the core graphics rendering flag and will anti-alias text if that is enabled on your computer for the font you are trying to display. I'm not a big fan of the name, because there is some basic anti-aliasing done in the operating system: but calling it mac-enable-core-graphics was too technical. Thanks, -Steven On Jan 14, 2005, at 12:39 PM, Arthur G.P. Schuster wrote: > Hello, > > this is the first patch I have ever sent (and also the first time I > used Ediff), so be kind. I found out (at > ) how to draw text > with Quartz 2D without changing any of the old QuickDraw code. The > advantage of Quartz is much better anti-aliasing. And because I > desperately wanted this anti-aliasing in Emacs Carbon, I searched for > the relevant section in the code and added a few lines as suggested by > Apple. It works on my computer (running Mac OS 10.3.7), but I have no > idea about the consequences for others, as I don't really know how > Emacs works internally. > > I hope it helps to make Emacs more user-friendly on the Mac, > > Arthur. > > *** /tmp/ediff5861-oC Fri Jan 14 21:23:26 2005 > --- /Users/aschus/Developer/emacs/src/macterm.c Fri Jan 14 19:07:09 > 2005 > *************** > *** 724,729 **** > --- 724,734 ---- > char *buf; > int nchars, mode, bytes_per_char; > { > + #ifdef MAC_OSX > + UInt32 newFlags = kQDUseCGTextRendering; > + UInt32 savedFlags = SwapQDTextFlags(newFlags); > + #endif > + > SetPortWindowPort (w); > > mac_set_colors (gc); > *************** > *** 735,740 **** > --- 740,749 ---- > > MoveTo (x, y); > DrawText (buf, 0, nchars * bytes_per_char); > + > + #ifdef MAC_OSX > + SwapQDTextFlags(savedFlags); > + #endif > } > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel