[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for anti-aliased font in Mac OS X
From: |
Jake Song |
Subject: |
Patch for anti-aliased font in Mac OS X |
Date: |
Fri, 16 Jul 2004 04:27:07 +0900 |
User-agent: |
Microsoft-Entourage/11.0.0.040405 |
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
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Patch for anti-aliased font in Mac OS X,
Jake Song <=