]> code.delx.au - gnu-emacs/commitdiff
* macterm.c (Vmac_use_core_graphics): defined
authorSteven Tamm <steventamm@mac.com>
Sun, 16 Jan 2005 00:31:53 +0000 (00:31 +0000)
committerSteven Tamm <steventamm@mac.com>
Sun, 16 Jan 2005 00:31:53 +0000 (00:31 +0000)
(syms_of_macterm): Added mac-use-core-graphics
(mac_draw_string_common): Use core graphics text rendering if
mac-use-core-graphics is enabled.

src/ChangeLog
src/macterm.c

index a8dd700f7d56e487ea20980aae344f5600cf8a47..6f67d5e49fcf13b210fe00c2a600a32b6df99b95 100644 (file)
@@ -1,5 +1,10 @@
 2005-01-15  Steven Tamm  <steventamm@mac.com>
 
+       * macterm.c (Vmac_use_core_graphics): defined
+       (syms_of_macterm): Added mac-use-core-graphics
+       (mac_draw_string_common): Use core graphics text rendering if
+       mac-use-core-graphics is enabled.
+
        * macfns.c (Fx_file_dialog): Save As dialog includes only the
        file name in the text box.
 
index 0dc530cda8e231f02b22172132e70180b5460244..4a1593309ba7b9f9d0a9a6ee252d58e137c5be1a 100644 (file)
@@ -101,6 +101,10 @@ Boston, MA 02111-1307, USA.  */
 
 Lisp_Object Vx_toolkit_scroll_bars;
 
+/* If Non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text.  */
+Lisp_Object Vmac_use_core_graphics;
+
+
 /* Non-zero means that a HELP_EVENT has been generated since Emacs
    start.  */
 
@@ -725,6 +729,13 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
      int nchars, mode, bytes_per_char;
 {
   SetPortWindowPort (w);
+#ifdef MAC_OSX
+  UInt32 textFlags, savedFlags;
+  if (!NILP(Vmac_use_core_graphics)) {
+    textFlags = kQDUseCGTextRendering;
+    savedFlags = SwapQDTextFlags(textFlags);
+  }
+#endif
 
   mac_set_colors (gc);
 
@@ -735,6 +746,10 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
 
   MoveTo (x, y);
   DrawText (buf, 0, nchars * bytes_per_char);
+#ifdef MAC_OSX
+  if (!NILP(Vmac_use_core_graphics))
+    SwapQDTextFlags(savedFlags);
+#endif
 }
 
 
@@ -9901,8 +9916,17 @@ Toolbox for processing before Emacs sees it.  */);
    doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
 Toolbox for processing before Emacs sees it.  */);
   Vmac_pass_control_to_system = Qt;
+
+  DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system,
+   doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
+Toolbox for processing before Emacs sees it.  */);
+  Vmac_pass_control_to_system = Qt;
 #endif
 
+  DEFVAR_LISP ("mac-use-core-graphics", &Vmac_use_core_graphics,
+   doc: /* If non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text.  */);
+  Vmac_use_core_graphics = Qnil;
+
   DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding,
     doc: /* One of the Text Encoding Base constant values defined in the
 Basic Text Constants section of Inside Macintosh - Text Encoding