[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for Mac OS X Text Drawing

From: Arthur G.P. Schuster
Subject: Patch for Mac OS X Text Drawing
Date: Fri, 14 Jan 2005 21:39:28 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)


this is the first patch I have ever sent (and also the first time I
used Ediff), so be kind.  I found out (at
<http://developer.apple.com/qa/qa2001/qa1193.html>) 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,


*** /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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]