From: Jake Song <apple@xlgames.net>
Subject: Patch for anti-aliased font in Mac OS X
Date: Fri, 16 Jul 2004 04:27:07 +0900 [thread overview]
Message-ID: <BD1D099B.461%apple@xlgames.net> (raw)
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
}
reply other threads:[~2004-07-15 19:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BD1D099B.461%apple@xlgames.net \
--to=apple@xlgames.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).