emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch for Mac OS X Text Drawing


From: Steven Tamm
Subject: Re: Patch for Mac OS X Text Drawing
Date: Sat, 15 Jan 2005 16:39:19 -0800

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
<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,

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
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel





reply via email to

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