* Patch for anti-aliased font in Mac OS X
@ 2004-07-15 19:27 Jake Song
0 siblings, 0 replies; only message in thread
From: Jake Song @ 2004-07-15 19:27 UTC (permalink / 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
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-15 19:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-15 19:27 Patch for anti-aliased font in Mac OS X Jake Song
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).