From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jake Song Newsgroups: gmane.emacs.bugs Subject: Patch for anti-aliased font in Mac OS X Date: Fri, 16 Jul 2004 04:27:07 +0900 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1089919700 29431 80.91.224.253 (15 Jul 2004 19:28:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2004 19:28:20 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 15 21:28:08 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BlBtn-0005Vt-00 for ; Thu, 15 Jul 2004 21:28:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BlBwI-00040J-Bi for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jul 2004 15:30:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BlBwH-00040E-Hy for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2004 15:30:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BlBwG-000402-Jj for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2004 15:30:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BlBwG-0003zz-GF for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2004 15:30:40 -0400 Original-Received: from [61.107.45.57] (helo=feye.xlgames.co.kr) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1BlBtV-0006Yn-23 for bug-gnu-emacs@gnu.org; Thu, 15 Jul 2004 15:27:50 -0400 Original-Received: from [211.196.237.152] ([211.196.237.152]) (AUTH: LOGIN apple) by feye.xlgames.co.kr with esmtp; Fri, 16 Jul 2004 04:27:09 +0900 User-Agent: Microsoft-Entourage/11.0.0.040405 Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:8419 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:8419 Here is a small patch to use CoreGraphics anti-aliased fonts in Mac OS X. CoreGraphics(=Quartz 2D) anti-aliasing looks much better than Carbon one. Regards, Jake Song Index: src/macterm.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/macterm.c,v retrieving revision 1.75 diff -u -r1.75 macterm.c --- src/macterm.c 5 Jul 2004 07:01:02 -0000 1.75 +++ src/macterm.c 15 Jul 2004 19:24:04 -0000 @@ -728,6 +728,16 @@ TextFont (gc->font->mac_fontnum); TextSize (gc->font->mac_fontsize); TextFace (gc->font->mac_fontface); +#ifdef MAC_OS_X_VERSION_10_2 + if (mode == srcCopy) { + // Anti-aliased font is supported only for srcOr mode. + short width = TextWidth(buf, 0, nchars * bytes_per_char); + Rect r; + SetRect(&r, x, y - gc->font->ascent, x + width, y + gc->font->descent); + EraseRect(&r); + mode = srcOr; + } +#endif TextMode (mode); MoveTo (x, y); @@ -8750,6 +8760,9 @@ SetPortWindowPort (mwp->mWP); SizeWindow (mwp->mWP, FRAME_PIXEL_WIDTH (fp), FRAME_PIXEL_HEIGHT (fp), false); +#ifdef MAC_OS_X_VERSION_10_2 + QDSwapPortTextFlags(GetWindowPort(mwp->mWP), kQDUseCGTextRendering|kQDUseCGTextMetrics); +#endif }