all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Niv Drory <drory@astro.as.utexas.edu>
Cc: akochoi-emacs@shaw.ca
Subject: Patch to enable Quartz font smoothing on MACOSX
Date: Tue, 12 Aug 2003 12:10:44 -0500 (CDT)	[thread overview]
Message-ID: <Pine.GSO.4.55.0308121159060.13847@astro.as.utexas.edu> (raw)


Hi everybody,

Here is a patch to src/macterm.c which enables Quartz font smoothing on
Mac OS X using Carbon. This works on Mac OS X version 10.1.5 and later.

I've enclosed the changes in #ifdef ENABLE_QUARTZ_FONT_SMOOTHING which
could be set by a new option to configure (--enable-quartz-font or
something like that). If Quartz font smoothing is welcome, I'll be happy
to provide this as well. The patch is against cvs as of Aug 12 2003 17:00
CEST.

I cannot test the patch on Mac OS X prior to 10.2 nor in classic/Mac OS
7-9 since I have no access to such machines.

Thanks to everybody for their great work on EMACS,

Cheers,

	Niv

---------------------------------------------------------------------
Niv Drory                             |
Department of Astronomy               | phone:     (512) 471 7426
The University of Texas at Austin     | drory at astro as utexas edu
---------------------------------------------------------------------

--- macterm.c	Tue Aug 12 11:53:06 2003
+++ macterm.c.new	Tue Aug 12 11:52:09 2003
@@ -670,7 +670,22 @@
   TextFont (gc->font->mac_fontnum);
   TextSize (gc->font->mac_fontsize);
   TextFace (gc->font->mac_fontface);
-  TextMode (mode);
+
+#ifdef ENABLE_QUARTZ_FONT_SMOOTHING
+  if( mode != srcOr )
+    {
+      Rect rc;
+      rc.left = x;
+      rc.bottom = y+FONT_DESCENT(gc->font);
+      rc.top = rc.bottom - FONT_HEIGHT(gc->font);
+      rc.right = x+nchars*FONT_WIDTH(gc->font);
+      TextMode(mode);
+      EraseRect(&rc);
+    }
+  TextMode (srcOr);
+#else
+  TextMode(mode);
+#endif

   MoveTo (x, y);
   DrawText (buf, 0, nchars * bytes_per_char);
@@ -8725,6 +8740,11 @@
   init_required_apple_events ();

   init_mac_drag_n_drop ();
+
+#ifdef ENABLE_QUARTZ_FONT_SMOOTHING
+  /* if possible, enable Quartz font smoothing in QuickDraw */
+  SwapQDTextFlags (kQDUseCGTextRendering | kQDUseCGTextMetrics);
+#endif

 #if USE_CARBON_EVENTS
   init_service_handler ();

             reply	other threads:[~2003-08-12 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-12 17:10 Niv Drory [this message]
2003-08-13  6:34 ` Patch to enable Quartz font smoothing on MACOSX Andrew Choi
  -- strict thread matches above, loose matches on Subject: below --
2003-08-13 12:59 Niv Drory
2003-08-13 13:10 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.55.0308121159060.13847@astro.as.utexas.edu \
    --to=drory@astro.as.utexas.edu \
    --cc=akochoi-emacs@shaw.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.